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

entropy throws and error during build on GHC-9.x for the JS backend in nixpkgs. #87

Open
doyougnu opened this issue Aug 28, 2024 · 2 comments

Comments

@doyougnu
Copy link

See this ticket: NixOS/nixpkgs#337996

for the whole story.

Essentially what is happening is the Setup.hs file uses inline assembly to call rdrand which is not supported for JS because emscripten does not support it.

So the fix is to either write that assembly in portable C/C++ or write some javascript that does the same thing and use and ifdef to catch when entropy is being cross-compiled.

I'm more than happy to write the js if you need it, but I wanted to defer to the author of the library to make the decision on how best to proceed.

@doyougnu
Copy link
Author

Ah, I just saw that System.GHCJS exists. Perhaps this is just a case of patching Setup.hs then?

@doyougnu doyougnu changed the title entropy fails to build on GHC-9.x for the JS backend in nixpkgs. entropy throws and error during build on GHC-9.x for the JS backend in nixpkgs. Aug 28, 2024
@doyougnu
Copy link
Author

Reading through the Setup.hs more carefully I don't think this error is actually meaningful. Its thrown by emcc during checkRDRAND but the result will be caught by checkGetRandom which compiles just fine. So if anything the change should be to catch stderr here.

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

No branches or pull requests

1 participant