From 33a1f68c4a0531def0399a9d990e5cf15f83b0ed Mon Sep 17 00:00:00 2001 From: Marcin Radomski Date: Thu, 21 Mar 2024 22:45:05 +0100 Subject: [PATCH 1/2] Add check-minimal action to GH workflows Runs cargo check on nightly requesting a build with minimum versions of dependencies declared as supported. --- .github/workflows/rust.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4f4c6c1d..4244d70e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -38,6 +38,20 @@ jobs: - name: Smoke test run: cargo run --manifest-path tests/smoke-test/Cargo.toml + check-minimal: + name: Check minimal versions + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + + - name: Install Rust Toolchain + run: rustup default nightly + + - name: Check minimal versions + run: cargo check --all --features serde,arbitrary,bytemuck,std,example_generated --all-targets -Z minimal-versions + benches: name: Benches runs-on: ubuntu-latest From 4b535a70be98e136f1b7fe48b160fc395b53915f Mon Sep 17 00:00:00 2001 From: Marcin Radomski Date: Thu, 21 Mar 2024 22:56:55 +0100 Subject: [PATCH 2/2] Bump required dependency versions To minimal versions required to build most features (all other than core and rustc-dep-of-std) with --all-targets. Minimal required versions discovered by manual binsearch between minimum compatible version declared currently and the newest one available, and rerunning cargo check --all \ --features serde,arbitrary,bytemuck,std,example_generated \ --all-targets -Z minimal-versions to verify if it builds. --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ca0aaefd..393a53ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,18 +18,18 @@ A macro to generate structures which behave like bitflags. exclude = ["/tests", "/.github"] [dependencies] -serde = { version = "1.0", optional = true, default-features = false } +serde = { version = "1.0.103", optional = true, default-features = false } arbitrary = { version = "1.0", optional = true } -bytemuck = { version = "1.0", optional = true } +bytemuck = { version = "1.12", optional = true } core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" } compiler_builtins = { version = "0.1.2", optional = true } [dev-dependencies] -trybuild = "1.0" +trybuild = "1.0.18" rustversion = "1.0" serde_derive = "1.0" serde_json = "1.0" -serde_test = "1.0" +serde_test = "1.0.19" zerocopy = { version = "0.7", features = ["derive"] } arbitrary = { version = "1.0", features = ["derive"] } bytemuck = { version = "1.0", features = ["derive"] }