From 38dff292a0c0be7b4f77228f035a6c87e4170730 Mon Sep 17 00:00:00 2001 From: James Mayclin Date: Tue, 21 Mar 2023 21:18:37 +0000 Subject: [PATCH 1/4] require alloc feature for tls and rustls --- quic/s2n-quic-rustls/Cargo.toml | 2 +- quic/s2n-quic-tls/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/quic/s2n-quic-rustls/Cargo.toml b/quic/s2n-quic-rustls/Cargo.toml index 0aafb1e982..ed86914a66 100644 --- a/quic/s2n-quic-rustls/Cargo.toml +++ b/quic/s2n-quic-rustls/Cargo.toml @@ -15,7 +15,7 @@ bytes = { version = "1", default-features = false } rustls = { version = "0.20", features = ["quic"] } rustls-pemfile = "1" s2n-codec = { version = "=0.4.0", path = "../../common/s2n-codec", default-features = false } -s2n-quic-core = { version = "=0.18.0", path = "../s2n-quic-core", default-features = false } +s2n-quic-core = { version = "=0.18.0", path = "../s2n-quic-core", default-features = false, features = ["alloc"] } s2n-quic-crypto = { version = "=0.18.0", path = "../s2n-quic-crypto", default-features = false } [dev-dependencies] diff --git a/quic/s2n-quic-tls/Cargo.toml b/quic/s2n-quic-tls/Cargo.toml index be2ed8eae4..07ac33cb4e 100644 --- a/quic/s2n-quic-tls/Cargo.toml +++ b/quic/s2n-quic-tls/Cargo.toml @@ -19,7 +19,7 @@ bytes = { version = "1", default-features = false } errno = "0.2" libc = "0.2" s2n-codec = { version = "=0.4.0", path = "../../common/s2n-codec", default-features = false } -s2n-quic-core = { version = "=0.18.0", path = "../s2n-quic-core", default-features = false } +s2n-quic-core = { version = "=0.18.0", path = "../s2n-quic-core", default-features = false, features = ["alloc"] } s2n-quic-crypto = { version = "=0.18.0", path = "../s2n-quic-crypto", default-features = false } s2n-tls = { version = "=0.0.26", features = ["quic"] } From 5d21b50561dc57a691227018161b2c0287dcc8d4 Mon Sep 17 00:00:00 2001 From: James Mayclin Date: Tue, 21 Mar 2023 22:04:23 +0000 Subject: [PATCH 2/4] have h3 pull in default features --- quic/s2n-quic-h3/Cargo.toml | 6 +++--- quic/s2n-quic-h3/README.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/quic/s2n-quic-h3/Cargo.toml b/quic/s2n-quic-h3/Cargo.toml index 633c347c36..58f492a1e9 100644 --- a/quic/s2n-quic-h3/Cargo.toml +++ b/quic/s2n-quic-h3/Cargo.toml @@ -12,6 +12,6 @@ publish = false [dependencies] bytes = { version = "1", default-features = false } futures = { version = "0.3", default-features = false } -h3 = { git = "https://github.com/hyperium/h3" } # TODO: Update once hyperium h3 is in crates.io -s2n-quic = { path = "../s2n-quic", default-features = false } -s2n-quic-core = { path = "../s2n-quic-core", default-features = false } +h3 = "0.0.1" +s2n-quic = { path = "../s2n-quic" } +s2n-quic-core = { path = "../s2n-quic-core" } diff --git a/quic/s2n-quic-h3/README.md b/quic/s2n-quic-h3/README.md index f73cfcd4da..aed94754ce 100644 --- a/quic/s2n-quic-h3/README.md +++ b/quic/s2n-quic-h3/README.md @@ -1,6 +1,6 @@ # s2n-quic-h3 -This is an internal crate used by [s2n-quic](https://github.com/aws/s2n-quic). The API is not currently stable and should not be used directly. +This is an internal crate used by [s2n-quic](https://github.com/aws/s2n-quic) written as a proof of concept for implementing HTTP3 on top of s2n-quic. The API is not currently stable and should not be used directly. ## License From 6ee2087d12c66baecb33d8f16c0dda67ddabdb2b Mon Sep 17 00:00:00 2001 From: James Mayclin Date: Wed, 22 Mar 2023 01:19:40 +0000 Subject: [PATCH 3/4] add ci check for default build --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba3f51af0c..e408505da4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ env: # Pin the nightly toolchain to prevent breakage. # This should be occasionally updated. RUST_NIGHTLY_TOOLCHAIN: nightly-2023-02-20 + MSRV: 1.63 CDN: https://dnglbrstg7yg.cloudfront.net # enable unstable features for testing S2N_UNSTABLE_CRYPTO_OPT_TX: 100 @@ -28,6 +29,7 @@ jobs: rust-versions: ${{ steps.definitions.outputs.versions }} msrv: ${{ steps.definitions.outputs.msrv }} examples: ${{ steps.definitions.outputs.examples }} + crates: ${{ steps.definitions.outputs.crates }} steps: - uses: actions/checkout@v3 # examples is populated by @@ -50,6 +52,9 @@ jobs: export EXAMPLES=$(find examples/ -maxdepth 1 -mindepth 1 -type d | jq -R | jq -sc) echo "examples=$EXAMPLES" echo "examples=$EXAMPLES" >> $GITHUB_OUTPUT + export CRATES=$(find find quic common -name *Cargo.toml | jq -R | jq -sc) + echo "crates=$CRATES" + echo "crates=$CRATES" >> $GITHUB_OUTPUT rustfmt: runs-on: ubuntu-latest @@ -357,6 +362,35 @@ jobs: status: "success" url: "${{ steps.s3.outputs.URL }}" + # This CI step will directly build each crate in common/ and quic/ which is + # useful because it sidesteps the feature resolution that normally occurs in a + # workspace build. We make sure that the crates build with default features, + # otherwise release to crates.io will be blocked + crates: + needs: env + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + crate: ${{ fromJson(needs.env.outputs.crates) }} + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - uses: actions-rs/toolchain@v1.0.7 + id: toolchain + with: + toolchain: ${{ env.MSRV }} + profile: minimal + override: true + + - name: build + uses: actions-rs/cargo@v1.0.3 + with: + command: build + args: --manifest-path ${{ matrix.crate }} + examples: needs: env runs-on: ubuntu-latest From f37006157c688a4f28303f41d7bb007307fad9ce Mon Sep 17 00:00:00 2001 From: James Mayclin Date: Wed, 22 Mar 2023 16:57:28 +0000 Subject: [PATCH 4/4] use msrv populated in env workflow --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e408505da4..0825ba0ea1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,6 @@ env: # Pin the nightly toolchain to prevent breakage. # This should be occasionally updated. RUST_NIGHTLY_TOOLCHAIN: nightly-2023-02-20 - MSRV: 1.63 CDN: https://dnglbrstg7yg.cloudfront.net # enable unstable features for testing S2N_UNSTABLE_CRYPTO_OPT_TX: 100 @@ -381,7 +380,7 @@ jobs: - uses: actions-rs/toolchain@v1.0.7 id: toolchain with: - toolchain: ${{ env.MSRV }} + toolchain: ${{ needs.env.outputs.msrv }} profile: minimal override: true