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

chore: move hyper to a newer MSRV #4983

Merged
merged 30 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
dee300e
chore: move hyper to a newer MSRV
dougch Dec 17, 2024
239b731
chore: Move s2n-tls-hyper to a separate workspace
dougch Dec 17, 2024
237ee15
move integration to the standard workspace
dougch Dec 17, 2024
b8bb646
update integration path
dougch Dec 17, 2024
d1dec6b
fix GHA integraiton path
dougch Dec 17, 2024
bd709c5
add the hyper dep back
dougch Dec 17, 2024
f3aaf2b
fix path for external build GHA
dougch Dec 18, 2024
68f352c
PR feedback
dougch Dec 18, 2024
6bbfff9
revert pinning change
dougch Dec 18, 2024
c26dfb0
move the original workspace down a level
dougch Dec 19, 2024
52fad50
fix paths for extended tests
dougch Dec 19, 2024
55ce66e
bump MSRV once more
dougch Dec 19, 2024
9fbbcee
fix cert paths
dougch Dec 19, 2024
741cc4d
Fix generate paths in GHA
dougch Dec 19, 2024
2be3b36
move rust-examples
dougch Dec 20, 2024
07033db
fix pcap GHA path
dougch Dec 20, 2024
8fc068a
CaSe MatTerS
dougch Dec 20, 2024
c57b4dc
fix cert symlink paths
dougch Dec 20, 2024
26c1c57
move README; fix var
dougch Dec 20, 2024
fe70621
make MSRV match workspace
dougch Dec 20, 2024
a28a7cf
Update bindings/README.md
dougch Dec 20, 2024
0cf71ce
Fix msrv-url; more PR feedback
dougch Dec 20, 2024
ce46cd6
fix GHA paths
dougch Dec 20, 2024
ee8fda1
additional Readme
dougch Dec 20, 2024
e8c567b
symlink to one certs dir
dougch Dec 20, 2024
1081cb7
Update bindings/rust/README.md
dougch Dec 20, 2024
a441753
Update bindings/rust/README.md
dougch Dec 20, 2024
c855fe6
Update bindings/rust/README.md
dougch Dec 23, 2024
49239a0
Update bindings/rust/README.md
dougch Dec 23, 2024
bce62bf
Update bindings/rust/README.md
dougch Dec 23, 2024
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
18 changes: 14 additions & 4 deletions .github/workflows/ci_rust.yml
Copy link
Contributor

Choose a reason for hiding this comment

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

For the followup list: I think we'll also want rustfmt and asan running in the standard workspace.

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
goatgoose marked this conversation as resolved.
Show resolved Hide resolved

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
goatgoose marked this conversation as resolved.
Show resolved Hide resolved
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"] }
16 changes: 11 additions & 5 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 @@ -11,21 +11,27 @@ In order to generate rust bindings for s2n-tls, you need to have the following i
* libclang - this is usually installed through your system's package manager
* libssl-dev
* pkg-config

## Usage

dougch marked this conversation as resolved.
Show resolved Hide resolved
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.

### Extended

The current MSRV for `s2n-tls`, `s2n-tls-sys` and `s2n-tls-tokio` is [1.63.0](https://releases.rs/docs/1.63.0/).

dougch marked this conversation as resolved.
Show resolved Hide resolved
### Standard

The current MSRV is [1.63.0][msrv-url].
We 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.

dougch marked this conversation as resolved.
Show resolved Hide resolved
The current MSRV for the standard workspace is [1.74.0](https://releases.rs/docs/1.74.0/)
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.

goatgoose marked this conversation as resolved.
Show resolved Hide resolved
File renamed without changes.
dougch marked this conversation as resolved.
Show resolved Hide resolved
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.
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 = [
dougch marked this conversation as resolved.
Show resolved Hide resolved
"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.
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.
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
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"
goatgoose marked this conversation as resolved.
Show resolved Hide resolved
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" }
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"] }
Loading