Skip to content

Conversation

@b521f771d8991e6f1d8e65ae05a8d783

Nothing big, just an explanation on how to build the wasm package inside the docker container, see here for the bug: #3028

@Skgland
Copy link
Contributor

Skgland commented Aug 8, 2025

What's up with those last five commits (9f79670..7cb231b)?

  • breaking crypto_random_byte for all targets
  • unrelated to documentation change this PR is about
  • unsigned commits even though the first three are

If you want to be able to disable the ring/wasm32_unknown_unknown_js feature (to reduce the compilation on wasm I presume) that should be placed behind an appropriate feature toggle and the code requiring it (presumably only on wasm32-unknown-unknown targets) should be #[cfg]-ed accordingly.

@b521f771d8991e6f1d8e65ae05a8d783
Copy link
Author

sorry for that, they just were a personal experiment - they are gone now. I needed to debug a strange bug that occurred while building scryer-prolog to wasm on linux (if not built using clang, the wasm included some imports like (import "env" "ring_core_0_17_14__bn_from_montgomery_in_place" (func (;1;) (type 11))) (import "env" "ring_core_0_17_14__limbs_mul_add_limb" (func (;2;) (type 3))), which caused errors in vote), but that is an upstream bug.

@bakaq
Copy link
Contributor

bakaq commented Aug 8, 2025

I remember encountering exactly this bug (#2819). You need to have a C compiler that can cross compile to Wasm, because if not then these ring functions can't be compiled and linked. Clang can do that by default, but GCC can't by default and you need a special toolchain. Maybe it would be a good idea to document that (though I kinda remember documenting that already).

@b521f771d8991e6f1d8e65ae05a8d783
Copy link
Author

I remember encountering exactly this bug (#2819). You need to have a C compiler that can cross compile to Wasm, because if not then these ring functions can't be compiled and linked. Clang can do that by default, but GCC can't by default and you need a special toolchain. Maybe it would be a good idea to document that (though I kinda remember documenting that already).

Thank you - this really annoyed me the last few hours :D But I think this is an upstream bug, I am not yet sure where (somewhere in GCC? wasm-pack? ring? something tells me that this is not rings fault :)), if I have time I will try to triangulate it and report it upstream.

@bakaq
Copy link
Contributor

bakaq commented Aug 8, 2025

It doesn't seem to be ring's fault, I've already reported to them back them: briansmith/ring#2345.

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 this pull request may close these issues.

3 participants