Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bindings): Specify correct minimum versions #5028

Merged
merged 7 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/ci_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -366,3 +366,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/[email protected]
with:
crate: cargo-hack

- name: Install cargo-minimal-versions
uses: baptiste0928/[email protected]
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
4 changes: 2 additions & 2 deletions bindings/rust/extended/s2n-tls-sys/templates/Cargo.template
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ stacktrace = []
# unstable-foo = []

[dependencies]
aws-lc-rs = { version = "1" }
libc = "0.2"
aws-lc-rs = { version = "1.6.4" }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libc = "0.2.121"
Copy link
Contributor Author

@goatgoose goatgoose Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libc 0.2.121 is needed because aws-lc-sys versions before 0.24.0 required libc 0.2.121. aws-lc-sys 0.24.0 removed the libc dependency, so libc 0.2.62 should be acceptable for aws-lc-sys >= 0.24.0. However, I'm not aware of a way to specify a different minimum version depending on the version of another dependency in a build.

We could alternatively specify a higher minimum version for aws-lc-rs, so that aws-lc-sys doesn't specify any libc requirement.


[build-dependencies]
cc = { version = "1.0.100", features = ["parallel"] }
Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/extended/s2n-tls-tokio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ default = []

[dependencies]
errno = { version = "0.3" }
libc = { version = "0.2" }
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"] }
Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/extended/s2n-tls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ unstable-testing = []

[dependencies]
errno = { version = "0.3" }
libc = "0.2"
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"
Expand Down
1 change: 1 addition & 0 deletions bindings/rust/standard/bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "bench"
version = "0.1.0"
edition = "2021"
publish = false
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

publish was set to false in bench so that the --ignore-private flag would skip minimum version checks for it.


[dependencies]
s2n-tls = { path = "../../extended/s2n-tls" }
Expand Down
4 changes: 2 additions & 2 deletions bindings/rust/standard/s2n-tls-hyper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ 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"] }
hyper = { version = "1.4" }
hyper-util = { version = "0.1.4", features = ["client-legacy", "tokio", "http1", "http2"] }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hyper-util 0.1.4 is needed because we rely on Connection being implemented for TokioIo, which was implemented in 0.1.4.

tower-service = { version = "0.3" }
http = { version = "1" }

Expand Down
Loading