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

Ad-hoc support for the WASM backend #86

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

amesgen
Copy link

@amesgen amesgen commented Aug 13, 2024

This PR adds support for the GHC WASM backend in an ad-hoc fashion by relying on getentropy from the C standard library (as this is available in wasi-libc). There is nothing fundamentally WASM/WASI-specific about this; it works just as well on e.g. stock Linux.

Additionally, we need to change the build-type to Simple, see #42.


This is a draft PR only as skipping the custom setup is probably a non-starter.

A potentially more principled but invasive alternative would be to put the contents of this package in a separate entropy-custom-setup, switch entropy to have build-type: Simple, have an opt-in flag use-getentropy that, when enabled, uses the code added in this PR (apart from hardwareRandom), and when disabled, defers to entropy-custom-setup.

amesgen added 2 commits July 23, 2024 22:13
for cross compilation (eg to WASM)
This isn't really WASI-specific; it should work for any platform that has
`getentropy`.
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.

1 participant