Auto merge of #4924 - daira:update-updatecheck, r=str4d

qa/zcash/updatecheck.py: remove dead code; print instructions to run `cargo outdated` and `cargo update`

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Homu 2021-01-05 19:58:34 +00:00
commit 5094a8b634
1 changed files with 11 additions and 98 deletions

View File

@ -100,62 +100,6 @@ def get_dependency_list():
DependsVersionGetter("utfcpp"))
]
# Rust crates (filename portion: depends/packages/crate_<NAME>.mk).
crates = [
"addchain", "aes", "aesni", "aes_soft", "ansi_term",
"arrayvec", "arrayref", "autocfg",
"base64", "bellman", "bigint", "bit_vec", "blake2b_simd", "blake2s_simd",
"block_buffer", "block_cipher", "block_modes", "block_padding",
"bls12_381", "byteorder",
"cfg_if", "chrono", "constant_time_eq", "cpuid_bool",
"crossbeam_channel", "crossbeam_deque", "crossbeam_epoch",
"crossbeam_utils", "crossbeam_queue", "crossbeam",
"crunchy", "crypto_api", "crypto_api_chachapoly", "curve25519_dalek",
"directories", "dirs_sys", "digest",
"ed25519_zebra", "equihash",
"ff", "ff_derive", "fpe", "futures_cpupool", "futures",
"generic_array", "getrandom", "group",
"hermit_abi", "hex", "jubjub", "log",
"lazy_static", "libc", "matchers", "maybe_uninit", "memoffset",
"num_bigint", "num_cpus", "num_integer", "num_traits",
"ppv_lite86", "proc_macro2", "quote",
"opaque_debug", "pairing", "rand", "typenum",
"rand_chacha", "rand_core", "rand_hc", "rand_xorshift",
"redox_syscall", "redox_users",
"regex", "regex_automata", "regex_syntax", "rust_argon2",
"scopeguard", "serde",
"serde_derive", "sha2", "sharded_slab", "subtle", "syn", "thiserror",
"thiserror_impl", "thread_local", "time", "tracing", "tracing_appender",
"tracing_attributes", "tracing_core", "tracing_subscriber",
"unicode_xid", "version_check", "wasi",
"winapi_i686_pc_windows_gnu", "winapi",
"winapi_x86_64_pc_windows_gnu", "zcash_history", "zcash_primitives",
"zcash_proofs", "zeroize"
]
# Sometimes we need multiple versions of a crate, in which case there can't
# be a direct mapping between the filename portion and the crate name.
crate_name_exceptions = {
}
for crate in crates:
if crate in crate_name_exceptions.keys():
crate_name = crate_name_exceptions[crate]
else:
crate_name = crate
# Rust dependency checks are temporarily disabled:
# https://github.com/zcash/zcash/issues/4726
# No-op statement to keep pyflakes happy:
crate_name = crate_name
# dependencies.append(
# Dependency("crate_" + crate,
# RustCrateReleaseLister(crate_name),
# DependsVersionGetter("crate_" + crate)
# )
# )
return dependencies
class Version(list):
@ -238,47 +182,6 @@ class GithubTagReleaseLister:
json = r.json()
return list(map(lambda t: t["ref"].split("/")[-1], json))
class RustCrateReleaseLister:
def __init__(self, crate):
self.crate = crate
def known_releases(self):
url = "https://crates.io/api/v1/crates/" + safe(self.crate) + "/versions"
r = requests.get(url)
if r.status_code != 200:
raise RuntimeError("Request to crates.io versions API failed.")
json = r.json()
version_numbers = list(map(lambda t: t["num"], json["versions"]))
release_versions = []
for num in version_numbers:
match = re.match("^(\d+)\.(\d+)\.(\d+)$", num)
if match:
release_versions.append(Version(match.groups()))
if len(release_versions) == 0:
raise RuntimeError("Failed to list release versions from crates.io.")
return release_versions
class LibGmpReleaseLister:
def known_releases(self):
url = "https://gmplib.org/download/gmp/"
r = requests.get(url)
if r.status_code != 200:
raise RuntimeError("Request to libgmp download directory failed.")
page = r.text
# We use a set because the search will result in duplicates.
release_versions = set()
for match in re.findall("gmp-(\d+)\.(\d+)\.(\d+)\.tar.bz2", page):
release_versions.add(Version(match))
if Version((6, 1, 2)) not in release_versions:
raise RuntimeError("Missing expected version from libgmp download directory.")
return list(release_versions)
class BerkeleyDbReleaseLister:
def known_releases(self):
url = "https://www.oracle.com/technetwork/products/berkeleydb/downloads/index-082944.html"
@ -465,10 +368,20 @@ def main():
sys.exit(0)
if status == 0:
print("Ready to release. All dependencies are up-to-date or postponed.")
print("All non-Rust dependencies are up-to-date or postponed.")
elif status == 1:
print("Release is BLOCKED. There are new dependency updates that have not been postponed.")
print("""
You should also check the Rust dependencies using cargo:
cargo install cargo-outdated cargo-audit
cargo outdated
cargo audit
""")
if status == 0:
print("After checking those, you'll be ready for release! :-)")
sys.exit(status)
main()