From d260446de55ab2f3721b55be7454055e36f8c328 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 11:46:22 +0100 Subject: [PATCH 01/40] Replace AtomicU64 with AtomicUsize to prevent compilation issues on 32 bits platforms. --- rust-runtime/aws-smithy-client/src/never.rs | 6 +++--- .../examples/pokemon-service/src/lib.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rust-runtime/aws-smithy-client/src/never.rs b/rust-runtime/aws-smithy-client/src/never.rs index 57d3f288a0..7989800d6b 100644 --- a/rust-runtime/aws-smithy-client/src/never.rs +++ b/rust-runtime/aws-smithy-client/src/never.rs @@ -10,7 +10,7 @@ use http::Uri; use aws_smithy_async::future::never::Never; use std::marker::PhantomData; -use std::sync::atomic::{AtomicU64, Ordering}; +use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Arc; use std::task::{Context, Poll}; @@ -27,7 +27,7 @@ use tower::BoxError; #[derive(Debug)] pub struct NeverService { _resp: PhantomData<(Req, Resp, Err)>, - invocations: Arc, + invocations: Arc, } impl Clone for NeverService { @@ -55,7 +55,7 @@ impl NeverService { } /// Returns the number of invocations made to this service - pub fn num_calls(&self) -> u64 { + pub fn num_calls(&self) -> usize { self.invocations.load(Ordering::SeqCst) } } diff --git a/rust-runtime/aws-smithy-http-server/examples/pokemon-service/src/lib.rs b/rust-runtime/aws-smithy-http-server/examples/pokemon-service/src/lib.rs index 93213f73bf..b309d49cd8 100644 --- a/rust-runtime/aws-smithy-http-server/examples/pokemon-service/src/lib.rs +++ b/rust-runtime/aws-smithy-http-server/examples/pokemon-service/src/lib.rs @@ -10,7 +10,7 @@ use std::{ collections::HashMap, convert::TryInto, - sync::{atomic::AtomicU64, Arc}, + sync::{atomic::AtomicUsize, Arc}, }; use async_stream::stream; @@ -108,7 +108,7 @@ struct PokemonTranslations { #[derive(Debug)] pub struct State { pokemons_translations: HashMap, - call_count: AtomicU64, + call_count: AtomicUsize, } impl Default for State { From 2ca4dc546b67985bd99510c4b11b8d5e5530c9b7 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 11:47:17 +0100 Subject: [PATCH 02/40] Make sure that Rust tests compile on MacOS. --- rust-runtime/aws-smithy-http-server-python/src/socket.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rust-runtime/aws-smithy-http-server-python/src/socket.rs b/rust-runtime/aws-smithy-http-server-python/src/socket.rs index 5922c5920d..df0e151078 100644 --- a/rust-runtime/aws-smithy-http-server-python/src/socket.rs +++ b/rust-runtime/aws-smithy-http-server-python/src/socket.rs @@ -73,6 +73,14 @@ impl PySocket { } #[cfg(test)] +// `is_listener` on `Socket` is only available on certain platforms. +// In particular, this fails to compile on MacOS. +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "linux", +))] mod tests { use super::*; From 56b0562a9fb77e852d839aad21ee3d60857d3dd0 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 12:22:13 +0100 Subject: [PATCH 03/40] Add CHANGELOG next entry. --- CHANGELOG.next.toml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.next.toml b/CHANGELOG.next.toml index 18d9fa6ff1..60a2386ebf 100644 --- a/CHANGELOG.next.toml +++ b/CHANGELOG.next.toml @@ -11,6 +11,22 @@ # meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client | server | all"} # author = "rcoh" +[[smithy-rs]] +message = """ +Replace all usages of `AtomicU64` with `AtomicUsize` to support 32bit targets. +""" +references = ["smithy-rs#1811"] +meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "server"} +author = "LukeMathWalker" + +[[smithy-rs]] +message = """ +Replace all usages of `AtomicU64` with `AtomicUsize` to support 32bit targets. +""" +references = ["smithy-rs#1811"] +meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "client"} +author = "LukeMathWalker" + [[smithy-rs]] message = """ Mark `operation` and `operation_handler` modules as private in the generated server crate. From b17139813497a83f503852eb1f1b3d247d617943 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 12:43:32 +0100 Subject: [PATCH 04/40] Add a new CI job to check that smithy-rs compiles on 32bit Linux-based targets. --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4ab973ea7..be649e95fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -143,6 +143,41 @@ jobs: popd &>/dev/null done + # We make sure that Smithy-rs can be compiled on platforms that are not natively supported by GitHub actions. + # We do not run tests on those platforms (yet) because it'd require a more complicated setup involving architecture + # emulation via QEMU, likely to cause a significant degradation on CI completion time. + test-exotic-platform-support: + name: Exotic platform support + runs-on: ubuntu-latest + strategy: + matrix: + target: + - i686-unknown-linux-gnu + - powerpc-unknown-linux-gnu, + steps: + - name: Checkout + uses: actions/checkout@v1 + with: + path: smithy-rs + # Pinned to the commit hash of v1.3.0 + - uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641 + with: + sharedKey: ${{ runner.os }}-${{ env.rust_version }}-${{ github.job }}-${{ matrix.target }} + target-dir: ./target + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.rust_version }} + components: ${{ env.rust_toolchain_components }} + profile: minimal + override: true + target: ${{ matrix.target }} + - name: Build target + uses: actions-rs/cargo@v1 + with: + use-cross: true + command: build + args: --target ${{ matrix.target }} + # This job is split out from the rest since it is not required to pass for merge check-sdk-examples: name: Check SDK Examples @@ -166,6 +201,7 @@ jobs: - test-codegen - test-sdk - test-rust-windows + - test-exotic-platform-support # Run this job even if its dependency jobs fail if: always() runs-on: ubuntu-latest From 28cfd529710d738d5006d885412641637adb830f Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 12:50:00 +0100 Subject: [PATCH 05/40] No trailing commas pretty please. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be649e95fa..5396dc804a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,7 +153,7 @@ jobs: matrix: target: - i686-unknown-linux-gnu - - powerpc-unknown-linux-gnu, + - powerpc-unknown-linux-gnu steps: - name: Checkout uses: actions/checkout@v1 From c39f51f29d68517a57b568a2311bd27124dad1b7 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 12:58:37 +0100 Subject: [PATCH 06/40] Point cross at the manifest explicitly. --- .github/workflows/ci.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5396dc804a..987ed93743 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -157,8 +157,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v1 - with: - path: smithy-rs # Pinned to the commit hash of v1.3.0 - uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641 with: @@ -171,12 +169,18 @@ jobs: profile: minimal override: true target: ${{ matrix.target }} - - name: Build target + - name: Build rust-runtime crates + uses: actions-rs/cargo@v1 + with: + use-cross: true + command: build + args: --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" + - name: Build AWS rust-runtime crates uses: actions-rs/cargo@v1 with: use-cross: true command: build - args: --target ${{ matrix.target }} + args: --target ${{ matrix.target }} --manifest-path "aws/rust-runtime/Cargo.toml" # This job is split out from the rest since it is not required to pass for merge check-sdk-examples: From d37474943a00efa4444ea43aa59485f6d780d2e4 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 13:08:16 +0100 Subject: [PATCH 07/40] Skip crates with a Python dependency. Exercise all features. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 987ed93743..24e811addb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -174,13 +174,13 @@ jobs: with: use-cross: true command: build - args: --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" + args: --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" --exclude aws-smithy-http-server-python --workspace --all-features - name: Build AWS rust-runtime crates uses: actions-rs/cargo@v1 with: use-cross: true command: build - args: --target ${{ matrix.target }} --manifest-path "aws/rust-runtime/Cargo.toml" + args: --target ${{ matrix.target }} --manifest-path "aws/rust-runtime/Cargo.toml" --exclude aws-smithy-http-server-python --workspace --all-features # This job is split out from the rest since it is not required to pass for merge check-sdk-examples: From 0a35e575c487a57c5ad1fbc38a693059772ae5e4 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 13:57:01 +0100 Subject: [PATCH 08/40] Install required dependencies. --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24e811addb..21ac900770 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -169,8 +169,15 @@ jobs: profile: minimal override: true target: ${{ matrix.target }} + - name: Install dependencies + shell: bash + run: | + sudo dpkg --add-architecture i386 && sudo apt-get update && sudo apt-get install libssl-dev:i386 - name: Build rust-runtime crates uses: actions-rs/cargo@v1 + env: + OPENSSL_LIB_DIR: /usr/lib/i386-linux-gnu/ + OPENSSL_INCLUDE_DIR: /usr/include/openssl/ with: use-cross: true command: build From 04da5812353cf8b0d652bea11ac37de3f1c4adb9 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 14:01:44 +0100 Subject: [PATCH 09/40] Do not fail fast, we want to see the result on all platforms. --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21ac900770..023f4c616e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -150,6 +150,7 @@ jobs: name: Exotic platform support runs-on: ubuntu-latest strategy: + fail-fast: false matrix: target: - i686-unknown-linux-gnu From 889cf30f0625fe483d3eeb382ea3f4889fc5ab0d Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 14:14:09 +0100 Subject: [PATCH 10/40] Set paths for both commands. --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 023f4c616e..ea8837e3f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -185,6 +185,9 @@ jobs: args: --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" --exclude aws-smithy-http-server-python --workspace --all-features - name: Build AWS rust-runtime crates uses: actions-rs/cargo@v1 + env: + OPENSSL_LIB_DIR: /usr/lib/i386-linux-gnu/ + OPENSSL_INCLUDE_DIR: /usr/include/openssl/ with: use-cross: true command: build From 68a8ff7a4135a3b39f8209f8b25adad1a08f08cb Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 14:30:09 +0100 Subject: [PATCH 11/40] Openssl must be installed inside the cross Docker container, not on the host machine. --- .github/workflows/ci.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea8837e3f4..293d0c1105 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -170,15 +170,19 @@ jobs: profile: minimal override: true target: ${{ matrix.target }} - - name: Install dependencies + - name: Configure cross shell: bash run: | - sudo dpkg --add-architecture i386 && sudo apt-get update && sudo apt-get install libssl-dev:i386 + cat > Cross.toml << EOF + [target.i686-unknown-linux-gnu] + pre-build = ["dpkg --add-architecture i386 && apt-get update && apt-get install --assume-yes libssl-dev:i386"] + [target.powerpc-unknown-linux-gnu] + pre-build = ["dpkg --add-architecture i386 && apt-get update && apt-get install --assume-yes libssl-dev:i386"] + EOF - name: Build rust-runtime crates uses: actions-rs/cargo@v1 env: - OPENSSL_LIB_DIR: /usr/lib/i386-linux-gnu/ - OPENSSL_INCLUDE_DIR: /usr/include/openssl/ + CROSS_CONFIG: Cross.toml with: use-cross: true command: build @@ -186,8 +190,7 @@ jobs: - name: Build AWS rust-runtime crates uses: actions-rs/cargo@v1 env: - OPENSSL_LIB_DIR: /usr/lib/i386-linux-gnu/ - OPENSSL_INCLUDE_DIR: /usr/include/openssl/ + CROSS_CONFIG: Cross.toml with: use-cross: true command: build From 6489be449b03d9be99c89c9a7bc3c2fceaa62cfe Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 14:39:16 +0100 Subject: [PATCH 12/40] Fix connector setup if `rustls` feature is not enabled. --- rust-runtime/aws-smithy-client/src/builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-runtime/aws-smithy-client/src/builder.rs b/rust-runtime/aws-smithy-client/src/builder.rs index 017ae04e7b..4a1b62fb85 100644 --- a/rust-runtime/aws-smithy-client/src/builder.rs +++ b/rust-runtime/aws-smithy-client/src/builder.rs @@ -135,7 +135,7 @@ impl Builder<(), M, R> { let with_https = |b: Builder<_, M, R>| b.rustls_connector(connector_settings); // If we are compiling this function & rustls is not enabled, then native-tls MUST be enabled #[cfg(not(feature = "rustls"))] - let with_https = |b: Builder<_, M, R>| b.native_tls_connector(); + let with_https = |b: Builder<_, M, R>| b.native_tls_connector(connector_settings); with_https(self) } From faa7c0c2a8235ceb342b371adab83d6e143abd6c Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 14:48:10 +0100 Subject: [PATCH 13/40] Restrict feature set on powerpc. --- .github/workflows/ci.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 293d0c1105..b585c68c3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,9 +152,13 @@ jobs: strategy: fail-fast: false matrix: - target: - - i686-unknown-linux-gnu - - powerpc-unknown-linux-gnu + include: + - target: i686-unknown-linux-gnu + features: --all-features + # We only test `native-tls` here because `rustls` depends on `ring` which in turn does not support powerpc + # as a target platform (see https://github.com/briansmith/ring/issues/389) + - target: powerpc-unknown-linux-gnu + features: --features native-tls steps: - name: Checkout uses: actions/checkout@v1 @@ -186,7 +190,7 @@ jobs: with: use-cross: true command: build - args: --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" --exclude aws-smithy-http-server-python --workspace --all-features + args: --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" --exclude aws-smithy-http-server-python --workspace ${{ matrix.features }} - name: Build AWS rust-runtime crates uses: actions-rs/cargo@v1 env: @@ -194,7 +198,7 @@ jobs: with: use-cross: true command: build - args: --target ${{ matrix.target }} --manifest-path "aws/rust-runtime/Cargo.toml" --exclude aws-smithy-http-server-python --workspace --all-features + args: --target ${{ matrix.target }} --manifest-path "aws/rust-runtime/Cargo.toml" --exclude aws-smithy-http-server-python --workspace ${{ matrix.features }} # This job is split out from the rest since it is not required to pass for merge check-sdk-examples: From 656566b63c267bf4f487c3de354483b0d54fbbdd Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 14:57:37 +0100 Subject: [PATCH 14/40] Pass openssl env variables to the cross Docker container --- .github/workflows/ci.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b585c68c3d..2de62411c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -155,10 +155,13 @@ jobs: include: - target: i686-unknown-linux-gnu features: --all-features + aws_excludes: '' # We only test `native-tls` here because `rustls` depends on `ring` which in turn does not support powerpc # as a target platform (see https://github.com/briansmith/ring/issues/389) + # We also exclude all first-party crates that have a non-optional dependency on `ring`. - target: powerpc-unknown-linux-gnu features: --features native-tls + aws_excludes: --exclude aws-inlineable --exclude aws-sigv4 --exclude aws-sig-auth steps: - name: Checkout uses: actions/checkout@v1 @@ -182,11 +185,18 @@ jobs: pre-build = ["dpkg --add-architecture i386 && apt-get update && apt-get install --assume-yes libssl-dev:i386"] [target.powerpc-unknown-linux-gnu] pre-build = ["dpkg --add-architecture i386 && apt-get update && apt-get install --assume-yes libssl-dev:i386"] + [build.env] + passthrough = [ + "OPENSSL_LIB_DIR", + "OPENSSL_INCLUDE_DIR", + ] EOF - name: Build rust-runtime crates uses: actions-rs/cargo@v1 env: CROSS_CONFIG: Cross.toml + OPENSSL_LIB_DIR: /usr/lib/i386-linux-gnu/ + OPENSSL_INCLUDE_DIR: /usr/include/openssl/ with: use-cross: true command: build @@ -195,10 +205,12 @@ jobs: uses: actions-rs/cargo@v1 env: CROSS_CONFIG: Cross.toml + OPENSSL_LIB_DIR: /usr/lib/i386-linux-gnu/ + OPENSSL_INCLUDE_DIR: /usr/include/openssl/ with: use-cross: true command: build - args: --target ${{ matrix.target }} --manifest-path "aws/rust-runtime/Cargo.toml" --exclude aws-smithy-http-server-python --workspace ${{ matrix.features }} + args: --target ${{ matrix.target }} --manifest-path "aws/rust-runtime/Cargo.toml" ${{ matrix.aws_excludes }} --workspace ${{ matrix.features }} # This job is split out from the rest since it is not required to pass for merge check-sdk-examples: From 763c1847c7837318dd5a18831db08e115e4fd132 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 15:21:17 +0100 Subject: [PATCH 15/40] Split in two commands. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2de62411c9..22ad9036cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -182,9 +182,9 @@ jobs: run: | cat > Cross.toml << EOF [target.i686-unknown-linux-gnu] - pre-build = ["dpkg --add-architecture i386 && apt-get update && apt-get install --assume-yes libssl-dev:i386"] + pre-build = ["dpkg --add-architecture i386", "apt-get update && apt-get install --assume-yes libssl-dev:i386"] [target.powerpc-unknown-linux-gnu] - pre-build = ["dpkg --add-architecture i386 && apt-get update && apt-get install --assume-yes libssl-dev:i386"] + pre-build = ["dpkg --add-architecture i386", "apt-get update && apt-get install --assume-yes libssl-dev:i386"] [build.env] passthrough = [ "OPENSSL_LIB_DIR", From 2aeafc976da397ad9157872c0f5ad6a99de6b437 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 15:31:51 +0100 Subject: [PATCH 16/40] Enable debug level logs. --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22ad9036cd..4c90deb36f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -195,6 +195,7 @@ jobs: uses: actions-rs/cargo@v1 env: CROSS_CONFIG: Cross.toml + CROSS_DEBUG: true OPENSSL_LIB_DIR: /usr/lib/i386-linux-gnu/ OPENSSL_INCLUDE_DIR: /usr/include/openssl/ with: From b79c5bcdbeaeeb80c0e14291d649c86ee8a814b0 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 15:42:25 +0100 Subject: [PATCH 17/40] Remove openssl feature (temporarily). --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c90deb36f..283ec90d03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -160,7 +160,7 @@ jobs: # as a target platform (see https://github.com/briansmith/ring/issues/389) # We also exclude all first-party crates that have a non-optional dependency on `ring`. - target: powerpc-unknown-linux-gnu - features: --features native-tls + features: '' aws_excludes: --exclude aws-inlineable --exclude aws-sigv4 --exclude aws-sig-auth steps: - name: Checkout @@ -181,6 +181,8 @@ jobs: shell: bash run: | cat > Cross.toml << EOF + [target.x86-unknown-linux-gnu] + pre-build = ["dpkg --add-architecture i386", "apt-get update && apt-get install --assume-yes libssl-dev:i386"] [target.i686-unknown-linux-gnu] pre-build = ["dpkg --add-architecture i386", "apt-get update && apt-get install --assume-yes libssl-dev:i386"] [target.powerpc-unknown-linux-gnu] From f121f3f363b539bac28507059d9c692498077aa4 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 15:44:31 +0100 Subject: [PATCH 18/40] Raise verbosity. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 283ec90d03..9499f38ee8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -203,7 +203,7 @@ jobs: with: use-cross: true command: build - args: --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" --exclude aws-smithy-http-server-python --workspace ${{ matrix.features }} + args: -vv --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" --exclude aws-smithy-http-server-python --workspace ${{ matrix.features }} - name: Build AWS rust-runtime crates uses: actions-rs/cargo@v1 env: From 19e5d2864f253d4b469118127a0dc90db88de484 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 15:48:36 +0100 Subject: [PATCH 19/40] Trigger CI From 27c9b0d6ebc11b198ece9193e9a95245f6d98083 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 16:00:08 +0100 Subject: [PATCH 20/40] `native-tls`, here we go again. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9499f38ee8..e603587878 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -160,7 +160,7 @@ jobs: # as a target platform (see https://github.com/briansmith/ring/issues/389) # We also exclude all first-party crates that have a non-optional dependency on `ring`. - target: powerpc-unknown-linux-gnu - features: '' + features: --features native-tls aws_excludes: --exclude aws-inlineable --exclude aws-sigv4 --exclude aws-sig-auth steps: - name: Checkout From 8c10c19722c4a8c44f2fff627c0f85f48b43bf03 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 16:09:38 +0100 Subject: [PATCH 21/40] Clean up. --- .github/workflows/ci.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e603587878..e43066b250 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -181,11 +181,7 @@ jobs: shell: bash run: | cat > Cross.toml << EOF - [target.x86-unknown-linux-gnu] - pre-build = ["dpkg --add-architecture i386", "apt-get update && apt-get install --assume-yes libssl-dev:i386"] - [target.i686-unknown-linux-gnu] - pre-build = ["dpkg --add-architecture i386", "apt-get update && apt-get install --assume-yes libssl-dev:i386"] - [target.powerpc-unknown-linux-gnu] + [build] pre-build = ["dpkg --add-architecture i386", "apt-get update && apt-get install --assume-yes libssl-dev:i386"] [build.env] passthrough = [ @@ -197,13 +193,12 @@ jobs: uses: actions-rs/cargo@v1 env: CROSS_CONFIG: Cross.toml - CROSS_DEBUG: true OPENSSL_LIB_DIR: /usr/lib/i386-linux-gnu/ OPENSSL_INCLUDE_DIR: /usr/include/openssl/ with: use-cross: true command: build - args: -vv --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" --exclude aws-smithy-http-server-python --workspace ${{ matrix.features }} + args: --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" --exclude aws-smithy-http-server-python --workspace ${{ matrix.features }} - name: Build AWS rust-runtime crates uses: actions-rs/cargo@v1 env: From f904443cce6d2c21b47ec987fb4b335395795db1 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 16:13:50 +0100 Subject: [PATCH 22/40] Trigger CI From 9d116a183cc35255a6f849f149fb0c992204f77e Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 16:17:11 +0100 Subject: [PATCH 23/40] Trigger CI From 5755c38c20b01d61c44d0228835f3d6ac91388d2 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 16:31:48 +0100 Subject: [PATCH 24/40] Add pkg-config. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e43066b250..2fa100ceab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -182,7 +182,7 @@ jobs: run: | cat > Cross.toml << EOF [build] - pre-build = ["dpkg --add-architecture i386", "apt-get update && apt-get install --assume-yes libssl-dev:i386"] + pre-build = ["dpkg --add-architecture i386", "apt-get update && apt-get install --assume-yes pkg-config:i386 libssl-dev:i386"] [build.env] passthrough = [ "OPENSSL_LIB_DIR", From 7169ba7bb551a2cf16d3fea92c7fbf7b3a4427c4 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 16:38:56 +0100 Subject: [PATCH 25/40] Change include path to include arch --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2fa100ceab..e5cc2e3ac2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -194,7 +194,7 @@ jobs: env: CROSS_CONFIG: Cross.toml OPENSSL_LIB_DIR: /usr/lib/i386-linux-gnu/ - OPENSSL_INCLUDE_DIR: /usr/include/openssl/ + OPENSSL_INCLUDE_DIR: /usr/include/i386-linux-gnu/openssl/ with: use-cross: true command: build @@ -204,7 +204,7 @@ jobs: env: CROSS_CONFIG: Cross.toml OPENSSL_LIB_DIR: /usr/lib/i386-linux-gnu/ - OPENSSL_INCLUDE_DIR: /usr/include/openssl/ + OPENSSL_INCLUDE_DIR: /usr/include/i386-linux-gnu/openssl/ with: use-cross: true command: build From a56e15118f8ce8cac1b1d6faf84a82da7f6328ba Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 16:53:35 +0100 Subject: [PATCH 26/40] Trigger CI From b151d4dd340a613808d894077c7436c100ee8e3d Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 16:56:22 +0100 Subject: [PATCH 27/40] Allow workflow_dispatch on ci-pr to enable triggering this CI workflow from the GitHub web interface. --- .github/workflows/ci-pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 372690b67c..b375eaa345 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -5,6 +5,7 @@ name: CI on: + workflow_dispatch: pull_request: # Allow one instance of this workflow per pull request, and cancel older runs when new changes are pushed From c1321f60235664c3b6668ca6cdb0886c9b6672e9 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 16:58:31 +0100 Subject: [PATCH 28/40] Trigger CI? Why are you doing this to me GitHub? From d9b37b32282f4f7f46a6f911e58c73cea119c838 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 5 Oct 2022 17:37:28 +0100 Subject: [PATCH 29/40] Trigger CI? Are you alive GitHub? From 7f697ccdd77ae2bdcf8ef93137e0ec13fa3f4932 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Thu, 6 Oct 2022 09:55:42 +0100 Subject: [PATCH 30/40] Fix env variables for openssl --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5cc2e3ac2..0dd4c2becd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -193,8 +193,8 @@ jobs: uses: actions-rs/cargo@v1 env: CROSS_CONFIG: Cross.toml - OPENSSL_LIB_DIR: /usr/lib/i386-linux-gnu/ - OPENSSL_INCLUDE_DIR: /usr/include/i386-linux-gnu/openssl/ + OPENSSL_LIB_DIR: /usr/lib/i386-linux-gnu + OPENSSL_INCLUDE_DIR: /usr/include/i386-linux-gnu with: use-cross: true command: build @@ -203,8 +203,8 @@ jobs: uses: actions-rs/cargo@v1 env: CROSS_CONFIG: Cross.toml - OPENSSL_LIB_DIR: /usr/lib/i386-linux-gnu/ - OPENSSL_INCLUDE_DIR: /usr/include/i386-linux-gnu/openssl/ + OPENSSL_LIB_DIR: /usr/lib/i386-linux-gnu + OPENSSL_INCLUDE_DIR: /usr/include/i386-linux-gnu with: use-cross: true command: build From 1d1685b037f2a02cbb1684dd57bbbd64f3910e38 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Thu, 6 Oct 2022 10:06:47 +0100 Subject: [PATCH 31/40] Use features only for rust-runtime crates. --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0dd4c2becd..6f82ca63ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -154,13 +154,13 @@ jobs: matrix: include: - target: i686-unknown-linux-gnu - features: --all-features + non_aws_features: --all-features aws_excludes: '' # We only test `native-tls` here because `rustls` depends on `ring` which in turn does not support powerpc # as a target platform (see https://github.com/briansmith/ring/issues/389) # We also exclude all first-party crates that have a non-optional dependency on `ring`. - target: powerpc-unknown-linux-gnu - features: --features native-tls + non_aws_features: --features native-tls aws_excludes: --exclude aws-inlineable --exclude aws-sigv4 --exclude aws-sig-auth steps: - name: Checkout @@ -198,7 +198,7 @@ jobs: with: use-cross: true command: build - args: --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" --exclude aws-smithy-http-server-python --workspace ${{ matrix.features }} + args: --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" --exclude aws-smithy-http-server-python --workspace ${{ matrix.non_aws_features }} - name: Build AWS rust-runtime crates uses: actions-rs/cargo@v1 env: @@ -208,7 +208,7 @@ jobs: with: use-cross: true command: build - args: --target ${{ matrix.target }} --manifest-path "aws/rust-runtime/Cargo.toml" ${{ matrix.aws_excludes }} --workspace ${{ matrix.features }} + args: --target ${{ matrix.target }} --manifest-path "aws/rust-runtime/Cargo.toml" ${{ matrix.aws_excludes }} --workspace # This job is split out from the rest since it is not required to pass for merge check-sdk-examples: From 58d35cc7d0f540de8517de99f1a4801bfcf22d8f Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Thu, 6 Oct 2022 10:07:49 +0100 Subject: [PATCH 32/40] Check all feature combinations for aws-smithy-client --- rust-runtime/aws-smithy-client/additional-ci | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rust-runtime/aws-smithy-client/additional-ci b/rust-runtime/aws-smithy-client/additional-ci index c1fd7ce406..b7b653c903 100755 --- a/rust-runtime/aws-smithy-client/additional-ci +++ b/rust-runtime/aws-smithy-client/additional-ci @@ -10,3 +10,6 @@ set -e echo "### Checking for duplicate dependency versions in the normal dependency graph with all features enabled" cargo tree -d --edges normal --all-features + +"### Testing every combination of features (excluding --all-features)" +cargo hack test --feature-powerset --exclude-all-features From cc9d2c8bea2caf02a729e14527be507870223b66 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Thu, 6 Oct 2022 10:16:09 +0100 Subject: [PATCH 33/40] Dry-up env variables. --- .github/workflows/ci.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f82ca63ed..92f145542f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -162,6 +162,10 @@ jobs: - target: powerpc-unknown-linux-gnu non_aws_features: --features native-tls aws_excludes: --exclude aws-inlineable --exclude aws-sigv4 --exclude aws-sig-auth + env: + CROSS_CONFIG: Cross.toml + OPENSSL_LIB_DIR: /usr/lib/i386-linux-gnu + OPENSSL_INCLUDE_DIR: /usr/include/i386-linux-gnu steps: - name: Checkout uses: actions/checkout@v1 @@ -191,20 +195,12 @@ jobs: EOF - name: Build rust-runtime crates uses: actions-rs/cargo@v1 - env: - CROSS_CONFIG: Cross.toml - OPENSSL_LIB_DIR: /usr/lib/i386-linux-gnu - OPENSSL_INCLUDE_DIR: /usr/include/i386-linux-gnu with: use-cross: true command: build args: --target ${{ matrix.target }} --manifest-path "rust-runtime/Cargo.toml" --exclude aws-smithy-http-server-python --workspace ${{ matrix.non_aws_features }} - name: Build AWS rust-runtime crates uses: actions-rs/cargo@v1 - env: - CROSS_CONFIG: Cross.toml - OPENSSL_LIB_DIR: /usr/lib/i386-linux-gnu - OPENSSL_INCLUDE_DIR: /usr/include/i386-linux-gnu with: use-cross: true command: build From ef7002ad7ab1af37e10ab55d3672fd1f9adab50b Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Thu, 6 Oct 2022 10:27:38 +0100 Subject: [PATCH 34/40] A rogue `echo` was missing --- rust-runtime/aws-smithy-client/additional-ci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-runtime/aws-smithy-client/additional-ci b/rust-runtime/aws-smithy-client/additional-ci index b7b653c903..fde542e9fc 100755 --- a/rust-runtime/aws-smithy-client/additional-ci +++ b/rust-runtime/aws-smithy-client/additional-ci @@ -11,5 +11,5 @@ set -e echo "### Checking for duplicate dependency versions in the normal dependency graph with all features enabled" cargo tree -d --edges normal --all-features -"### Testing every combination of features (excluding --all-features)" +echo "### Testing every combination of features (excluding --all-features)" cargo hack test --feature-powerset --exclude-all-features From 01e98a0b6b8147a58f029549315781c858f4245a Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Thu, 6 Oct 2022 11:37:35 +0100 Subject: [PATCH 35/40] Feature-gate doc tests based on the features they require. --- .../aws-smithy-client/src/hyper_ext.rs | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/rust-runtime/aws-smithy-client/src/hyper_ext.rs b/rust-runtime/aws-smithy-client/src/hyper_ext.rs index 18acf75526..e1fe308066 100644 --- a/rust-runtime/aws-smithy-client/src/hyper_ext.rs +++ b/rust-runtime/aws-smithy-client/src/hyper_ext.rs @@ -17,7 +17,20 @@ //! with `rustls` will be constructed during client creation. However, if you are creating a Smithy //! [`Client`](crate::Client), directly, use the `dyn_https_https()` method to match that default behavior: //! -//! ```no_run +#![cfg_attr( + not(all( + any(feature = "rustls", feature = "native-tls"), + feature = "client-hyper" + )), + doc = "```no_run,ignore" +)] +#![cfg_attr( + all( + any(feature = "rustls", feature = "native-tls"), + feature = "client-hyper" + ), + doc = "```no_run" +)] //! use aws_smithy_client::Client; //! //! let client = Client::builder() @@ -34,7 +47,21 @@ //! A use case for where you may want to use the [`Adapter`] is when settings Hyper client settings //! that aren't otherwise exposed by the `Client` builder interface. //! -//! ```no_run +#![cfg_attr( + not(all( + any(feature = "rustls", feature = "native-tls"), + feature = "client-hyper" + )), + doc = "```no_run,ignore" +)] +#![cfg_attr( + all( + any(feature = "rustls", feature = "native-tls"), + feature = "client-hyper" + ), + doc = "```no_run" +)] +//! ``` //! use std::time::Duration; //! use aws_smithy_client::{Client, conns, hyper_ext}; //! use aws_smithy_client::erase::DynConnector; @@ -186,7 +213,8 @@ fn find_source<'a, E: Error + 'static>(err: &'a (dyn Error + 'static)) -> Option /// Construct a HyperAdapter with the default HTTP implementation (rustls). This can be useful when you want to share a Hyper connector /// between multiple Smithy clients. /// -/// ```no_run +#[cfg_attr(not(feature = "client-hyper"), doc = "/// ```no_run,ignore")] +#[cfg_attr(feature = "client-hyper", doc = "/// ```no_run")] /// use tower::layer::util::Identity; /// use aws_smithy_client::{conns, hyper_ext}; /// use aws_smithy_client::erase::DynConnector; From 58a28224a1d2cb6e1c9bfd56560fdd237dfcf48f Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Thu, 6 Oct 2022 11:40:28 +0100 Subject: [PATCH 36/40] Put .github folder under shared ownership. --- CODEOWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/CODEOWNERS b/CODEOWNERS index 19506644ac..20265881e6 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -7,6 +7,7 @@ /rust-runtime/aws-smithy-http-server/ @awslabs/smithy-rs-server # Shared ownership +/.github/ @awslabs/rust-sdk-owners @awslabs/smithy-rs-server /CHANGELOG.md @awslabs/rust-sdk-owners @awslabs/smithy-rs-server /CHANGELOG.next.toml @awslabs/rust-sdk-owners @awslabs/smithy-rs-server /README.md @awslabs/rust-sdk-owners @awslabs/smithy-rs-server From a3bb7c717490c33bf32507b4cb155129f837afc8 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Thu, 6 Oct 2022 12:35:42 +0100 Subject: [PATCH 37/40] Fix docs. --- rust-runtime/aws-smithy-client/src/hyper_ext.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rust-runtime/aws-smithy-client/src/hyper_ext.rs b/rust-runtime/aws-smithy-client/src/hyper_ext.rs index e1fe308066..5c2866309e 100644 --- a/rust-runtime/aws-smithy-client/src/hyper_ext.rs +++ b/rust-runtime/aws-smithy-client/src/hyper_ext.rs @@ -61,7 +61,6 @@ ), doc = "```no_run" )] -//! ``` //! use std::time::Duration; //! use aws_smithy_client::{Client, conns, hyper_ext}; //! use aws_smithy_client::erase::DynConnector; @@ -213,8 +212,8 @@ fn find_source<'a, E: Error + 'static>(err: &'a (dyn Error + 'static)) -> Option /// Construct a HyperAdapter with the default HTTP implementation (rustls). This can be useful when you want to share a Hyper connector /// between multiple Smithy clients. /// -#[cfg_attr(not(feature = "client-hyper"), doc = "/// ```no_run,ignore")] -#[cfg_attr(feature = "client-hyper", doc = "/// ```no_run")] +#[cfg_attr(not(feature = "client-hyper"), doc = "```no_run,ignore")] +#[cfg_attr(feature = "client-hyper", doc = "```no_run")] /// use tower::layer::util::Identity; /// use aws_smithy_client::{conns, hyper_ext}; /// use aws_smithy_client::erase::DynConnector; From 6e1a354eb26f5615ec2939d9caa7bc956e5fb05b Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Thu, 6 Oct 2022 13:41:30 +0100 Subject: [PATCH 38/40] Fix feature selection for doctest. --- .../aws-smithy-client/src/hyper_ext.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/rust-runtime/aws-smithy-client/src/hyper_ext.rs b/rust-runtime/aws-smithy-client/src/hyper_ext.rs index 5c2866309e..966b283912 100644 --- a/rust-runtime/aws-smithy-client/src/hyper_ext.rs +++ b/rust-runtime/aws-smithy-client/src/hyper_ext.rs @@ -212,8 +212,20 @@ fn find_source<'a, E: Error + 'static>(err: &'a (dyn Error + 'static)) -> Option /// Construct a HyperAdapter with the default HTTP implementation (rustls). This can be useful when you want to share a Hyper connector /// between multiple Smithy clients. /// -#[cfg_attr(not(feature = "client-hyper"), doc = "```no_run,ignore")] -#[cfg_attr(feature = "client-hyper", doc = "```no_run")] +#[cfg_attr( + not(all( + any(feature = "rustls", feature = "native-tls"), + feature = "client-hyper" + )), + doc = "```no_run,ignore" +)] +#[cfg_attr( + all( + any(feature = "rustls", feature = "native-tls"), + feature = "client-hyper" + ), + doc = "```no_run" +)] /// use tower::layer::util::Identity; /// use aws_smithy_client::{conns, hyper_ext}; /// use aws_smithy_client::erase::DynConnector; @@ -455,7 +467,7 @@ mod timeout_middleware { fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let (timeout_future, kind, &mut duration) = match self.project() { MaybeTimeoutFutureProj::NoTimeout { future } => { - return future.poll(cx).map_err(|err| err.into()) + return future.poll(cx).map_err(|err| err.into()); } MaybeTimeoutFutureProj::Timeout { timeout, From 3796190dcf570ef0e2326657034a497e3f931e95 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Thu, 6 Oct 2022 14:12:06 +0100 Subject: [PATCH 39/40] We are using methods that are only available if rustls is enabled - adjust feature gates accordingly. --- .../aws-smithy-client/src/hyper_ext.rs | 26 +++---------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/rust-runtime/aws-smithy-client/src/hyper_ext.rs b/rust-runtime/aws-smithy-client/src/hyper_ext.rs index 966b283912..27caf43ad3 100644 --- a/rust-runtime/aws-smithy-client/src/hyper_ext.rs +++ b/rust-runtime/aws-smithy-client/src/hyper_ext.rs @@ -48,19 +48,10 @@ //! that aren't otherwise exposed by the `Client` builder interface. //! #![cfg_attr( - not(all( - any(feature = "rustls", feature = "native-tls"), - feature = "client-hyper" - )), + not(all(feature = "rustls", feature = "client-hyper")), doc = "```no_run,ignore" )] -#![cfg_attr( - all( - any(feature = "rustls", feature = "native-tls"), - feature = "client-hyper" - ), - doc = "```no_run" -)] +#![cfg_attr(all(feature = "rustls", feature = "client-hyper"), doc = "```no_run")] //! use std::time::Duration; //! use aws_smithy_client::{Client, conns, hyper_ext}; //! use aws_smithy_client::erase::DynConnector; @@ -213,19 +204,10 @@ fn find_source<'a, E: Error + 'static>(err: &'a (dyn Error + 'static)) -> Option /// between multiple Smithy clients. /// #[cfg_attr( - not(all( - any(feature = "rustls", feature = "native-tls"), - feature = "client-hyper" - )), + not(all(feature = "rustls", feature = "client-hyper")), doc = "```no_run,ignore" )] -#[cfg_attr( - all( - any(feature = "rustls", feature = "native-tls"), - feature = "client-hyper" - ), - doc = "```no_run" -)] +#[cfg_attr(all(feature = "rustls", feature = "client-hyper"), doc = "```no_run")] /// use tower::layer::util::Identity; /// use aws_smithy_client::{conns, hyper_ext}; /// use aws_smithy_client::erase::DynConnector; From 7881449d1335e8f35ef5a5e5f7050559ffaaedc2 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Mon, 10 Oct 2022 18:23:05 +0100 Subject: [PATCH 40/40] Remove workflow dispatch trigger. --- .github/workflows/ci-pr.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index b375eaa345..372690b67c 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -5,7 +5,6 @@ name: CI on: - workflow_dispatch: pull_request: # Allow one instance of this workflow per pull request, and cancel older runs when new changes are pushed