Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump rust to 1.80.1 / 2024-08-08 #2487

Merged
merged 8 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/downstream-project-anchor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: ["v0.29.0", "v0.30.0"]
version: ["master"]
brooksprumo marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v4

Expand Down
9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,15 @@ homepage = "https://anza.xyz/"
license = "Apache-2.0"
edition = "2021"

[workspace.lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = [
'cfg(target_os, values("solana"))',
'cfg(feature, values("frozen-abi", "no-entrypoint"))',
'cfg(RUSTC_WITH_SPECIALIZATION)',
'cfg(RUSTC_WITHOUT_SPECIALIZATION)',
]

Comment on lines +162 to +170
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this can be a follow up pr, but it seems it's prime time for us to finally move lints from scripts/cargo-clippy-nightly.sh

for that, i think this formatting is preferred:

[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
  ...
] }

like this: https://github.com/anza-xyz/agave/pull/2487/files#r1718380391

[workspace.dependencies]
Inflector = "0.11.4"
agave-transaction-view = { path = "transaction-view", version = "=2.1.0" }
Expand Down
3 changes: 3 additions & 0 deletions account-decoder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ spl-pod = { workspace = true }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions accounts-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,6 @@ harness = false
[[bench]]
name = "bench_lock_accounts"
harness = false

[lints]
workspace = true
3 changes: 3 additions & 0 deletions bloom/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ frozen-abi = [
"dep:solana-frozen-abi-macro",
"solana-sdk/frozen-abi",
]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions builtins-default-costs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ frozen-abi = [
"dep:solana-frozen-abi",
"solana-vote-program/frozen-abi",
]

[lints]
workspace = true
2 changes: 1 addition & 1 deletion ci/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ RUN \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs/ | sh -s -- --no-modify-path --profile minimal --default-toolchain $RUST_VERSION -y && \
rustup component add rustfmt && \
rustup component add clippy && \
rustup component add llvm-tools-preview && \
rustup install $RUST_NIGHTLY_VERSION && \
rustup component add clippy --toolchain=$RUST_NIGHTLY_VERSION && \
rustup component add rustfmt --toolchain=$RUST_NIGHTLY_VERSION && \
rustup component add miri --toolchain=$RUST_NIGHTLY_VERSION && \
rustup component add llvm-tools-preview --toolchain=$RUST_NIGHTLY_VERSION && \
rustup target add wasm32-unknown-unknown && \
cargo install cargo-audit && \
cargo install cargo-hack && \
Expand Down
2 changes: 1 addition & 1 deletion ci/rust-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fi
if [[ -n $RUST_NIGHTLY_VERSION ]]; then
nightly_version="$RUST_NIGHTLY_VERSION"
else
nightly_version=2024-05-02
nightly_version=2024-08-08
fi


Expand Down
3 changes: 3 additions & 0 deletions compute-budget/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ frozen-abi = [
"dep:solana-frozen-abi",
"solana-sdk/frozen-abi",
]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,6 @@ name = "sigverify_stage"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions cost-model/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ frozen-abi = [

[[bench]]
name = "cost_tracker"

[lints]
workspace = true
3 changes: 3 additions & 0 deletions curves/bn254/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ array-bytes = { workspace = true }
serde = { workspace = true }
serde_derive = { workspace = true }
serde_json = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions curves/curve25519/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ solana-program = { workspace = true }

[target.'cfg(not(target_os = "solana"))'.dependencies]
curve25519-dalek = { workspace = true, features = ["serde"] }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions curves/secp256k1-recover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ frozen-abi = ["dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-a

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[lints]
workspace = true
5 changes: 5 additions & 0 deletions define-syscall/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ edition = { workspace = true }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(target_feature, values("static-syscalls"))',
] }
Comment on lines +15 to +18
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here

3 changes: 3 additions & 0 deletions frozen-abi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ rustc_version = { workspace = true }
default = ["frozen-abi"]
# no reason to deactivate this. It's needed because the build.rs is reused elsewhere
frozen-abi = []

[lints]
workspace = true
3 changes: 3 additions & 0 deletions frozen-abi/macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ rustc_version = { workspace = true }
default = ["frozen-abi"]
# no reason to deactivate this. It's needed because the build.rs is reused elsewhere
frozen-abi = []

