Replies: 2 comments
-
I agree with this. But, there's not enough information in the bug report to indicate why the nix-wrapped compiler didn't correctly compile the code and/or why the library containing the C code didn't get linked. Much more investigation would be needed. I hope somebody does that and reports back. I've moved this to the "Building" discussion group. |
Beta Was this translation helpful? Give feedback.
-
I dug into this a little bit because of an downstream issue. On a fresh ubuntu system after following instructions for direnv, nix, and flake support I could reproduce the issue immediately. The environment is using If I apply this (probably overly verbose because I hit some issues) diff to the flake.nix file to use clang then everything appears to work. Maybe this is an issue for upstream
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
When building the ring crate for WASM in a Nix environment, the resulting WASM binary does not function correctly.
Steps to Reproduce
The contents of the ring-wasm-experiment repository are as follows:
expand to view
Cargo.toml
src/main.rs
flake.nix
Expected Behavior
The binary should run successfully, just as it does when built outside the Nix environment.
Actual Behavior
What I’ve Tried
On a Debian host, uncommenting the
shellHook
(export CC=clang
) inflake.nix
and rebuilding results in a valid binary. In other words, using the host’s Clang (rather than the nix-wrapped compiler) allows the compilation to succeed. So I suspected that addingclang-unwrapped
toflake.nix
might resolve the issue, but that did not work.I also tried enabling the
wasm32_unknown_unknown_js
feature of ring, but it had no effect.Note: The
export CC=clang
workaround is not a real solution. Depending on tools outside the Nix environment undermines its goal of isolated and reproducible builds, and on NixOS, even the host Clang is nix-wrapped, meaning the build still fails.Beta Was this translation helpful? Give feedback.
All reactions