Skip to content

Commit 7d8f3d6

Browse files
authored
set MSRV to 1.85 and actually test it in CI (#10275)
* set MSRV to 1.85 and actually test it in CI * revert the MSRV build to do each crate, skip zebrad
1 parent b4f9eda commit 7d8f3d6

File tree

20 files changed

+157
-92
lines changed

20 files changed

+157
-92
lines changed

.github/workflows/test-crates.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,60 @@ jobs:
142142
cargo clippy --package ${{ matrix.crate }} --all-features --all-targets -- -D warnings
143143
cargo build --package ${{ matrix.crate }} --all-features --all-targets
144144
145+
build-msrv:
146+
name: Build ${{ matrix.crate }} crate with MSRV
147+
permissions:
148+
id-token: write
149+
statuses: write
150+
timeout-minutes: 90
151+
needs: [matrix]
152+
runs-on: ubuntu-latest
153+
strategy:
154+
# avoid rate-limit errors by only launching a few of these jobs at a time,
155+
# but still finish in a similar time to the longest tests
156+
max-parallel: 4
157+
fail-fast: true
158+
matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
159+
160+
steps:
161+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
162+
with:
163+
persist-credentials: false
164+
165+
- name: Extract MSRV from Cargo.toml
166+
id: msrv
167+
run: |
168+
MSRV=$(grep 'rust-version' Cargo.toml | head -n1 | cut -d'"' -f2)
169+
echo "version=$MSRV" >> "$GITHUB_OUTPUT"
170+
echo "Extracted MSRV: $MSRV"
171+
172+
- uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c #v1.15.2
173+
with:
174+
toolchain: ${{ steps.msrv.outputs.version }}
175+
components: clippy
176+
cache-key: crate-build-msrv-${{ matrix.crate }}
177+
cache-on-failure: true
178+
179+
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b #v3.0.0
180+
with:
181+
repo-token: ${{ secrets.GITHUB_TOKEN }}
182+
183+
- name: Build ${{ matrix.crate }} crate with MSRV, all features and all targets
184+
# zebrad can have a higher MSRV than the other crates since it is a binary, so we skip the MSRV build for it.
185+
if: matrix.crate != 'zebrad'
186+
run: |
187+
cargo clippy --package ${{ matrix.crate }} --all-features --all-targets -- -D warnings
188+
cargo build --package ${{ matrix.crate }} --all-features --all-targets
189+
190+
145191
test-crate-build-success:
146192
name: test crate build success
147193
runs-on: ubuntu-latest
148194
if: always()
149195
needs:
150196
- matrix
151197
- build
198+
- build-msrv
152199
timeout-minutes: 30
153200
steps:
154201
- name: Decide whether the needed jobs succeeded or failed

Cargo.lock

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ version = "1.1.5"
165165
source = "registry+https://github.com/rust-lang/crates.io-index"
166166
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
167167
dependencies = [
168-
"windows-sys 0.61.2",
168+
"windows-sys 0.60.2",
169169
]
170170

171171
[[package]]
@@ -176,7 +176,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
176176
dependencies = [
177177
"anstyle",
178178
"once_cell_polyfill",
179-
"windows-sys 0.61.2",
179+
"windows-sys 0.60.2",
180180
]
181181

182182
[[package]]
@@ -1427,7 +1427,7 @@ dependencies = [
14271427
"libc",
14281428
"option-ext",
14291429
"redox_users",
1430-
"windows-sys 0.61.2",
1430+
"windows-sys 0.59.0",
14311431
]
14321432

14331433
[[package]]
@@ -1598,7 +1598,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
15981598
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
15991599
dependencies = [
16001600
"libc",
1601-
"windows-sys 0.61.2",
1601+
"windows-sys 0.52.0",
16021602
]
16031603

16041604
[[package]]
@@ -2118,11 +2118,11 @@ dependencies = [
21182118

21192119
[[package]]
21202120
name = "home"
2121-
version = "0.5.12"
2121+
version = "0.5.11"
21222122
source = "registry+https://github.com/rust-lang/crates.io-index"
2123-
checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d"
2123+
checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf"
21242124
dependencies = [
2125-
"windows-sys 0.61.2",
2125+
"windows-sys 0.59.0",
21262126
]
21272127

21282128
[[package]]
@@ -2567,7 +2567,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46"
25672567
dependencies = [
25682568
"hermit-abi 0.5.2",
25692569
"libc",
2570-
"windows-sys 0.61.2",
2570+
"windows-sys 0.52.0",
25712571
]
25722572

25732573
[[package]]
@@ -2756,7 +2756,7 @@ version = "1.4.0"
27562756
source = "registry+https://github.com/rust-lang/crates.io-index"
27572757
checksum = "d463f34ca3c400fde3a054da0e0b8c6ffa21e4590922f3e18281bb5eeef4cbdc"
27582758
dependencies = [
2759-
"windows-sys 0.61.2",
2759+
"windows-sys 0.59.0",
27602760
]
27612761

27622762
[[package]]
@@ -3094,7 +3094,7 @@ version = "0.50.3"
30943094
source = "registry+https://github.com/rust-lang/crates.io-index"
30953095
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
30963096
dependencies = [
3097-
"windows-sys 0.61.2",
3097+
"windows-sys 0.59.0",
30983098
]
30993099

31003100
[[package]]
@@ -4557,7 +4557,7 @@ dependencies = [
45574557
"errno",
45584558
"libc",
45594559
"linux-raw-sys",
4560-
"windows-sys 0.61.2",
4560+
"windows-sys 0.52.0",
45614561
]
45624562

45634563
[[package]]
@@ -5261,7 +5261,7 @@ dependencies = [
52615261
"getrandom 0.3.4",
52625262
"once_cell",
52635263
"rustix",
5264-
"windows-sys 0.61.2",
5264+
"windows-sys 0.52.0",
52655265
]
52665266

52675267
[[package]]
@@ -6446,7 +6446,7 @@ version = "0.1.11"
64466446
source = "registry+https://github.com/rust-lang/crates.io-index"
64476447
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
64486448
dependencies = [
6449-
"windows-sys 0.61.2",
6449+
"windows-sys 0.52.0",
64506450
]
64516451

64526452
[[package]]

Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ members = [
1717
# Use the edition 2021 dependency resolver in the workspace, to match the crates
1818
resolver = "2"
1919

20+
[workspace.package]
21+
authors = ["Zcash Foundation <zebra@zfnd.org>"]
22+
license = "MIT OR Apache-2.0"
23+
repository = "https://github.com/ZcashFoundation/zebra"
24+
homepage = "https://zfnd.org/zebra/"
25+
keywords = ["zebra", "zcash"]
26+
rust-version = "1.85.0"
27+
edition = "2021"
28+
2029
# `cargo release` settings
2130

2231
[workspace.dependencies]

tower-batch-control/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ description = "Tower middleware for batch request processing"
1010
# This code was modified from a 2019 version of:
1111
# https://github.com/tower-rs/tower/tree/master/tower/src/buffer
1212
license = "MIT"
13-
repository = "https://github.com/ZcashFoundation/zebra"
14-
edition = "2021"
13+
repository.workspace = true
14+
edition.workspace = true
15+
rust-version.workspace = true
1516

1617
# TODO: decide if we want to use the Zebra readme and home page
1718
#readme = "../README.md"

tower-fallback/Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
[package]
22
name = "tower-fallback"
33
version = "0.2.41"
4-
authors = ["Zcash Foundation <zebra@zfnd.org>"]
4+
authors.workspace = true
55
description = "A Tower service combinator that sends requests to a first service, then retries processing on a second fallback service if the first service errors."
6-
license = "MIT OR Apache-2.0"
7-
repository = "https://github.com/ZcashFoundation/zebra"
8-
edition = "2021"
6+
license.workspace = true
7+
repository.workspace = true
8+
edition.workspace = true
9+
rust-version.workspace = true
910

1011
# TODO: decide if we want to use the Zebra readme and home page
1112
#readme = "../README.md"

zebra-chain/Cargo.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
[package]
22
name = "zebra-chain"
33
version = "5.0.0"
4-
authors = ["Zcash Foundation <zebra@zfnd.org>"]
4+
authors.workspace = true
55
description = "Core Zcash data structures"
6-
license = "MIT OR Apache-2.0"
7-
repository = "https://github.com/ZcashFoundation/zebra"
8-
edition = "2021"
6+
license.workspace = true
7+
repository.workspace = true
8+
edition.workspace = true
9+
rust-version.workspace = true
910

1011
readme = "../README.md"
11-
homepage = "https://zfnd.org/zebra/"
12+
homepage.workspace = true
1213
# crates.io is limited to 5 keywords and categories
13-
keywords = ["zebra", "zcash"]
14+
keywords.workspace = true
1415
# Must be one of <https://crates.io/category_slugs>
1516
categories = ["asynchronous", "cryptography::cryptocurrencies", "encoding"]
1617

zebra-chain/src/sprout/tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,10 @@ impl NoteCommitmentTree {
259259
/// Appends a note commitment to the leafmost layer of the tree.
260260
///
261261
/// Returns an error if the tree is full.
262+
#[allow(clippy::unwrap_in_result)]
262263
pub fn append(&mut self, cm: NoteCommitment) -> Result<(), NoteCommitmentTreeError> {
263264
if self.inner.append(cm.into()) {
264265
// Invalidate cached root
265-
#[allow(clippy::unwrap_in_result)]
266266
let cached_root = self
267267
.cached_root
268268
.get_mut()

zebra-consensus/Cargo.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
[package]
22
name = "zebra-consensus"
33
version = "4.0.0"
4-
authors = ["Zcash Foundation <zebra@zfnd.org>"]
4+
authors.workspace = true
55
description = "Implementation of Zcash consensus checks"
6-
license = "MIT OR Apache-2.0"
7-
repository = "https://github.com/ZcashFoundation/zebra"
8-
edition = "2021"
6+
license.workspace = true
7+
repository.workspace = true
8+
edition.workspace = true
9+
rust-version.workspace = true
910

1011
readme = "../README.md"
11-
homepage = "https://zfnd.org/zebra/"
12+
homepage.workspace = true
1213
# crates.io is limited to 5 keywords and categories
13-
keywords = ["zebra", "zcash"]
14+
keywords.workspace = true
1415
# Must be one of <https://crates.io/category_slugs>
1516
categories = ["asynchronous", "cryptography::cryptocurrencies"]
1617

zebra-network/Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ description = "Networking code for Zebra"
1414
# was modified from a 2019 version of:
1515
# https://github.com/tower-rs/tower/tree/master/tower/src/balance/p2c/service.rs
1616
license = "MIT"
17-
repository = "https://github.com/ZcashFoundation/zebra"
18-
edition = "2021"
17+
repository.workspace = true
18+
edition.workspace = true
19+
rust-version.workspace = true
1920

2021
readme = "../README.md"
21-
homepage = "https://zfnd.org/zebra/"
22+
homepage.workspace = true
2223
# crates.io is limited to 5 keywords and categories
23-
keywords = ["zebra", "zcash"]
24+
keywords.workspace = true
2425
# Must be one of <https://crates.io/category_slugs>
2526
categories = ["asynchronous", "cryptography::cryptocurrencies", "encoding", "network-programming"]
2627

zebra-node-services/Cargo.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
[package]
22
name = "zebra-node-services"
33
version = "3.0.0"
4-
authors = ["Zcash Foundation <zebra@zfnd.org>"]
4+
authors.workspace = true
55
description = "The interfaces of some Zebra node services"
6-
license = "MIT OR Apache-2.0"
7-
repository = "https://github.com/ZcashFoundation/zebra"
8-
edition = "2021"
6+
license.workspace = true
7+
repository.workspace = true
8+
edition.workspace = true
9+
rust-version.workspace = true
910

1011
readme = "../README.md"
11-
homepage = "https://zfnd.org/zebra/"
12+
homepage.workspace = true
1213
# crates.io is limited to 5 keywords and categories
13-
keywords = ["zebra", "zcash"]
14+
keywords.workspace = true
1415
# Must be one of <https://crates.io/category_slugs>
1516
categories = ["asynchronous", "cryptography::cryptocurrencies", "network-programming"]
1617

0 commit comments

Comments
 (0)