diff --git a/.github/workflows/lints.yml b/.github/workflows/lints.yml index bcb957bc6..fff353dcf 100644 --- a/.github/workflows/lints.yml +++ b/.github/workflows/lints.yml @@ -75,19 +75,19 @@ jobs: if: always() rust-clippy: - name: Clippy (1.64.0) + name: Clippy (1.67.1) runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.64.0 + toolchain: 1.67.1 components: clippy override: true - name: Run clippy uses: actions-rs/clippy-check@v1 with: - name: Clippy (1.64.0) + name: Clippy (1.67.1) token: ${{ secrets.GITHUB_TOKEN }} args: --all-features --all-targets -- -D warnings @@ -98,7 +98,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.64.0 + toolchain: 1.67.1 override: true - run: rustup component add rustfmt - uses: actions-rs/cargo@v1 diff --git a/Cargo.toml b/Cargo.toml index 9f201bd20..bb3dc9733 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ repository = "https://github.com/zcash/zcash" readme = "README.md" license = "MIT OR Apache-2.0" edition = "2018" -rust-version = "1.64" +rust-version = "1.67.1" [package.metadata.vet] store = { path = "./qa/supply-chain" } diff --git a/contrib/devtools/update-clang-hashes.sh b/contrib/devtools/update-clang-hashes.sh index 0e64360bb..cf682392f 100755 --- a/contrib/devtools/update-clang-hashes.sh +++ b/contrib/devtools/update-clang-hashes.sh @@ -45,4 +45,3 @@ update_clang_hash amd64-unknown-freebsd12 freebsd # For Windows cross-compilation # update_libcxx_msys2_hash LIBCXX_LIBRARY MAKEFILE_HASH_SUFFIX update_libcxx_msys2_hash libc++ sha256_hash -update_libcxx_msys2_hash libc++abi libcxxabi_sha256_hash diff --git a/depends/Makefile b/depends/Makefile index 85401b502..280581671 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -107,7 +107,7 @@ wallet_packages_$(NO_WALLET) = $(wallet_packages) packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(wallet_packages_) native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) -all_packages = $(packages) $(native_packages) +all_packages = $(native_packages) $(packages) meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk diff --git a/depends/packages/libcxx.mk b/depends/packages/libcxx.mk index 0ee3c2aea..fcda4be5c 100644 --- a/depends/packages/libcxx.mk +++ b/depends/packages/libcxx.mk @@ -1,6 +1,6 @@ package=libcxx $(package)_version=$(native_clang_version) -$(package)_msys2_version=14.0.6-1 +$(package)_msys2_version=15.0.7-3 ifneq ($(canonical_host),$(build)) ifneq ($(host_os),mingw32) @@ -9,10 +9,10 @@ ifneq ($(host_os),mingw32) $(package)_download_path=$(native_clang_download_path) $(package)_download_file_aarch64_linux=clang+llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz $(package)_file_name_aarch64_linux=clang-llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz -$(package)_sha256_hash_aarch64_linux=1a81fda984f5e607584916fdf69cf41e5385b219b983544d2c1a14950d5a65cf +$(package)_sha256_hash_aarch64_linux=8ca4d68cf103da8331ca3f35fe23d940c1b78fb7f0d4763c1c059e352f5d1bec $(package)_download_file_linux=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz $(package)_file_name_linux=clang-llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz -$(package)_sha256_hash_linux=61582215dafafb7b576ea30cc136be92c877ba1f1c31ddbbd372d6d65622fef5 +$(package)_sha256_hash_linux=38bc7f5563642e73e69ac5626724e206d6d539fbef653541b34cae0ba9c3f036 # Starting from LLVM 14.0.0, some Clang binary tarballs store libc++ in a # target-specific subdirectory. @@ -26,37 +26,17 @@ endef else # For Windows cross-compilation, use the MSYS2 binaries. +# Starting from LLVM 15.0.0, libc++abi is provided by libc++. $(package)_download_path=https://repo.msys2.org/mingw/x86_64 $(package)_download_file=mingw-w64-x86_64-libc++-$($(package)_msys2_version)-any.pkg.tar.zst $(package)_file_name=mingw-w64-x86_64-libcxx-$($(package)_msys2_version)-any.pkg.tar.zst -$(package)_sha256_hash=05f888ec1d82cb989a22ced6b85834c5d9aac46613b15334e6a2806c3d0960a4 - -$(package)_libcxxabi_download_file=mingw-w64-x86_64-libc++abi-$($(package)_msys2_version)-any.pkg.tar.zst -$(package)_libcxxabi_file_name=mingw-w64-x86_64-libcxxabi-$($(package)_msys2_version)-any.pkg.tar.zst -$(package)_libcxxabi_sha256_hash=0ca22d18cb155f6d230d7f6691c05b876316e0c381195428f063f66352689ca4 - -$(package)_extra_sources += $($(package)_libcxxabi_file_name) - -define $(package)_fetch_cmds -$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \ -$(call fetch_file,$(package),$($(package)_download_path),$($(package)_libcxxabi_download_file),$($(package)_libcxxabi_file_name),$($(package)_libcxxabi_sha256_hash)) -endef - -define $(package)_extract_cmds - mkdir -p $($(package)_extract_dir) && \ - echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \ - echo "$($(package)_libcxxabi_sha256_hash) $($(package)_source_dir)/$($(package)_libcxxabi_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ - $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ - mkdir -p libcxxabi && \ - tar --no-same-owner --strip-components=1 -C libcxxabi -xf $($(package)_source_dir)/$($(package)_libcxxabi_file_name) && \ - tar --no-same-owner --strip-components=1 -xf $($(package)_source) -endef +$(package)_sha256_hash=8c14da21fa9622cc7450b22467452c6c933a03cee526cf8744faea3d4674035b define $(package)_stage_cmds mkdir -p $($(package)_staging_prefix_dir)/lib && \ mv include/ $($(package)_staging_prefix_dir) && \ cp lib/libc++.a $($(package)_staging_prefix_dir)/lib && \ - cp libcxxabi/lib/libc++abi.a $($(package)_staging_prefix_dir)/lib + cp lib/libc++abi.a $($(package)_staging_prefix_dir)/lib endef endif diff --git a/depends/packages/native_clang.mk b/depends/packages/native_clang.mk index c431bf520..7d3f7708f 100644 --- a/depends/packages/native_clang.mk +++ b/depends/packages/native_clang.mk @@ -5,25 +5,27 @@ package=native_clang # - Manually fix the versions for packages that don't exist (the LLVM project # doesn't uniformly cut binaries across releases). # The Clang compiler should use the same LLVM version as the Rust compiler. -$(package)_major_version=14 -$(package)_version=14.0.6 -$(package)_download_path=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version) -$(package)_download_path_linux=https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0 -$(package)_download_file_linux=clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz +$(package)_major_version=15 +$(package)_version=15.0.6 +$(package)_download_path_linux=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version) +$(package)_download_file_linux=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz $(package)_file_name_linux=clang-llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz -$(package)_sha256_hash_linux=61582215dafafb7b576ea30cc136be92c877ba1f1c31ddbbd372d6d65622fef5 -$(package)_download_path_darwin=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version) -$(package)_download_file_darwin=clang+llvm-$($(package)_version)-x86_64-apple-darwin.tar.xz -$(package)_file_name_darwin=clang-llvm-$($(package)_version)-x86_64-apple-darwin.tar.xz -$(package)_sha256_hash_darwin=e6cc6b8279661fd4452c2847cb8e55ce1e54e1faf4ab497b37c85ffdb6685e7c -$(package)_download_path_freebsd=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version) -$(package)_download_file_freebsd=clang+llvm-$($(package)_version)-amd64-unknown-freebsd12.tar.xz -$(package)_file_name_freebsd=clang-llvm-$($(package)_version)-amd64-unknown-freebsd12.tar.xz +$(package)_sha256_hash_linux=38bc7f5563642e73e69ac5626724e206d6d539fbef653541b34cae0ba9c3f036 +$(package)_download_path_darwin=https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.4 +$(package)_download_file_darwin=clang+llvm-15.0.4-x86_64-apple-darwin.tar.xz +$(package)_file_name_darwin=clang-llvm-15.0.4-x86_64-apple-darwin.tar.xz +$(package)_sha256_hash_darwin=4c98d891c07c8f6661b233bf6652981f28432cfdbd6f07181114195c3536544b +# 2023-02-16: No FreeBSD packages are available for Clang 15, so we use Clang 14 +# here. This means FreeBSD builds will use two different versions of LLVM, but +# FreeBSD is only a Tier 3 platform, so that is acceptable. +$(package)_download_path_freebsd=https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6 +$(package)_download_file_freebsd=clang+llvm-14.0.6-amd64-unknown-freebsd12.tar.xz +$(package)_file_name_freebsd=clang-llvm-14.0.6-amd64-unknown-freebsd12.tar.xz $(package)_sha256_hash_freebsd=b0a7b86dacb12afb8dd2ca99ea1b894d9cce84aab7711cb1964b3005dfb09af3 $(package)_download_path_aarch64_linux=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version) $(package)_download_file_aarch64_linux=clang+llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz $(package)_file_name_aarch64_linux=clang-llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz -$(package)_sha256_hash_aarch64_linux=1a81fda984f5e607584916fdf69cf41e5385b219b983544d2c1a14950d5a65cf +$(package)_sha256_hash_aarch64_linux=8ca4d68cf103da8331ca3f35fe23d940c1b78fb7f0d4763c1c059e352f5d1bec ifneq (,$(wildcard /etc/arch-release)) $(package)_dependencies=native_libtinfo diff --git a/depends/packages/native_rust.mk b/depends/packages/native_rust.mk index 93b4e9f86..33d1f6969 100644 --- a/depends/packages/native_rust.mk +++ b/depends/packages/native_rust.mk @@ -3,16 +3,16 @@ package=native_rust # ./contrib/devtools/update-rust-hashes.sh # The Rust compiler should use the same LLVM version as the Clang compiler; you # can check this with `rustc --version -v`. -$(package)_version=1.64.0 +$(package)_version=1.67.1 $(package)_download_path=https://static.rust-lang.org/dist $(package)_file_name_linux=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz -$(package)_sha256_hash_linux=a893977f238291370ab96726a74b6b9ae854dc75fbf5730954d901a93843bf9b +$(package)_sha256_hash_linux=652a8966436c4e97b127721d9130810e1cdc8dfdf526fad68c9c1f6281bd02a3 $(package)_file_name_darwin=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz -$(package)_sha256_hash_darwin=b6003d49fb857ff8dc105a3ccba98b851cd3e7d874005acb92284fd1113adc0d +$(package)_sha256_hash_darwin=020702c9564f53e18ac880db77c2f6b660a24ea372e4fda3f0c1ef2f8b9c74b9 $(package)_file_name_freebsd=rust-$($(package)_version)-x86_64-unknown-freebsd.tar.gz -$(package)_sha256_hash_freebsd=f188a9a7f947d559add5aa7b5aa218d9c5177237eb9ea62109347f0f1464e3a2 +$(package)_sha256_hash_freebsd=d0ba56d6601542ae19af47b63671d7b0f516b429202c32339841ae60d33bd73a $(package)_file_name_aarch64_linux=rust-$($(package)_version)-aarch64-unknown-linux-gnu.tar.gz -$(package)_sha256_hash_aarch64_linux=7d8860572431bd4ee1b9cd0cd77cf7ff29fdd5b91ed7c92a820f872de6ced558 +$(package)_sha256_hash_aarch64_linux=8edee248eed4b17c09b3d7b0096944b7e5992dd1119a28429c0b6b4d39a9613c # Mapping from GCC canonical hosts to Rust targets # If a mapping is not present, we assume they are identical, unless $host_os is @@ -21,15 +21,20 @@ $(package)_rust_target_x86_64-pc-linux-gnu=x86_64-unknown-linux-gnu $(package)_rust_target_x86_64-w64-mingw32=x86_64-pc-windows-gnu # Mapping from Rust targets to SHA-256 hashes -$(package)_rust_std_sha256_hash_aarch64-unknown-linux-gnu=2b425658f84793d5bbf00ce545f410ec6454add202cce27a718d81e0233e7007 -$(package)_rust_std_sha256_hash_x86_64-apple-darwin=eb2f7c51f63973765f01efe509ccd2f26345d4bf0d77695adb4198a0899ae648 -$(package)_rust_std_sha256_hash_x86_64-pc-windows-gnu=dcf87f97432adf7228e907b551d9b73f1ab16f79dc5da0724a227b7ffdaf57b4 -$(package)_rust_std_sha256_hash_x86_64-unknown-freebsd=c91edba781ba56f35f2dba56a268d41866ea9bb5f6ffb9d342635f66b836898b +$(package)_rust_std_sha256_hash_aarch64-unknown-linux-gnu=19f3afbe43c7e041b8b5c0143101d3ede92f73f720709ef1578ad5d259ad6181 +$(package)_rust_std_sha256_hash_x86_64-apple-darwin=0d1e93cada608ee1b4474af417dea2ac06590ba4cc963a9b9f5c7164ddf42b87 +$(package)_rust_std_sha256_hash_x86_64-pc-windows-gnu=5088bfaf1d4b316e71655fcefb084cfa07876bd2ce832eb1e4b705ff27b3ad8a +$(package)_rust_std_sha256_hash_x86_64-unknown-freebsd=aa6ac1844b06143a7533e44d129083d2c28a1d34953dc432c8c3591886cc892c define rust_target $(if $($(1)_rust_target_$(2)),$($(1)_rust_target_$(2)),$(if $(findstring darwin,$(3)),x86_64-apple-darwin,$(if $(findstring freebsd,$(3)),x86_64-unknown-freebsd,$(2)))) endef +define $(package)_set_vars +$(package)_stage_opts=--disable-ldconfig +$(package)_stage_build_opts=--without=rust-docs-json-preview,rust-docs +endef + ifneq ($(canonical_host),$(build)) $(package)_rust_target=$(call rust_target,$(package),$(canonical_host),$(host_os)) $(package)_exact_file_name=rust-std-$($(package)_version)-$($(package)_rust_target).tar.gz @@ -54,12 +59,12 @@ define $(package)_extract_cmds endef define $(package)_stage_cmds - bash ./install.sh --without=rust-docs --destdir=$($(package)_staging_dir) --prefix=$(build_prefix) --disable-ldconfig && \ - ../$(canonical_host)/install.sh --destdir=$($(package)_staging_dir) --prefix=$(build_prefix) --disable-ldconfig + bash ./install.sh --destdir=$($(package)_staging_dir) --prefix=$(build_prefix) $($(package)_stage_opts) $($(package)_stage_build_opts) && \ + ../$(canonical_host)/install.sh --destdir=$($(package)_staging_dir) --prefix=$(build_prefix) $($(package)_stage_opts) endef else define $(package)_stage_cmds - bash ./install.sh --without=rust-docs --destdir=$($(package)_staging_dir) --prefix=$(build_prefix) --disable-ldconfig + bash ./install.sh --destdir=$($(package)_staging_dir) --prefix=$(build_prefix) $($(package)_stage_opts) $($(package)_stage_build_opts) endef endif diff --git a/qa/zcash/postponed-updates.txt b/qa/zcash/postponed-updates.txt index 0f30ac5e5..735fe58b3 100644 --- a/qa/zcash/postponed-updates.txt +++ b/qa/zcash/postponed-updates.txt @@ -29,28 +29,9 @@ native_ccache 4.7.2 2023-03-01 native_ccache 4.7.3 2023-03-01 native_ccache 4.7.4 2023-03-01 -# Clang and Rust are currently pinned to LLVM 14 -libcxx 15.0.0 2023-03-01 -libcxx 15.0.1 2023-03-01 -libcxx 15.0.2 2023-03-01 -libcxx 15.0.3 2023-03-01 -libcxx 15.0.4 2023-03-01 -libcxx 15.0.5 2023-03-01 -libcxx 15.0.6 2023-03-01 -libcxx 15.0.7 2023-03-01 -native_clang 15.0.0 2023-03-01 -native_clang 15.0.1 2023-03-01 -native_clang 15.0.2 2023-03-01 -native_clang 15.0.3 2023-03-01 -native_clang 15.0.4 2023-03-01 -native_clang 15.0.5 2023-03-01 -native_clang 15.0.6 2023-03-01 -native_clang 15.0.7 2023-03-01 -native_rust 1.65.0 2023-03-01 -native_rust 1.66.0 2023-03-01 -native_rust 1.66.1 2023-03-01 -native_rust 1.67.0 2023-03-01 -native_rust 1.67.1 2023-03-01 +# Clang and Rust are currently pinned to LLVM 15 +libcxx 15.0.7 2022-04-30 +native_clang 15.0.7 2022-04-30 # We're never updating to this version bdb 18.1.40 2024-02-01 diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 10add70bb..588ffd578 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.64.0" +channel = "1.67.1" diff --git a/src/rust/src/history_ffi.rs b/src/rust/src/history_ffi.rs index f132de9d3..4271d708e 100644 --- a/src/rust/src/history_ffi.rs +++ b/src/rust/src/history_ffi.rs @@ -145,7 +145,7 @@ fn librustzcash_mmr_append_inner( unsafe { *rt_ret = V::hash(root_node.data()); - for (idx, next_buf) in slice::from_raw_parts_mut(buf_ret, return_count as usize) + for (idx, next_buf) in slice::from_raw_parts_mut(buf_ret, return_count) .iter_mut() .enumerate() { diff --git a/src/rust/src/incremental_merkle_tree.rs b/src/rust/src/incremental_merkle_tree.rs index 0f51b9635..c7b228fd0 100644 --- a/src/rust/src/incremental_merkle_tree.rs +++ b/src/rust/src/incremental_merkle_tree.rs @@ -76,11 +76,11 @@ pub fn write_tree( tree: &BridgeTree, ) -> io::Result<()> { writer.write_u8(SER_V2)?; - Vector::write(&mut writer, tree.prior_bridges(), |mut w, b| { - write_bridge_v1(&mut w, b) + Vector::write(&mut writer, tree.prior_bridges(), |w, b| { + write_bridge_v1(w, b) })?; - Optional::write(&mut writer, tree.current_bridge().as_ref(), |mut w, b| { - write_bridge_v1(&mut w, b) + Optional::write(&mut writer, tree.current_bridge().as_ref(), |w, b| { + write_bridge_v1(w, b) })?; Vector::write_sized( &mut writer, diff --git a/src/rust/src/metrics_ffi.rs b/src/rust/src/metrics_ffi.rs index 8cf995eb7..35306ef9d 100644 --- a/src/rust/src/metrics_ffi.rs +++ b/src/rust/src/metrics_ffi.rs @@ -210,7 +210,7 @@ pub extern "C" fn metrics_increment_counter(key: *mut FfiKey, value: u64) { pub extern "C" fn metrics_static_update_gauge(callsite: *const FfiCallsite, value: c_double) { if let Some(recorder) = try_recorder() { let callsite = unsafe { callsite.as_ref().unwrap() }; - recorder.register_gauge(&callsite.key).set(value as f64); + recorder.register_gauge(&callsite.key).set(value); } } @@ -219,7 +219,7 @@ pub extern "C" fn metrics_update_gauge(key: *mut FfiKey, value: c_double) { if let Some(recorder) = try_recorder() { if !key.is_null() { let key = unsafe { Box::from_raw(key) }; - recorder.register_gauge(&key.inner).set(value as f64); + recorder.register_gauge(&key.inner).set(value); } } } @@ -228,9 +228,7 @@ pub extern "C" fn metrics_update_gauge(key: *mut FfiKey, value: c_double) { pub extern "C" fn metrics_static_increment_gauge(callsite: *const FfiCallsite, value: c_double) { if let Some(recorder) = try_recorder() { let callsite = unsafe { callsite.as_ref().unwrap() }; - recorder - .register_gauge(&callsite.key) - .increment(value as f64); + recorder.register_gauge(&callsite.key).increment(value); } } @@ -239,7 +237,7 @@ pub extern "C" fn metrics_increment_gauge(key: *mut FfiKey, value: c_double) { if let Some(recorder) = try_recorder() { if !key.is_null() { let key = unsafe { Box::from_raw(key) }; - recorder.register_gauge(&key.inner).increment(value as f64); + recorder.register_gauge(&key.inner).increment(value); } } } @@ -248,9 +246,7 @@ pub extern "C" fn metrics_increment_gauge(key: *mut FfiKey, value: c_double) { pub extern "C" fn metrics_static_decrement_gauge(callsite: *const FfiCallsite, value: c_double) { if let Some(recorder) = try_recorder() { let callsite = unsafe { callsite.as_ref().unwrap() }; - recorder - .register_gauge(&callsite.key) - .decrement(value as f64); + recorder.register_gauge(&callsite.key).decrement(value); } } @@ -259,7 +255,7 @@ pub extern "C" fn metrics_decrement_gauge(key: *mut FfiKey, value: c_double) { if let Some(recorder) = try_recorder() { if !key.is_null() { let key = unsafe { Box::from_raw(key) }; - recorder.register_gauge(&key.inner).decrement(value as f64); + recorder.register_gauge(&key.inner).decrement(value); } } } @@ -268,9 +264,7 @@ pub extern "C" fn metrics_decrement_gauge(key: *mut FfiKey, value: c_double) { pub extern "C" fn metrics_static_record_histogram(callsite: *const FfiCallsite, value: c_double) { if let Some(recorder) = try_recorder() { let callsite = unsafe { callsite.as_ref().unwrap() }; - recorder - .register_histogram(&callsite.key) - .record(value as f64); + recorder.register_histogram(&callsite.key).record(value); } } @@ -279,7 +273,7 @@ pub extern "C" fn metrics_record_histogram(key: *mut FfiKey, value: c_double) { if let Some(recorder) = try_recorder() { if !key.is_null() { let key = unsafe { Box::from_raw(key) }; - recorder.register_histogram(&key.inner).record(value as f64); + recorder.register_histogram(&key.inner).record(value); } } }