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

Fix compiling S3 crate for wasm #3590

Merged
merged 10 commits into from
Apr 18, 2024
9 changes: 8 additions & 1 deletion CHANGELOG.next.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,11 @@ author = "avandesa"
message = "Change some credentials related info log messages to debug."
references = ["smithy-rs#3546"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "orf"
author = "orf"


[[aws-sdk-rust]]
message = "Fix an S3 crate's dependency on `ahash` so the crate can be compiled for `wasm32-unknown-unknown`."
references = ["smithy-rs#3590", "aws-sdk-rust#1131"]
meta = { "breaking" = false, "tada" = false, "bug" = true }
author = "ysaito1001"
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-inlineable/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repository = "https://github.com/smithy-lang/smithy-rs"
# Used by lru, and this forces it to be a later version that avoids
# https://github.com/tkaitchuck/aHash/issues/200
# when built with `cargo update -Z minimal-versions`
ahash = "0.8.11"
ahash = { version = "0.8.11", default-features = false }
aws-credential-types = { path = "../aws-credential-types" }
aws-runtime = { path = "../aws-runtime", features = ["http-02x"] }
aws-sigv4 = { path = "../aws-sigv4" }
Expand Down
5 changes: 4 additions & 1 deletion aws/sdk/integration-tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ for f in *; do
else
# The webassembly tests use a custom runner set in config.toml that
# is not picked up when running the tests outside of the package
cd webassembly && cargo component test --all-features --all-targets && cd ..
# The tests are written for `wasm32-wasi` but the manifest config also specifies
# `wasm32-unknown-unknown` so we can ensure the test build on that platform as well.
# For executing the tests, however, we explicitly choose a target `wasm32-wasi`.
cd webassembly && cargo component test --all-features --target wasm32-wasi && cd ..
ysaito1001 marked this conversation as resolved.
Show resolved Hide resolved
fi
fi
done
2 changes: 1 addition & 1 deletion aws/sdk/integration-tests/webassembly/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build]
target = "wasm32-wasi"
target = ["wasm32-unknown-unknown", "wasm32-wasi"]

[target.wasm32-wasi]
rustflags = ["-C", "opt-level=1"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ data class CargoDependency(
companion object {
// Forces AHash to be a later version that avoids
// https://github.com/tkaitchuck/aHash/issues/200
val AHash: CargoDependency = CargoDependency("ahash", CratesIo("0.8.11"))
val AHash: CargoDependency = CargoDependency("ahash", CratesIo("0.8.11"), defaultFeatures = false)
val OnceCell: CargoDependency = CargoDependency("once_cell", CratesIo("1.16"))
val Url: CargoDependency = CargoDependency("url", CratesIo("2.3.1"))
val Bytes: CargoDependency = CargoDependency("bytes", CratesIo("1.0.0"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ cargo check --tests --all-features

# Running WebAssembly (WASI) specific integration tests
pushd "${tmp_dir}/aws/sdk/integration-tests/webassembly" &>/dev/null
cargo check --tests --all-features
cargo check --tests --all-features --all-targets

popd
popd
Loading