[lints]
workspace = true
3 changes: 3 additions & 0 deletions gossip/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,6 @@ path = "src/main.rs"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions ledger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,6 @@ name = "blockstore"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[lints]
workspace = true
5 changes: 4 additions & 1 deletion metrics/src/counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ macro_rules! create_counter {
#[macro_export]
macro_rules! inc_counter {
($name:expr, $level:expr, $count:expr) => {
unsafe { $name.inc($level, $count) };
#[allow(clippy::macro_metavars_in_unsafe)]
unsafe {
$name.inc($level, $count)
};
brooksprumo marked this conversation as resolved.
Show resolved Hide resolved
};
}

Expand Down
9 changes: 9 additions & 0 deletions perf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,12 @@ name = "discard"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = [
'cfg(build_target_feature_avx)',
'cfg(build_target_feature_avx2)',
'cfg(RUSTC_WITH_SPECIALIZATION)',
'cfg(RUSTC_WITHOUT_SPECIALIZATION)',
]
3 changes: 3 additions & 0 deletions poseidon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ light-poseidon = { workspace = true }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions program-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ frozen-abi = [
"solana-sdk/frozen-abi",
]
shuttle-test = ["solana-type-overrides/shuttle-test", "solana_rbpf/shuttle-test"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions programs/address-lookup-table/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ name = "solana_address_lookup_table_program"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[lints]
workspace = true
4 changes: 4 additions & 0 deletions programs/sbf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ homepage = "https://anza.xyz"
license = "Apache-2.0"
edition = "2021"

[workspace.lints.rust.unexpected_cfgs]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

level = "warn"
check-cfg = ['cfg(target_os, values("solana"))']

[workspace.dependencies]
array-bytes = "=1.4.1"
bincode = { version = "1.1.4", default-features = false }
Expand Down
3 changes: 3 additions & 0 deletions programs/sbf/rust/custom_heap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ custom-heap = []

[lib]
crate-type = ["cdylib"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions programs/sbf/rust/deprecated_loader/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ solana-program = { workspace = true }

[lib]
crate-type = ["cdylib"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions programs/sbf/rust/membuiltins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ solana-sbf-rust-mem-dep = { workspace = true }

[lib]
crate-type = ["cdylib"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions programs/sbf/rust/panic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ custom-panic = []

[lib]
crate-type = ["cdylib"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions programs/sbf/rust/ro_modify/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ solana-program = { workspace = true }

[lib]
crate-type = ["cdylib"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions programs/sbf/rust/sanity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ solana-program = { workspace = true }

[lib]
crate-type = ["cdylib"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions programs/stake/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ name = "solana_stake_program"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions programs/vote/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ frozen-abi = [
"solana-program-runtime/frozen-abi",
"solana-sdk/frozen-abi",
]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions runtime-transaction/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ rustc_version = { workspace = true, optional = true }
[[bench]]
name = "process_compute_budget_instructions"
harness = false

[lints]
workspace = true
3 changes: 3 additions & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,6 @@ frozen-abi = [

[[bench]]
name = "prioritization_fee_cache"

[lints]
workspace = true
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "1.78.0"
channel = "1.80.1"
9 changes: 9 additions & 0 deletions scripts/coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ fi
# shellcheck source=ci/rust-version.sh
source "$here/../ci/rust-version.sh" nightly

# Check llvm path
llvm_profdata="$(find "$(rustc +"$rust_nightly" --print sysroot)" -name llvm-profdata)"
if [ -z "$llvm_profdata" ]; then
echo "Error: couldn't find llvm-profdata. Try installing the llvm-tools component with \`rustup component add llvm-tools-preview --toolchain=$rust_nightly\`"
exit 1
fi
llvm_path="$(dirname "$llvm_profdata")"
Comment on lines +31 to +37
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️


# get commit hash. it will be used to name output folder
if [ -z "$COMMIT_HASH" ]; then
COMMIT_HASH=$(git rev-parse --short=9 HEAD)
Expand Down Expand Up @@ -66,6 +74,7 @@ grcov_common_args=(
--source-dir "$here/.."
--binary-path "$here/../target/cov/debug"
--llvm
--llvm-path "$llvm_path"
--ignore \*.cargo\*
--ignore \*build.rs
--ignore bench-tps\*
Expand Down
3 changes: 3 additions & 0 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,6 @@ targets = ["x86_64-unknown-linux-gnu"]

[lib]
crate-type = ["cdylib", "rlib"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions sdk/msg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ solana-define-syscall = { workspace = true }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions sdk/program-memory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ targets = ["x86_64-unknown-linux-gnu"]

[target.'cfg(target_os = "solana")'.dependencies]
solana-define-syscall = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions sdk/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,6 @@ frozen-abi = [
"dep:solana-frozen-abi-macro",
"solana-short-vec/frozen-abi",
]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions short-vec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ frozen-abi = ["dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-a

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions svm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,6 @@ shuttle-test = [
"solana-bpf-loader-program/shuttle-test",
"solana-loader-v4-program/shuttle-test",
]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions version/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ targets = ["x86_64-unknown-linux-gnu"]

[build-dependencies]
rustc_version = { workspace = true, optional = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions vote/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ frozen-abi = [
"dep:solana-frozen-abi-macro",
"solana-sdk/frozen-abi",
]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions zk-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ zeroize = { workspace = true, features = ["zeroize_derive"] }

[lib]
crate-type = ["cdylib", "rlib"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions zk-token-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ zeroize = { workspace = true, features = ["zeroize_derive"] }

[lib]
crate-type = ["cdylib", "rlib"]

[lints]
workspace = true