diff --git a/.github/workflows/ci_rust.yml b/.github/workflows/ci_rust.yml index 721a69f7199..f4dfcc6d60c 100644 --- a/.github/workflows/ci_rust.yml +++ b/.github/workflows/ci_rust.yml @@ -368,3 +368,45 @@ jobs: - name: Run tests working-directory: ${{env.PCAP_TEST_PATH}} run: cargo test --all-features + + minimal-versions: + runs-on: ubuntu-24.04 + strategy: + matrix: + workspace-path: + - bindings/rust/extended + - bindings/rust/standard + steps: + - uses: actions/checkout@v4 + + - name: Install Rust toolchain + id: toolchain + # minimal-versions is an unstable feature, and requires the nightly toolchain: + # https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#minimal-versions + run: | + rustup toolchain install ${{env.RUST_NIGHTLY_TOOLCHAIN}} + rustup override set ${{env.RUST_NIGHTLY_TOOLCHAIN}} + + - uses: camshaft/rust-cache@v1 + + # cargo-minimal-versions requires cargo-hack: + # https://crates.io/crates/cargo-minimal-versions#user-content-prerequisites + - name: Install cargo-hack + uses: baptiste0928/cargo-install@v3.3.0 + with: + crate: cargo-hack + + - name: Install cargo-minimal-versions + uses: baptiste0928/cargo-install@v3.3.0 + with: + crate: cargo-minimal-versions + + - name: Generate + run: ./${{env.ROOT_PATH}}/generate.sh --skip-tests + + - name: Test minimal versions + id: test-minimal-versions + working-directory: ${{matrix.workspace-path}} + run: | + cargo +${{env.RUST_NIGHTLY_TOOLCHAIN}} minimal-versions check --direct --ignore-private + cargo +${{env.RUST_NIGHTLY_TOOLCHAIN}} minimal-versions check --direct --ignore-private --all-features diff --git a/bindings/rust/extended/s2n-tls-sys/templates/Cargo.template b/bindings/rust/extended/s2n-tls-sys/templates/Cargo.template index 4c3d4b06fc3..c222ffda1c9 100644 --- a/bindings/rust/extended/s2n-tls-sys/templates/Cargo.template +++ b/bindings/rust/extended/s2n-tls-sys/templates/Cargo.template @@ -36,8 +36,12 @@ stacktrace = [] # unstable-foo = [] [dependencies] -aws-lc-rs = { version = "1" } -libc = "0.2" +# aws-lc-rs 1.6.4 adds DEP_AWS_LC environment variables which are required to build s2n-tls-sys: +# https://github.com/aws/aws-lc-rs/pull/335 +aws-lc-rs = { version = "1.6.4" } +# aws-lc-rs 1.6.4 depends on aws-lc-sys 0.14.0, which requires libc 0.2.121: +# https://github.com/aws/aws-lc-rs/blob/2298ca861234d4f43aecef2c7d7e822c60bc488a/aws-lc-sys/Cargo.toml#L65 +libc = "0.2.121" [build-dependencies] cc = { version = "1.0.100", features = ["parallel"] } diff --git a/bindings/rust/extended/s2n-tls-tokio/Cargo.toml b/bindings/rust/extended/s2n-tls-tokio/Cargo.toml index 81ed980a584..28f191e6217 100644 --- a/bindings/rust/extended/s2n-tls-tokio/Cargo.toml +++ b/bindings/rust/extended/s2n-tls-tokio/Cargo.toml @@ -13,7 +13,8 @@ default = [] [dependencies] errno = { version = "0.3" } -libc = { version = "0.2" } +# A minimum libc version of 0.2.121 is required by aws-lc-sys 0.14.0. +libc = { version = "0.2.121" } pin-project-lite = { version = "0.2" } s2n-tls = { version = "=0.3.9", path = "../s2n-tls" } tokio = { version = "1", features = ["net", "time"] } diff --git a/bindings/rust/extended/s2n-tls/Cargo.toml b/bindings/rust/extended/s2n-tls/Cargo.toml index fa4e66493f2..f3219e5d665 100644 --- a/bindings/rust/extended/s2n-tls/Cargo.toml +++ b/bindings/rust/extended/s2n-tls/Cargo.toml @@ -20,7 +20,8 @@ unstable-testing = [] [dependencies] errno = { version = "0.3" } -libc = "0.2" +# A minimum libc version of 0.2.121 is required by aws-lc-sys 0.14.0. +libc = "0.2.121" s2n-tls-sys = { version = "=0.3.9", path = "../s2n-tls-sys", features = ["internal"] } pin-project-lite = "0.2" hex = "0.4" diff --git a/bindings/rust/standard/bench/Cargo.toml b/bindings/rust/standard/bench/Cargo.toml index bb4d66bb102..becf8218a5e 100644 --- a/bindings/rust/standard/bench/Cargo.toml +++ b/bindings/rust/standard/bench/Cargo.toml @@ -2,6 +2,7 @@ name = "bench" version = "0.1.0" edition = "2021" +publish = false [dependencies] s2n-tls = { path = "../../extended/s2n-tls" } diff --git a/bindings/rust/standard/s2n-tls-hyper/Cargo.toml b/bindings/rust/standard/s2n-tls-hyper/Cargo.toml index f442d12beb6..9120cf426bd 100644 --- a/bindings/rust/standard/s2n-tls-hyper/Cargo.toml +++ b/bindings/rust/standard/s2n-tls-hyper/Cargo.toml @@ -14,8 +14,12 @@ default = [] [dependencies] s2n-tls = { version = "=0.3.9", path = "../../extended/s2n-tls" } s2n-tls-tokio = { version = "=0.3.9", path = "../../extended/s2n-tls-tokio" } -hyper = { version = "1" } -hyper-util = { version = "0.1", features = ["client-legacy", "tokio", "http1", "http2"] } +# A minimum hyper version of 1.3 is required by hyper-util 0.1.4: +# https://github.com/hyperium/hyper-util/blob/3f6a92ecd019b8d534d2945564d3ab8a92ff1f41/Cargo.toml#L34 +hyper = { version = "1.3" } +# s2n-tls-hyper depends on hyper-util functionality added in 0.1.4: +# https://github.com/hyperium/hyper-util/commit/7bae87f0fd1109e3ef48b449f63d045d67efba73 +hyper-util = { version = "0.1.4", features = ["client-legacy", "tokio", "http1", "http2"] } tower-service = { version = "0.3" } http = { version = "1" }