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

Introduction of ahash as dependency in s3 breaks webassembly(wasm) support #1131

Closed
tistatos opened this issue Apr 17, 2024 · 4 comments
Closed
Assignees
Labels
bug This issue is a bug. pending-release This issue will be fixed by an approved PR that hasn't been released yet.

Comments

@tistatos
Copy link

Describe the bug

As of smithy-lang/smithy-rs#3465 it's no longer possible to compile the aws-sdk-s3 to wasm. Since it it using ahash with default features enabled, getrandom will be a sub-dependency (via the runtime-rng feature of ahash).

Expected Behavior

I'd like to be able to compile the aws-sdk-s3 to wasm 😃.
Previously this has been possible by disabling the default features on the aws-sdk-s3 crate.

Current Behavior

Compilation of aws-sdk-s3 will fail due to the inclusion of getrandom without its js flag enabled

Reproduction Steps

try to compile the aws-sdk-s3 crate with cargo build --target wasm32-unknown-unknown --no-default-features.

current output of this command:

cargo build --target wasm32-unknown-unknown --no-default-features
   Compiling powerfmt v0.2.0
   Compiling http v1.1.0
   Compiling pin-utils v0.1.0
   Compiling http v0.2.12
   Compiling time-core v0.1.2
   Compiling vsimd v0.8.0
   Compiling num-conv v0.1.0
   Compiling num-traits v0.2.18
   Compiling outref v0.5.1
   Compiling either v1.11.0
   Compiling ryu v1.0.17
   Compiling generic-array v0.14.7
   Compiling futures-task v0.3.30
   Compiling tracing-attributes v0.1.27
   Compiling bytes-utils v0.1.4
   Compiling futures-util v0.3.30
   Compiling deranged v0.3.11
   Compiling tokio v1.37.0
   Compiling base64-simd v0.8.0
   Compiling subtle v2.5.0
   Compiling percent-encoding v2.3.1
   Compiling crc32fast v1.4.0
   Compiling block-buffer v0.10.4
   Compiling num-integer v0.1.46
   Compiling crypto-common v0.1.6
   Compiling http-body v1.0.0
   Compiling http-body v0.4.6
   Compiling digest v0.10.7
   Compiling http-body-util v0.1.1
   Compiling tinyvec_macros v0.1.1
   Compiling time v0.3.36
   Compiling tinyvec v1.6.0
   Compiling sha2 v0.10.8
   Compiling ahash v0.8.11
   Compiling form_urlencoded v1.2.1
   Compiling aws-types v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-types)
   Compiling crc32c v0.6.5
   Compiling getrandom v0.2.14
   Compiling hex v0.4.3
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");
    | |________________________________________________________________________^

error[E0433]: failed to resolve: use of undeclared crate or module `imp`
   --> /Users/[REDACTED]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/getrandom-0.2.14/src/lib.rs:408:9
    |
408 |         imp::getrandom_inner(dest)?;
    |         ^^^ use of undeclared crate or module `imp`

For more information about this error, try `rustc --explain E0433`.
error: could not compile `getrandom` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...

Possible Solution

No response

Additional Information/Context

No response

Version

