WebGHC / wasm-cross

Nix expressions for cross compiling to WebAssembly
141 stars 5 forks source link

Upstreaming to Nixpkgs #28

Closed matthewbauer closed 4 years ago

matthewbauer commented 5 years ago

How hard is it to upstream this to Nixpkgs? Specifically the wasm / clang cross stdenv.

ElvishJerricco commented 5 years ago

The main problem is the custom musk fork. I suspect getting a clang/musl/static stdenv is reasonably upstreamable, and agnostic of wasm. The changes to musl are specific to wasm, and are pretty extremely minimal. I think upstreaming the wasm stages to nixpkgs sometime soon would be a great goal.

matthewbauer commented 5 years ago

Yeah - the "musl" fork works as the libc for wasm?

It would be really nice to get a "llvm-cross" option in Nixpkgs so that we can seamlessly switch between the two. But, WebAssembly in general I think could be a killer feature for Nixpkgs! Packaging the musl fork as something like musl-wasm would be reasonable.

matthewbauer commented 5 years ago

I have a wip branch here: https://github.com/matthewbauer/nixpkgs/commits/wasm

Mainly trying to get a fully LLVM based toolchain.

dfordivam commented 4 years ago

It is great to have musl/wasi-lib-c based compilation available in upstream nixpkgs, but it cannot be used by WebGHC as it is missing many pieces necessary to compile the RTS and more importantly the libraries (like pthread.h, process).

So for now its better to continue to use our own musl fork with the custom webabi support.

Also would like to mention here that another PR has been upstreamed here https://github.com/NixOS/nixpkgs/pull/92168

Now the remaining bits are related to the target triple (wasm32-unknown-unknown-wasm) and actual cross compilation using the musl fork. But I dont expect these to get upstreamed.