From fe05fcc4e7f7f9d47b99d314847ebec10d845c87 Mon Sep 17 00:00:00 2001 From: ysaito1001 Date: Mon, 22 Apr 2024 18:26:11 +0000 Subject: [PATCH] [smithy-rs] Fix compiling S3 crate for wasm (#3590) ## Motivation and Context Running `cargo build --target wasm32-unknown-unknown --no-default-features` on an S3 crate has stopped working since https://github.com/smithy-lang/smithy-rs/pull/3465 with the following error: ``` error: the wasm*-unknown-unknown targets are not supported by default, you may need to enable the "js" feature. For more information see: https://docs.rs/getrandom/#webassembly-support --> /Users/[REDACTED]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/getrandom-0.2.14/src/lib.rs:352:9 | 352 | / compile_error!("the wasm*-unknown-unknown targets are not supported by \ 353 | | default, you may need to enable the \"js\" feature. \ 354 | | For more information see: \ 355 | | https://docs.rs/getrandom/#webassembly-support"); | |________________________________________________________________________^ ``` To address the issue, this PR updates an S3's dependency on `ahash` in a way that disables default features. ## Testing Updated the existing test `integration-tests/webassembly` so that `check-aws-sdk-standalone-integration-tests` will run `cargo check` `aws-sdk-s3` against both `wasm32-wasi` and `wasm32-unknown-unknown` (the updated check would break if we removed `default-features = false` from the `ahash` dependency). ## Checklist - [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --- sdk/s3/Cargo.toml | 1 + tests/webassembly/.cargo/config.toml | 2 +- versions.toml | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sdk/s3/Cargo.toml b/sdk/s3/Cargo.toml index 18cb52695066..823287bec4b2 100644 --- a/sdk/s3/Cargo.toml +++ b/sdk/s3/Cargo.toml @@ -15,6 +15,7 @@ all-features = true targets = ["x86_64-unknown-linux-gnu"] [dependencies.ahash] version = "0.8.11" +default-features = false [dependencies.aws-credential-types] path = "../aws-credential-types" diff --git a/tests/webassembly/.cargo/config.toml b/tests/webassembly/.cargo/config.toml index 06b75c8e098b..37f9ac58f5f9 100644 --- a/tests/webassembly/.cargo/config.toml +++ b/tests/webassembly/.cargo/config.toml @@ -1,5 +1,5 @@ [build] -target = "wasm32-wasi" +target = ["wasm32-unknown-unknown", "wasm32-wasi"] [target.wasm32-wasi] rustflags = ["-C", "opt-level=1"] diff --git a/versions.toml b/versions.toml index f5069ee7d7db..a6c3c39f2cd6 100644 --- a/versions.toml +++ b/versions.toml @@ -1,4 +1,4 @@ -smithy_rs_revision = '7fbdcc2b18886ac24e6f2ece06a3580df32bd077' +smithy_rs_revision = '6b59ba26c41a03983de7321795681da137dffc02' aws_doc_sdk_examples_revision = '85778d68832c75a9306cb32e10cbc9887840e2d4' [manual_interventions] @@ -1895,7 +1895,7 @@ model_hash = '34648839402316ab9da4bef0fe11beb9bc3ec1d05b3ff7d09664ab74c0cb3d2b' [crates.aws-sdk-s3] category = 'AwsSdk' version = '1.24.0' -source_hash = '8f50694126c5ea55f373b8e6f21a66bb7d7316f3e075d7a344018f3b23034c5f' +source_hash = 'd585247da7366a1e4c39904e5e9b22b0f9f8adec323d0dc65dd7b253d86fceb4' model_hash = 'd4cf9f91188e26ca9b296ddc7177d3035cd9e87c5e0e7976d9cd65de5b649d53' [crates.aws-sdk-s3control]