aws-sdk-s3 v1.23.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/s3)
├── aws-credential-types v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-credential-types)
│   ├── aws-smithy-async v1.2.1 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-async)
│   ├── aws-smithy-runtime-api v1.4.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime-api)
│   │   ├── aws-smithy-async v1.2.1 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-async) (*)
│   │   ├── aws-smithy-types v1.1.8 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-types)
│   ├── aws-smithy-types v1.1.8 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-types) (*)
├── aws-runtime v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-runtime)
│   ├── aws-credential-types v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-credential-types) (*)
│   ├── aws-sigv4 v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-sigv4)
│   │   ├── aws-credential-types v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-credential-types) (*)
│   │   ├── aws-smithy-eventstream v0.60.4 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-eventstream)
│   │   │   ├── aws-smithy-types v1.1.8 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-types) (*)
│   │   ├── aws-smithy-http v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-http)
│   │   │   ├── aws-smithy-eventstream v0.60.4 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-eventstream) (*)
│   │   │   ├── aws-smithy-runtime-api v1.4.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime-api) (*)
│   │   │   ├── aws-smithy-types v1.1.8 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-types) (*)
│   │   ├── aws-smithy-runtime-api v1.4.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime-api) (*)
│   │   ├── aws-smithy-types v1.1.8 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-types) (*)
│   ├── aws-smithy-async v1.2.1 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-async) (*)
│   ├── aws-smithy-eventstream v0.60.4 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-eventstream) (*)
│   ├── aws-smithy-http v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-http) (*)
│   ├── aws-smithy-runtime-api v1.4.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime-api) (*)
│   ├── aws-smithy-types v1.1.8 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-types) (*)
│   ├── aws-types v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-types)
│   │   ├── aws-credential-types v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-credential-types) (*)
│   │   ├── aws-smithy-async v1.2.1 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-async) (*)
│   │   ├── aws-smithy-runtime-api v1.4.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime-api) (*)
│   │   ├── aws-smithy-types v1.1.8 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-types) (*)
├── aws-sigv4 v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-sigv4) (*)
├── aws-smithy-async v1.2.1 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-async) (*)
├── aws-smithy-checksums v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-checksums)
│   ├── aws-smithy-http v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-http) (*)
│   ├── aws-smithy-types v1.1.8 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-types) (*)
├── aws-smithy-eventstream v0.60.4 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-eventstream) (*)
├── aws-smithy-http v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-http) (*)
├── aws-smithy-json v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-json)
│   └── aws-smithy-types v1.1.8 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-types) (*)
├── aws-smithy-runtime v1.3.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime)
│   ├── aws-smithy-async v1.2.1 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-async) (*)
│   ├── aws-smithy-http v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-http) (*)
│   ├── aws-smithy-protocol-test v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-protocol-test)
│   │   ├── aws-smithy-runtime-api v1.4.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime-api) (*)
│   ├── aws-smithy-runtime-api v1.4.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime-api) (*)
│   ├── aws-smithy-types v1.1.8 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-types) (*)
├── aws-smithy-runtime-api v1.4.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime-api) (*)
├── aws-smithy-types v1.1.8 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-types) (*)
├── aws-smithy-xml v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-xml)
├── aws-types v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-types) (*)
├── aws-config v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-config)
│   ├── aws-credential-types v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-credential-types) (*)
│   ├── aws-runtime v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-runtime) (*)
│   ├── aws-sdk-sso v1.20.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/sso)
│   │   ├── aws-credential-types v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-credential-types) (*)
│   │   ├── aws-runtime v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-runtime) (*)
│   │   ├── aws-smithy-async v1.2.1 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-async) (*)
│   │   ├── aws-smithy-http v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-http) (*)
│   │   ├── aws-smithy-json v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-json) (*)
│   │   ├── aws-smithy-runtime v1.3.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime) (*)
│   │   ├── aws-smithy-runtime-api v1.4.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime-api) (*)
│   │   ├── aws-smithy-types v1.1.8 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-types) (*)
│   │   ├── aws-types v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-types) (*)
│   ├── aws-sdk-ssooidc v1.20.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/ssooidc)
│   │   ├── aws-credential-types v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-credential-types) (*)
│   │   ├── aws-runtime v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-runtime) (*)
│   │   ├── aws-smithy-async v1.2.1 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-async) (*)
│   │   ├── aws-smithy-http v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-http) (*)
│   │   ├── aws-smithy-json v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-json) (*)
│   │   ├── aws-smithy-runtime v1.3.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime) (*)
│   │   ├── aws-smithy-runtime-api v1.4.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime-api) (*)
│   │   ├── aws-smithy-types v1.1.8 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-types) (*)
│   │   ├── aws-types v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-types) (*)
│   ├── aws-sdk-sts v1.20.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/sts)
│   │   ├── aws-credential-types v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-credential-types) (*)
│   │   ├── aws-runtime v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-runtime) (*)
│   │   ├── aws-smithy-async v1.2.1 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-async) (*)
│   │   ├── aws-smithy-http v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-http) (*)
│   │   ├── aws-smithy-json v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-json) (*)
│   │   ├── aws-smithy-query v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-query)
│   │   │   ├── aws-smithy-types v1.1.8 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-types) (*)
│   │   ├── aws-smithy-runtime v1.3.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime) (*)
│   │   ├── aws-smithy-runtime-api v1.4.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime-api) (*)
│   │   ├── aws-smithy-types v1.1.8 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-types) (*)
│   │   ├── aws-smithy-xml v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-xml) (*)
│   │   ├── aws-types v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-types) (*)
│   ├── aws-smithy-async v1.2.1 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-async) (*)
│   ├── aws-smithy-http v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-http) (*)
│   ├── aws-smithy-json v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-json) (*)
│   ├── aws-smithy-runtime v1.3.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime) (*)
│   ├── aws-smithy-runtime-api v1.4.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime-api) (*)
│   ├── aws-smithy-types v1.1.8 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-types) (*)
│   ├── aws-types v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-types) (*)
├── aws-credential-types v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-credential-types) (*)
├── aws-runtime v1.2.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-runtime) (*)
├── aws-smithy-async v1.2.1 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-async) (*)
├── aws-smithy-experimental v0.1.1 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-experimental)
│   ├── aws-smithy-async v1.2.1 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-async) (*)
│   ├── aws-smithy-runtime-api v1.4.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime-api) (*)
│   ├── aws-smithy-types v1.1.8 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-types) (*)
├── aws-smithy-protocol-test v0.60.7 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-protocol-test) (*)
├── aws-smithy-runtime v1.3.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime) (*)
├── aws-smithy-runtime-api v1.4.0 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-runtime-api) (*)
├── aws-smithy-types v1.1.8 (/Users/[REDACTED]/dev/aws-sdk-rust/sdk/aws-smithy-types) (*)

Environment details (OS name and version, etc.)

macos 14.3.1 (23D60)

Logs

No response

@tistatos tistatos added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 17, 2024
@ysaito1001
Copy link
Collaborator

Hi @tistatos, thanks for reporting this! We'll work on getting the fix out.

@ysaito1001 ysaito1001 removed the needs-triage This issue or PR still needs to be triaged. label Apr 17, 2024
@ysaito1001 ysaito1001 self-assigned this Apr 17, 2024
@ysaito1001
Copy link
Collaborator

Fix got merged to the main branch in smithy-rs, pending release.

@ysaito1001 ysaito1001 added the pending-release This issue will be fixed by an approved PR that hasn't been released yet. label Apr 18, 2024
@ysaito1001
Copy link
Collaborator

Confirmed aws-sdk-s3 in release-2024-04-22 fixed the issue:

➜  s3 git:(release-2024-04-22) cargo build --target wasm32-unknown-unknown --no-default-features
   ...
   Compiling aws-sdk-s3 v1.24.0 (/Users/awsaito/src/aws-sdk-rust/sdk/s3)
    Finished dev [unoptimized + debuginfo] target(s) in 0.50s

Copy link

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. pending-release This issue will be fixed by an approved PR that hasn't been released yet.
Projects
None yet
Development

No branches or pull requests

2 participants