From cc51b534d196f40c2a8e156de3206ba48e442d16 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Sat, 30 Sep 2023 06:19:54 +0200 Subject: [PATCH 1/5] chore: fix MSRV CI and dev deps --- .github/workflows/ci.yml | 19 +++++++++++++------ Cargo.toml | 10 ++-------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15fb6c53..6c8fca24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,13 +18,13 @@ jobs: run: "true" test: - name: Test ${{ matrix.rust }} runs-on: ubuntu-latest timeout-minutes: 30 strategy: fail-fast: false matrix: - rust: [stable, beta, nightly, 1.65] # MSRV + rust: ["stable", "beta", "nightly", "1.65"] # MSRV + flags: ["--no-default-features", "", "--all-features"] steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master @@ -36,18 +36,25 @@ jobs: sed -i 's/nightly = \[\]//g' Cargo.toml sed -i 's/generic_const_exprs = \["nightly"\]//g' Cargo.toml - uses: Swatinem/rust-cache@v2 + # Only run tests on latest stable and above + - name: Check + if: ${{ matrix.rust == '1.65' }} # MSRV + run: cargo check ${{ matrix.flags }} + # Cargo doc test is not included in `--all-targets` so we call it separately. # See # Cargo doc test also doesn't support `--no-run`, so we run it but # have it just print `--help`. - name: Build tests + if: ${{ matrix.rust != '1.65' }} # MSRV run: | - cargo test --workspace --all-features --all-targets --no-run - cargo test --workspace --all-features --doc -- --help + cargo test --workspace ${{ matrix.flags }} --all-targets --no-run + cargo test --workspace ${{ matrix.flags }} --doc -- --help - name: Run tests + if: ${{ matrix.rust != '1.65' }} # MSRV run: | - cargo test --workspace --all-features --all-targets -- --nocapture - cargo test --workspace --all-features --doc -- --nocapture + cargo test --workspace ${{ matrix.flags }} --all-targets -- --nocapture + cargo test --workspace ${{ matrix.flags }} --doc -- --nocapture feature-checks: name: Feature checks diff --git a/Cargo.toml b/Cargo.toml index 173c1e66..02910fb2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,7 +55,7 @@ parity-scale-codec = { version = "3", optional = true, features = [ "max-encoded-len", ], default-features = false } primitive-types = { version = "0.12", optional = true, default-features = false } -proptest = { version = "1", optional = true, default-features = false } +proptest = { version = "1.2", optional = true, default-features = false } pyo3 = { version = "0.19", optional = true, default-features = false } quickcheck = { version = "1", optional = true, default-features = false } rand = { version = "0.8", optional = true, default-features = false } @@ -79,16 +79,10 @@ ark-bn254-03 = { version = "0.3.0", package = "ark-bn254" } ark-bn254-04 = { version = "0.4.0", package = "ark-bn254" } criterion = "0.5" -# clap and clap_lex, referred by criterion, have higher a MSRV (clap@4.4.0, clap_lex@0.5.1), -# but are only used by dev-dependencies so we can just pin them -clap = "~4.3" -clap_lex = "<=0.5.0" - rand = "0.8" approx = "0.5" bincode = "1.3" -coverage-helper = "0.1" hex = "0.4" hex-literal = "0.4" postgres = "0.19" @@ -131,7 +125,7 @@ fastrlp = ["dep:fastrlp", "alloc"] num-bigint = ["dep:num-bigint", "alloc"] parity-scale-codec = ["dep:parity-scale-codec", "alloc"] primitive-types = ["dep:primitive-types"] -proptest = ["dep:proptest", "std"] # TODO: change to "alloc" on the next proptest release (>1.2.0) +proptest = ["dep:proptest", "alloc"] pyo3 = ["dep:pyo3", "std"] quickcheck = ["dep:quickcheck", "std"] rand = ["dep:rand"] From 17c6e3e8bbdc69fed39e04b848e1866d97d91ad4 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Sat, 30 Sep 2023 06:21:37 +0200 Subject: [PATCH 2/5] chore: clippy --- src/bit_arr.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bit_arr.rs b/src/bit_arr.rs index 50dd3a4c..e758002e 100644 --- a/src/bit_arr.rs +++ b/src/bit_arr.rs @@ -204,6 +204,7 @@ macro_rules! forward { }; } +#[allow(clippy::missing_safety_doc, clippy::missing_errors_doc)] impl Bits { forward! { fn reverse_bits(self) -> Self; From 68a8ca0fd345ac9d6a6b99c3feb5d68334e6e437 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Sat, 30 Sep 2023 06:11:37 +0200 Subject: [PATCH 3/5] fix: remove `no_coverage` feature --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 0c2b7d07..e0b6fae7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,7 +17,7 @@ #![cfg_attr(not(feature = "std"), no_std)] // Unstable features #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] -#![cfg_attr(feature = "nightly", feature(no_coverage, core_intrinsics))] +#![cfg_attr(feature = "nightly", feature(core_intrinsics))] #![cfg_attr( feature = "generic_const_exprs", feature(generic_const_exprs), From 9a842141d58d2c5e525edf7921531130f664e65f Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Sat, 30 Sep 2023 19:34:22 +0200 Subject: [PATCH 4/5] revert proptest features --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 02910fb2..114d096e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -125,7 +125,7 @@ fastrlp = ["dep:fastrlp", "alloc"] num-bigint = ["dep:num-bigint", "alloc"] parity-scale-codec = ["dep:parity-scale-codec", "alloc"] primitive-types = ["dep:primitive-types"] -proptest = ["dep:proptest", "alloc"] +proptest = ["dep:proptest", "std"] # TODO: change to "alloc" on the next proptest release (>1.2.0) pyo3 = ["dep:pyo3", "std"] quickcheck = ["dep:quickcheck", "std"] rand = ["dep:rand"] From c0d8c04578501d2f6478909b5bfc3107a48bc048 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Sat, 30 Sep 2023 19:35:25 +0200 Subject: [PATCH 5/5] don't run msrv all features --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c8fca24..8e8272c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,10 @@ jobs: matrix: rust: ["stable", "beta", "nightly", "1.65"] # MSRV flags: ["--no-default-features", "", "--all-features"] + exclude: + # Skip because some features have higher MSRV. + - rust: "1.65" # MSRV + flags: "--all-features" steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master