Skip to content

Commit d8e95ac

Browse files
authored
bump rust to 1.80.1 / 2024-08-08 (#2487)
* bump rust to 1.80 * bump nightly version to 2024-07-21 * bump rust stable to 1.80.1, nightly to 2024-08-08 * clippy: macro_metavars_in_unsafe * fix unexpected tag * run anchor downstream test with their master * add no-entrypoint into workspace level lint * use correct llvm path for coverage test
1 parent f4e2fa9 commit d8e95ac

File tree

47 files changed

+155
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+155
-5
lines changed

.github/workflows/downstream-project-anchor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
runs-on: ubuntu-latest
4242
strategy:
4343
matrix:
44-
version: ["v0.29.0", "v0.30.0"]
44+
version: ["master"]
4545
steps:
4646
- uses: actions/checkout@v4
4747

Cargo.toml

+9
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,15 @@ homepage = "https://anza.xyz/"
159159
license = "Apache-2.0"
160160
edition = "2021"
161161

162+
[workspace.lints.rust.unexpected_cfgs]
163+
level = "warn"
164+
check-cfg = [
165+
'cfg(target_os, values("solana"))',
166+
'cfg(feature, values("frozen-abi", "no-entrypoint"))',
167+
'cfg(RUSTC_WITH_SPECIALIZATION)',
168+
'cfg(RUSTC_WITHOUT_SPECIALIZATION)',
169+
]
170+
162171
[workspace.dependencies]
163172
Inflector = "0.11.4"
164173
agave-transaction-view = { path = "transaction-view", version = "=2.1.0" }

account-decoder/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@ spl-pod = { workspace = true }
3434

3535
[package.metadata.docs.rs]
3636
targets = ["x86_64-unknown-linux-gnu"]
37+
38+
[lints]
39+
workspace = true

accounts-db/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,6 @@ harness = false
111111
[[bench]]
112112
name = "bench_lock_accounts"
113113
harness = false
114+
115+
[lints]
116+
workspace = true

bloom/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,6 @@ frozen-abi = [
4141
"dep:solana-frozen-abi-macro",
4242
"solana-sdk/frozen-abi",
4343
]
44+
45+
[lints]
46+
workspace = true

builtins-default-costs/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ frozen-abi = [
4444
"dep:solana-frozen-abi",
4545
"solana-vote-program/frozen-abi",
4646
]
47+
48+
[lints]
49+
workspace = true

ci/docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ RUN \
7070
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs/ | sh -s -- --no-modify-path --profile minimal --default-toolchain $RUST_VERSION -y && \
7171
rustup component add rustfmt && \
7272
rustup component add clippy && \
73-
rustup component add llvm-tools-preview && \
7473
rustup install $RUST_NIGHTLY_VERSION && \
7574
rustup component add clippy --toolchain=$RUST_NIGHTLY_VERSION && \
7675
rustup component add rustfmt --toolchain=$RUST_NIGHTLY_VERSION && \
7776
rustup component add miri --toolchain=$RUST_NIGHTLY_VERSION && \
77+
rustup component add llvm-tools-preview --toolchain=$RUST_NIGHTLY_VERSION && \
7878
rustup target add wasm32-unknown-unknown && \
7979
cargo install cargo-audit && \
8080
cargo install cargo-hack && \

ci/rust-version.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fi
2929
if [[ -n $RUST_NIGHTLY_VERSION ]]; then
3030
nightly_version="$RUST_NIGHTLY_VERSION"
3131
else
32-
nightly_version=2024-05-02
32+
nightly_version=2024-08-08
3333
fi
3434

3535

compute-budget/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ frozen-abi = [
2222
"dep:solana-frozen-abi",
2323
"solana-sdk/frozen-abi",
2424
]
25+
26+
[lints]
27+
workspace = true

core/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,6 @@ name = "sigverify_stage"
153153

154154
[package.metadata.docs.rs]
155155
targets = ["x86_64-unknown-linux-gnu"]
156+
157+
[lints]
158+
workspace = true

cost-model/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,6 @@ frozen-abi = [
5454

5555
[[bench]]
5656
name = "cost_tracker"
57+
58+
[lints]
59+
workspace = true

curves/bn254/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ array-bytes = { workspace = true }
2525
serde = { workspace = true }
2626
serde_derive = { workspace = true }
2727
serde_json = { workspace = true }
28+
29+
[lints]
30+
workspace = true

curves/curve25519/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ solana-program = { workspace = true }
1919

2020
[target.'cfg(not(target_os = "solana"))'.dependencies]
2121
curve25519-dalek = { workspace = true, features = ["serde"] }
22+
23+
[lints]
24+
workspace = true

curves/secp256k1-recover/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ frozen-abi = ["dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-a
3737

3838
[package.metadata.docs.rs]
3939
targets = ["x86_64-unknown-linux-gnu"]
40+
41+
[lints]
42+
workspace = true

define-syscall/Cargo.toml

+5
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ edition = { workspace = true }
1111

1212
[package.metadata.docs.rs]
1313
targets = ["x86_64-unknown-linux-gnu"]
14+
15+
[lints.rust]
16+
unexpected_cfgs = { level = "warn", check-cfg = [
17+
'cfg(target_feature, values("static-syscalls"))',
18+
] }

frozen-abi/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ rustc_version = { workspace = true }
3636
default = ["frozen-abi"]
3737
# no reason to deactivate this. It's needed because the build.rs is reused elsewhere
3838
frozen-abi = []
39+
40+
[lints]
41+
workspace = true

frozen-abi/macro/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ rustc_version = { workspace = true }
2424
default = ["frozen-abi"]
2525
# no reason to deactivate this. It's needed because the build.rs is reused elsewhere
2626
frozen-abi = []
27+
28+
[lints]
29+
workspace = true

gossip/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,6 @@ path = "src/main.rs"
9494

9595
[package.metadata.docs.rs]
9696
targets = ["x86_64-unknown-linux-gnu"]
97+
98+
[lints]
99+
workspace = true

ledger/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,6 @@ name = "blockstore"
112112

113113
[package.metadata.docs.rs]
114114
targets = ["x86_64-unknown-linux-gnu"]
115+
116+
[lints]
117+
workspace = true

metrics/src/counter.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ macro_rules! create_counter {
5858
#[macro_export]
5959
macro_rules! inc_counter {
6060
($name:expr, $level:expr, $count:expr) => {
61-
unsafe { $name.inc($level, $count) };
61+
#[allow(clippy::macro_metavars_in_unsafe)]
62+
unsafe {
63+
$name.inc($level, $count)
64+
};
6265
};
6366
}
6467

perf/Cargo.toml

+9
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,12 @@ name = "discard"
6464

6565
[package.metadata.docs.rs]
6666
targets = ["x86_64-unknown-linux-gnu"]
67+
68+
[lints.rust.unexpected_cfgs]
69+
level = "warn"
70+
check-cfg = [
71+
'cfg(build_target_feature_avx)',
72+
'cfg(build_target_feature_avx2)',
73+
'cfg(RUSTC_WITH_SPECIALIZATION)',
74+
'cfg(RUSTC_WITHOUT_SPECIALIZATION)',
75+
]

poseidon/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ light-poseidon = { workspace = true }
2121

2222
[package.metadata.docs.rs]
2323
targets = ["x86_64-unknown-linux-gnu"]
24+
25+
[lints]
26+
workspace = true

program-runtime/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,6 @@ frozen-abi = [
5959
"solana-sdk/frozen-abi",
6060
]
6161
shuttle-test = ["solana-type-overrides/shuttle-test", "solana_rbpf/shuttle-test"]
62+
63+
[lints]
64+
workspace = true

programs/address-lookup-table/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ name = "solana_address_lookup_table_program"
3232

3333
[package.metadata.docs.rs]
3434
targets = ["x86_64-unknown-linux-gnu"]
35+
36+
[lints]
37+
workspace = true

programs/sbf/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ homepage = "https://anza.xyz"
77
license = "Apache-2.0"
88
edition = "2021"
99

10+
[workspace.lints.rust.unexpected_cfgs]
11+
level = "warn"
12+
check-cfg = ['cfg(target_os, values("solana"))']
13+
1014
[workspace.dependencies]
1115
array-bytes = "=1.4.1"
1216
bincode = { version = "1.1.4", default-features = false }

programs/sbf/rust/custom_heap/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ custom-heap = []
1717

1818
[lib]
1919
crate-type = ["cdylib"]
20+
21+
[lints]
22+
workspace = true

programs/sbf/rust/deprecated_loader/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ solana-program = { workspace = true }
1313

1414
[lib]
1515
crate-type = ["cdylib"]
16+
17+
[lints]
18+
workspace = true

programs/sbf/rust/membuiltins/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ solana-sbf-rust-mem-dep = { workspace = true }
1414

1515
[lib]
1616
crate-type = ["cdylib"]
17+
18+
[lints]
19+
workspace = true

programs/sbf/rust/panic/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ custom-panic = []
1717

1818
[lib]
1919
crate-type = ["cdylib"]
20+
21+
[lints]
22+
workspace = true

programs/sbf/rust/ro_modify/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ solana-program = { workspace = true }
1313

1414
[lib]
1515
crate-type = ["cdylib"]
16+
17+
[lints]
18+
workspace = true

programs/sbf/rust/sanity/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ solana-program = { workspace = true }
1313

1414
[lib]
1515
crate-type = ["cdylib"]
16+
17+
[lints]
18+
workspace = true

programs/stake/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ name = "solana_stake_program"
3535

3636
[package.metadata.docs.rs]
3737
targets = ["x86_64-unknown-linux-gnu"]
38+
39+
[lints]
40+
workspace = true

programs/vote/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,6 @@ frozen-abi = [
4848
"solana-program-runtime/frozen-abi",
4949
"solana-sdk/frozen-abi",
5050
]
51+
52+
[lints]
53+
workspace = true

runtime-transaction/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ rustc_version = { workspace = true, optional = true }
3636
[[bench]]
3737
name = "process_compute_budget_instructions"
3838
harness = false
39+
40+
[lints]
41+
workspace = true

runtime/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,6 @@ frozen-abi = [
133133

134134
[[bench]]
135135
name = "prioritization_fee_cache"
136+
137+
[lints]
138+
workspace = true

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel = "1.78.0"
2+
channel = "1.80.1"

scripts/coverage.sh

+9
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ fi
2828
# shellcheck source=ci/rust-version.sh
2929
source "$here/../ci/rust-version.sh" nightly
3030

31+
# Check llvm path
32+
llvm_profdata="$(find "$(rustc +"$rust_nightly" --print sysroot)" -name llvm-profdata)"
33+
if [ -z "$llvm_profdata" ]; then
34+
echo "Error: couldn't find llvm-profdata. Try installing the llvm-tools component with \`rustup component add llvm-tools-preview --toolchain=$rust_nightly\`"
35+
exit 1
36+
fi
37+
llvm_path="$(dirname "$llvm_profdata")"
38+
3139
# get commit hash. it will be used to name output folder
3240
if [ -z "$COMMIT_HASH" ]; then
3341
COMMIT_HASH=$(git rev-parse --short=9 HEAD)
@@ -66,6 +74,7 @@ grcov_common_args=(
6674
--source-dir "$here/.."
6775
--binary-path "$here/../target/cov/debug"
6876
--llvm
77+
--llvm-path "$llvm_path"
6978
--ignore \*.cargo\*
7079
--ignore \*build.rs
7180
--ignore bench-tps\*

sdk/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,6 @@ targets = ["x86_64-unknown-linux-gnu"]
119119

120120
[lib]
121121
crate-type = ["cdylib", "rlib"]
122+
123+
[lints]
124+
workspace = true

sdk/msg/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ solana-define-syscall = { workspace = true }
1414

1515
[package.metadata.docs.rs]
1616
targets = ["x86_64-unknown-linux-gnu"]
17+
18+
[lints]
19+
workspace = true

sdk/program-memory/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ targets = ["x86_64-unknown-linux-gnu"]
1717

1818
[target.'cfg(target_os = "solana")'.dependencies]
1919
solana-define-syscall = { workspace = true }
20+
21+
[lints]
22+
workspace = true

sdk/program/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,6 @@ frozen-abi = [
104104
"dep:solana-frozen-abi-macro",
105105
"solana-short-vec/frozen-abi",
106106
]
107+
108+
[lints]
109+
workspace = true

short-vec/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ frozen-abi = ["dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-a
2727

2828
[package.metadata.docs.rs]
2929
targets = ["x86_64-unknown-linux-gnu"]
30+
31+
[lints]
32+
workspace = true

svm/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,6 @@ shuttle-test = [
7676
"solana-bpf-loader-program/shuttle-test",
7777
"solana-loader-v4-program/shuttle-test",
7878
]
79+
80+
[lints]
81+
workspace = true

version/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ targets = ["x86_64-unknown-linux-gnu"]
3636

3737
[build-dependencies]
3838
rustc_version = { workspace = true, optional = true }
39+
40+
[lints]
41+
workspace = true

vote/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,6 @@ frozen-abi = [
4141
"dep:solana-frozen-abi-macro",
4242
"solana-sdk/frozen-abi",
4343
]
44+
45+
[lints]
46+
workspace = true

zk-sdk/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ zeroize = { workspace = true, features = ["zeroize_derive"] }
3939

4040
[lib]
4141
crate-type = ["cdylib", "rlib"]
42+
43+
[lints]
44+
workspace = true

zk-token-sdk/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,6 @@ zeroize = { workspace = true, features = ["zeroize_derive"] }
4141

4242
[lib]
4343
crate-type = ["cdylib", "rlib"]
44+
45+
[lints]
46+
workspace = true

0 commit comments

Comments
 (0)