Skip to content

Commit

Permalink
chore: move hyper to a newer MSRV (#4983)
Browse files Browse the repository at this point in the history
Co-authored-by: Sam Clark <[email protected]>
Co-authored-by: James Mayclin <[email protected]>
  • Loading branch information
3 people authored Dec 23, 2024
1 parent cc2ea72 commit c012d98
Show file tree
Hide file tree
Showing 106 changed files with 94 additions and 57 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/ci_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ env:
# Pin the nightly toolchain to prevent breakage.
# This should be occasionally updated.
RUST_NIGHTLY_TOOLCHAIN: nightly-2024-12-01
ROOT_PATH: bindings/rust
# Extended support MSRV
ROOT_PATH: bindings/rust/extended
# Standard support MSRV
STANDARD_PATH: bindings/rust/standard
EXAMPLE_WORKSPACE: bindings/rust-examples
PCAP_TEST_PATH: tests/pcap

Expand Down Expand Up @@ -49,6 +52,11 @@ jobs:
working-directory: ${{env.ROOT_PATH}}
run: cargo test

# Test the standard workspace
- name: Standard Workspace Tests
working-directory: ${{env.STANDARD_PATH}}
run: cargo test

- name: "Feature Tests: Fingerprint, kTLS, QUIC, and PQ"
working-directory: ${{env.ROOT_PATH}}
# Test all features except for FIPS, which is tested separately.
Expand All @@ -59,7 +67,7 @@ jobs:
run: cargo test --features unstable-renegotiate

- name: Network-enabled integration tests
working-directory: ${{env.ROOT_PATH}}/integration
working-directory: ${{env.STANDARD_PATH}}/integration
# no-default-features is used because network tests are hidden behind a
# default "negative" feature. This is because we don't want network tests
# invoked on the `cargo test --all-features` pattern.
Expand All @@ -83,7 +91,9 @@ jobs:
cd ${{env.ROOT_PATH}}
./generate.sh
ldd target/debug/integration | grep libs2n.so
# Relative paths
cd ../../..
ldd ${{env.STANDARD_PATH}}/target/debug/integration | grep libs2n.so
# our benchmark testing includes interop tests between s2n-tls, rustls, and
# openssl
Expand All @@ -102,7 +112,7 @@ jobs:
run: ${{env.ROOT_PATH}}/generate.sh --skip-tests

- name: bench tests
working-directory: ${{env.ROOT_PATH}}/bench
working-directory: ${{env.STANDARD_PATH}}/bench
run: cargo test

s2n-tls-binding-examples:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
- cron: "0 18 * * *"

env:
ROOT_PATH: bindings/rust
ROOT_PATH: bindings/rust/extended

jobs:
audit:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/regression_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
types: [checks_requested]
branches: [main]

env:
ROOT_PATH: bindings/rust/extended

jobs:
regression-test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -54,7 +57,7 @@ jobs:
# Generate bindings for main branch
- name: Generate bindings (mainline)
run: ${{env.ROOT_PATH}}bindings/rust/generate.sh --skip-tests
run: ${{env.ROOT_PATH}}/generate.sh --skip-tests

# Run performance tests using Valgrind for main branch
- name: Run scalar performance test (mainline)
Expand All @@ -68,7 +71,7 @@ jobs:

# Generate bindings for PR branch
- name: Generate bindings (PR branch)
run: ${{env.ROOT_PATH}}bindings/rust/generate.sh --skip-tests
run: ${{env.ROOT_PATH}}/generate.sh --skip-tests

# Run performance tests using Valgrind for PR branch
- name: Run scalar performance test (PR branch)
Expand Down
13 changes: 13 additions & 0 deletions bindings/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# s2n-tls rust workspaces

### Rust

Contains the bindings and other integrations, in two workspaces based on MSRV.

### Rust Examples

The current MSRV for the Rust Examples workspace is [stable](https://releases.rs/).




Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ edition.workspace = true

[dependencies]
clap = { version = "4", features = ["derive"] }
s2n-tls = { path = "../../rust/s2n-tls" }
s2n-tls-tokio = { path = "../../rust/s2n-tls-tokio" }
s2n-tls = { path = "../../rust/extended/s2n-tls" }
s2n-tls-tokio = { path = "../../rust/extended/s2n-tls-tokio" }
tokio = { version = "1", features = ["full"] }
4 changes: 2 additions & 2 deletions bindings/rust-examples/tokio-server-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license.workspace = true
edition.workspace = true

[dependencies]
s2n-tls = { path = "../../rust/s2n-tls" }
s2n-tls-tokio = { path = "../../rust/s2n-tls-tokio" }
s2n-tls = { path = "../../rust/extended/s2n-tls" }
s2n-tls-tokio = { path = "../../rust/extended/s2n-tls-tokio" }
tokio = { version = "1", features = ["full"] }
clap = { version = "4", features = ["derive"] }
14 changes: 10 additions & 4 deletions bindings/rust/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# s2n-tls rust bindings
# s2n-tls Rust Bindings

**NOTICE: These bindings are currently subject to change and should not be used without the expectation
of future breakage.**
Expand All @@ -17,15 +17,21 @@ In order to generate rust bindings for s2n-tls, you need to have the following i
Generating rust bindings can be accomplished by running the `generate.sh` script:

```
$ ./bindings/rust/generate.sh
$ ./bindings/rust/extended/generate.sh
```

This script generates the low-level bindings in the crate `s2n-tls-sys`, which is used by the `s2n-tls` crate to provide higher-level bindings.
See [s2n-tls-sys](https://github.com/aws/s2n-tls/blob/main/bindings/rust/s2n-tls-sys/README.md) for more information on `s2n-tls-sys` crate.

## Minimum Supported Rust Version (MSRV)

`s2n-tls` will maintain a rolling MSRV (minimum supported rust version) policy of at least 6 months. The current s2n-quic version is not guaranteed to build on Rust versions earlier than the MSRV.
There are two rust bindings workspaces that have different MSRV policies. Crates in `standard` maintain a rolling MSRV policy of at least 6 months. Crates in `extended` maintain an older MSRV for increased support.

The current MSRV is [1.63.0][msrv-url].
### Extended

Crates in the `extended` workspace currently support an "extended" MSRV of [1.63.0](https://releases.rs/docs/1.63.0/). This is a temporary state. Customers must not rely on `s2n-tls` crates maintaining this level of stability. We expect to revert back to the mentioned standard policy shortly.

### Standard

We will maintain a rolling MSRV (minimum supported rust version) policy of at least 6 months. The current s2n-tls version is not guaranteed to build on Rust versions earlier than the MSRV.

1 change: 0 additions & 1 deletion bindings/rust/bench/certs/ecdsa256

This file was deleted.

1 change: 0 additions & 1 deletion bindings/rust/bench/certs/ecdsa384

This file was deleted.

9 changes: 0 additions & 9 deletions bindings/rust/bench/certs/readme.md

This file was deleted.

1 change: 0 additions & 1 deletion bindings/rust/bench/certs/rsa2048

This file was deleted.

1 change: 0 additions & 1 deletion bindings/rust/bench/certs/rsa3072

This file was deleted.

1 change: 0 additions & 1 deletion bindings/rust/bench/certs/rsa4096

This file was deleted.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
[workspace]
members = [
"integration",
"s2n-tls",
"s2n-tls-sys",
"s2n-tls-tokio",
"s2n-tls-hyper",
"s2n-tls-tokio"
]
# generate can't be included in the workspace because of a bootstrapping problem
# s2n-tls-sys/Cargo.toml (part of the workspace) is generated by
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions bindings/rust/extended/certs
20 changes: 10 additions & 10 deletions bindings/rust/generate.sh → bindings/rust/extended/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ mkdir -p s2n-tls-sys/src/features
# we copy the C sources into the `lib` directory so they get published in the
# actual crate artifact.
cp -r \
../../api \
../../crypto \
../../error \
../../stuffer \
../../tls \
../../utils \
../../../api \
../../../crypto \
../../../error \
../../../stuffer \
../../../tls \
../../../utils \
s2n-tls-sys/lib/

cp -r \
../../tests/features \
../../../tests/features \
s2n-tls-sys/lib/tests/

cp -r \
../../CMakeLists.txt \
../../cmake \
../../../CMakeLists.txt \
../../../cmake \
s2n-tls-sys/lib/

# generate the bindings modules from the copied sources
Expand All @@ -52,7 +52,7 @@ cargo publish --dry-run --allow-dirty
cargo publish --dry-run --allow-dirty --all-features
popd

pushd integration
pushd ../standard/integration
cargo run
popd

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl Default for CertKeyPair {
impl CertKeyPair {
/// This is the directory holding all of the pems used for s2n-tls unit tests
const TEST_PEMS_PATH: &'static str =
concat!(env!("CARGO_MANIFEST_DIR"), "/../../../tests/pems/");
concat!(env!("CARGO_MANIFEST_DIR"), "/../../../../tests/pems/");

/// Create a test CertKeyPair
/// * `prefix`: The *relative* prefix from the s2n-tls/tests/pems/ folder.
Expand Down
2 changes: 2 additions & 0 deletions bindings/rust/standard/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target/
Cargo.lock
6 changes: 6 additions & 0 deletions bindings/rust/standard/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[workspace]
members = [
"bench",
"integration",
"s2n-tls-hyper"
]
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

[dependencies]
s2n-tls = { path = "../s2n-tls" }
s2n-tls = { path = "../../extended/s2n-tls" }
errno = "0.3"
libc = "0.2"
strum = { version = "0.25", features = ["derive"] }
Expand All @@ -14,7 +14,7 @@ openssl = { version = "0.10", features = ["vendored"] }

[dev-dependencies]
criterion = "0.5"
pprof = { version = "0.12", features = ["criterion", "flamegraph"] }
pprof = { version = "0.14", features = ["criterion", "flamegraph"] }
# env_logger and log are used to enable logging for rustls, which can help with
# debugging interop failures
env_logger = "0.10"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions bindings/rust/standard/bench/certs/ecdsa256
1 change: 1 addition & 0 deletions bindings/rust/standard/bench/certs/ecdsa384
9 changes: 9 additions & 0 deletions bindings/rust/standard/bench/certs/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This folder actually just contains symlinks to the files in s2n-tls/test/pems/permutations

```
ln -s ../../../../../tests/pems/permutations/ec_ecdsa_p256_sha256 ecdsa256
ln -s ../../../../../tests/pems/permutations/ec_ecdsa_p384_sha384 ecdsa384
ln -s ../../../../../tests/pems/permutations/rsae_pkcs_2048_sha256 rsa2048
ln -s ../../../../../tests/pems/permutations/rsae_pkcs_3072_sha384 rsa3072
ln -s ../../../../../tests/pems/permutations/rsae_pkcs_4096_sha384 rsa4096
```
1 change: 1 addition & 0 deletions bindings/rust/standard/bench/certs/rsa2048
1 change: 1 addition & 0 deletions bindings/rust/standard/bench/certs/rsa3072
1 change: 1 addition & 0 deletions bindings/rust/standard/bench/certs/rsa4096
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions bindings/rust/standard/certs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ no-network-tests = []
pq = []

[dependencies]
s2n-tls = { path = "../s2n-tls", features = ["unstable-testing"]}
s2n-tls = { path = "../../extended/s2n-tls", features = ["unstable-testing"]}
s2n-tls-hyper = { path = "../s2n-tls-hyper" }
s2n-tls-tokio = { path = "../s2n-tls-tokio" }
s2n-tls-sys = { path = "../s2n-tls-sys" }
s2n-tls-tokio = { path = "../../extended/s2n-tls-tokio" }
s2n-tls-sys = { path = "../../extended/s2n-tls-sys" }

[dev-dependencies]
tokio = { version = "1", features = ["macros", "test-util"] }
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions bindings/rust/standard/rust-toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.74.0
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = "A compatbility crate allowing s2n-tls to be used with the hyper H
version = "0.0.1"
authors = ["AWS s2n"]
edition = "2021"
rust-version = "1.63.0"
rust-version = "1.74.0"
repository = "https://github.com/aws/s2n-tls"
license = "Apache-2.0"
publish = false
Expand All @@ -13,8 +13,8 @@ publish = false
default = []

[dependencies]
s2n-tls = { version = "=0.3.9", path = "../s2n-tls" }
s2n-tls-tokio = { version = "=0.3.9", path = "../s2n-tls-tokio" }
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"] }
tower-service = { version = "0.3" }
Expand All @@ -26,7 +26,3 @@ http-body-util = "0.1"
hyper-util = { version = "0.1", features = ["server"] }
bytes = "1"

# Newer versions require Rust 1.65, see https://github.com/aws/s2n-tls/issues/4242.
hashbrown = { version = "=0.15.0" }
# Newer versions require Rust 1.70, see https://github.com/aws/s2n-tls/issues/4395.
tokio-util = { version = "=0.7.11" }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/pcap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ rtshark = "2.9.0"

[dev-dependencies]
# We want to test against the latest, local version of s2n
s2n-tls-sys = { path = "../../bindings/rust/s2n-tls-sys" }
s2n-tls = { path = "../../bindings/rust/s2n-tls", features = ["unstable-fingerprint"] }
s2n-tls-sys = { path = "../../bindings/rust/extended/s2n-tls-sys" }
s2n-tls = { path = "../../bindings/rust/extended/s2n-tls", features = ["unstable-fingerprint"] }

0 comments on commit c012d98

Please sign in to comment.