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

wasm32-unknown-emscripten support #530

Closed
yu-re-ka opened this issue Sep 20, 2021 · 0 comments · Fixed by #531
Closed

wasm32-unknown-emscripten support #530

yu-re-ka opened this issue Sep 20, 2021 · 0 comments · Fixed by #531

Comments

@yu-re-ka
Copy link

yu-re-ka commented Sep 20, 2021

Describe the bug

Even though uuid is included with the v4 feature, the new_v4 function doesn't exist.

error[E0599]: no function or associated item named `new_v4` found for struct `Uuid` in the current scope
  --> src/core/segment_id.rs:43:11
   |
43 |     Uuid::new_v4()
   |           ^^^^^^ function or associated item not found in `Uuid`

To Reproduce
Steps to reproduce the behavior:

  1. Add uuid dependency with v4 feature
  2. Call new_v4 function
  3. Build with target wasm32-unknown-emscripten

Expected behavior

Since emscripten provides the rand functions via the usual C api, uuid should not treat wasm32-unknown-emscripten different than x86_64-unknown-linux-gnu.

It should use libc random via the rand crate as usual.

Screenshots
If applicable, add screenshots to help explain your problem.

Specifications (please complete the following information):

  • Target: wasm32-unknown-emscripten
  • Version 0.8.2
  • Features Enabled: v4

Additional context

#351

Back then nobody thought about emscripten, so they assumed all wasm32 targets would need workarounds.

Other
An exception was already added for wasi:
#477
But really this should be a specific check for wasm32-unknown-unknown and allow everything else.

@yu-re-ka yu-re-ka changed the title v4 on wasm32-unknown-emscripten wasm32-unknown-emscripten support Sep 20, 2021
yu-re-ka added a commit to yu-re-ka/uuid that referenced this issue Sep 20, 2021
wasm32-unknown-wasi and wasm32-unknown-emscripten should both function
normally.

Fixes uuid-rs#530
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant