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

Add a new CI job to check that smithy-rs compiles on 32bit Linux-based targets #1812

Merged
merged 46 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
d260446
Replace AtomicU64 with AtomicUsize to prevent compilation issues on 3…
LukeMathWalker Oct 5, 2022
2ca4dc5
Make sure that Rust tests compile on MacOS.
LukeMathWalker Oct 5, 2022
56b0562
Add CHANGELOG next entry.
LukeMathWalker Oct 5, 2022
b171398
Add a new CI job to check that smithy-rs compiles on 32bit Linux-base…
LukeMathWalker Oct 5, 2022
28cfd52
No trailing commas pretty please.
LukeMathWalker Oct 5, 2022
c39f51f
Point cross at the manifest explicitly.
LukeMathWalker Oct 5, 2022
d374749
Skip crates with a Python dependency. Exercise all features.
LukeMathWalker Oct 5, 2022
0a35e57
Install required dependencies.
LukeMathWalker Oct 5, 2022
04da581
Do not fail fast, we want to see the result on all platforms.
LukeMathWalker Oct 5, 2022
889cf30
Set paths for both commands.
LukeMathWalker Oct 5, 2022
68a8ff7
Openssl must be installed inside the cross Docker container, not on t…
LukeMathWalker Oct 5, 2022
6489be4
Fix connector setup if `rustls` feature is not enabled.
LukeMathWalker Oct 5, 2022
faa7c0c
Restrict feature set on powerpc.
LukeMathWalker Oct 5, 2022
656566b
Pass openssl env variables to the cross Docker container
LukeMathWalker Oct 5, 2022
763c184
Split in two commands.
LukeMathWalker Oct 5, 2022
2aeafc9
Enable debug level logs.
LukeMathWalker Oct 5, 2022
b79c5bc
Remove openssl feature (temporarily).
LukeMathWalker Oct 5, 2022
f121f3f
Raise verbosity.
LukeMathWalker Oct 5, 2022
19e5d28
Trigger CI
LukeMathWalker Oct 5, 2022
27c9b0d
`native-tls`, here we go again.
LukeMathWalker Oct 5, 2022
8c10c19
Clean up.
LukeMathWalker Oct 5, 2022
c6e78b9
Merge branch 'main' into 32-bits
LukeMathWalker Oct 5, 2022
95c8b70
Merge branch '32-bits' into exotic-ci
LukeMathWalker Oct 5, 2022
f904443
Trigger CI
LukeMathWalker Oct 5, 2022
9d116a1
Trigger CI
LukeMathWalker Oct 5, 2022
5755c38
Add pkg-config.
LukeMathWalker Oct 5, 2022
7169ba7
Change include path to include arch
LukeMathWalker Oct 5, 2022
a56e151
Trigger CI
LukeMathWalker Oct 5, 2022
b151d4d
Allow workflow_dispatch on ci-pr to enable triggering this CI workflo…
LukeMathWalker Oct 5, 2022
c1321f6
Trigger CI? Why are you doing this to me GitHub?
LukeMathWalker Oct 5, 2022
d9b37b3
Trigger CI? Are you alive GitHub?
LukeMathWalker Oct 5, 2022
7f697cc
Fix env variables for openssl
LukeMathWalker Oct 6, 2022
1d1685b
Use features only for rust-runtime crates.
LukeMathWalker Oct 6, 2022
58d35cc
Check all feature combinations for aws-smithy-client
LukeMathWalker Oct 6, 2022
cc9d2c8
Dry-up env variables.
LukeMathWalker Oct 6, 2022
9b2ee06
Merge branch 'main' into exotic-ci
LukeMathWalker Oct 6, 2022
a1c7b35
Merge branch 'main' into exotic-ci
LukeMathWalker Oct 6, 2022
ef7002a
A rogue `echo` was missing
LukeMathWalker Oct 6, 2022
01e98a0
Feature-gate doc tests based on the features they require.
LukeMathWalker Oct 6, 2022
58a2822
Put .github folder under shared ownership.
LukeMathWalker Oct 6, 2022
a3bb7c7
Fix docs.
LukeMathWalker Oct 6, 2022
6e1a354
Fix feature selection for doctest.
LukeMathWalker Oct 6, 2022
3796190
We are using methods that are only available if rustls is enabled - a…
LukeMathWalker Oct 6, 2022
dd857e8
Merge branch 'main' into exotic-ci
LukeMathWalker Oct 7, 2022
d47fba6
Merge branch 'main' into exotic-ci
LukeMathWalker Oct 10, 2022
7881449
Remove workflow dispatch trigger.
LukeMathWalker Oct 10, 2022
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
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,69 @@ 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:
fail-fast: false
matrix:
include:
- target: i686-unknown-linux-gnu
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
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
# 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: Configure cross
shell: bash
run: |
cat > Cross.toml << EOF
[build]
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",
"OPENSSL_INCLUDE_DIR",
]
EOF
- 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" --exclude aws-smithy-http-server-python --workspace ${{ matrix.non_aws_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" ${{ matrix.aws_excludes }} --workspace

# This job is split out from the rest since it is not required to pass for merge
check-sdk-examples:
name: Check SDK Examples
Expand All @@ -166,6 +229,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
Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions rust-runtime/aws-smithy-client/additional-ci
Original file line number Diff line number Diff line change
Expand Up @@ -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

echo "### Testing every combination of features (excluding --all-features)"
cargo hack test --feature-powerset --exclude-all-features
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-client/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl<M, R> 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);
LukeMathWalker marked this conversation as resolved.
Show resolved Hide resolved

with_https(self)
}
Expand Down
29 changes: 25 additions & 4 deletions rust-runtime/aws-smithy-client/src/hyper_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -34,7 +47,11 @@
//! 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(feature = "rustls", feature = "client-hyper")),
doc = "```no_run,ignore"
)]
#![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;
Expand Down Expand Up @@ -186,7 +203,11 @@ 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(all(feature = "rustls", feature = "client-hyper")),
doc = "```no_run,ignore"
)]
#[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;
Expand Down Expand Up @@ -428,7 +449,7 @@ mod timeout_middleware {
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
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,
Expand Down