Conversation
Thanks to @georgefst for the `ghc-wasm-patches`, which we borrow wholesale from https://github.com/georgefst/quadris, along with some other useful `haskell.nix` bits. Signed-off-by: Drew Hess <src@drewhess.com>
Signed-off-by: Drew Hess <src@drewhess.com>
Signed-off-by: Drew Hess <src@drewhess.com>
|
Huh, this is interesting. If we take out the The tests that try to But somehow the test discovery seems to work. I need to figure out what's going on, exactly, but this is very encouraging. edit: probably this is the mechanism: https://github.com/input-output-hk/haskell.nix/blob/c179719f50011c64a8639d885f998bc662e4d2d1/overlays/wasm.nix#L49 |
|
Need to figure out how to pass arguments to edit: we can use |
|
I've got a fix for the tests that means we don't have to change anything drastic. I think we're finally close to having working Wasm builds with `haskell.nix. edit: And Wasm benchmarks are working! |
|
There's definitely some Cabal file cleanup we can do, so this PR is a bit of a DRY violation, but I'll leave that for later work. |
Signed-off-by: Drew Hess <src@drewhess.com>
This looks like a big change, but it's almost entirely formatting. The only real change is that we have to evaluate `stdenv.targetPlatform.isWasm` for the `testWrapper` override in its own overlay, or else it will never trigger: when compiling for the `crossPlatforms` target in the flake, Nix thinks the `targetPlatform` is the current `system`. I don't really understand why, but this workaround does the job, so it's fine for now. We might be able to fix this with "real" Nix-style cross support, but `haskell.nix`'s `crossPlatforms` feature is arguably much nicer, so we'll keep doing things this way. Signed-off-by: Drew Hess <src@drewhess.com>
|
82a2da0 is a fix for some Nix (or perhaps I'm not sure why this is happening. This may be due to the fact that |
|
As part of this change, Primer Wasm tests will always run on PR updates (assuming the update forces a Primer package rebuild, anyway), rather than only in the merge queue. Additionally, as we're currently building a Wasm cross toolset and packages for both The good news is that, unlike in the previous system, where we had a separate Wasm toolchain outside the |
|
I'm going to remove the GitHub workflow that publishes benchmarks as part of this PR. We don't push packages to Cachix anymore, so the benchmark publishing action takes a long time to build, and it would even be worse if we started using it to publish Wasm benchmarks, which we clearly want to do ASAP. Figuring out a new solution will require some work, and I don't want to gate this PR on it, so we'll circle back around to this, hopefully relatively soon. |
See #1429 (comment) for rationale. We'll replace this with something better in the near future. Signed-off-by: Drew Hess <src@drewhess.com>
This is to ensure we don't run into the same issue as we had with predicating our `testWrapper` override on `stdenv.targetPlatform.isWasm`. Signed-off-by: Drew Hess <src@drewhess.com>
We use the `wasm32-unknown-wasi-cabal` linker shim from https://github.com/georgefst/quadris, which fixes interactive build issues like this: ``` wasm32-unknown-wasi-cabal build all Build profile: -w ghc-9.14.1 -O2 In order, the following will be built (use -v for more details): - hedgehog-1.7 (lib) (requires build) - primer-miso-0.8.0.0 (exe:primer-miso) (first run) - tasty-hedgehog-1.4.0.2 (lib) (requires build) - primer-0.7.2.0 (lib:primer-testlib) (first run) - hedgehog-classes-0.2.5.4 (lib) (requires build) - primer-benchmark-0.7.2.0 (lib) (first run) - primer-api-0.7.2.0 (lib:primer-api-testlib) (first run) - primer-0.7.2.0 (lib:primer-hedgehog) (first run) - primer-benchmark-0.7.2.0 (test:primer-benchmark-test) (first run) - primer-benchmark-0.7.2.0 (bench:primer-benchmark) (first run) - primer-api-0.7.2.0 (test:primer-api-test) (first run) - primer-api-0.7.2.0 (lib:primer-api-hedgehog) (first run) - primer-0.7.2.0 (test:primer-test) (first run) Starting hedgehog-1.7 (lib) Preprocessing executable 'primer-miso' for primer-miso-0.8.0.0... Building executable 'primer-miso' for primer-miso-0.8.0.0... <command line>: cannot satisfy -package-id miso-1.9.0.0-2iwfE70Ir6BGugvi4pWu6A (use -v for more information) Building hedgehog-1.7 (lib) Failed to build hedgehog-1.7. Build log ( /Users/dhess/.cache/cabal/logs/ghc-9.14.1/hdghg-1.7-0da76e4a.log ): Configuring library for hedgehog-1.7... Preprocessing library for hedgehog-1.7... Building library for hedgehog-1.7... <command line>: cannot satisfy -package-id concurrent-output-1.10.21-4mik95bkUE8CPm1JkyCen9 (use -v for more information) Error: [Cabal-7125] Failed to build hedgehog-1.7 (which is required by test:primer-test from primer-0.7.2.0, test:primer-api-test from primer-api-0.7.2.0 and others). See the build log above for details. Failed to build exe:primer-miso from primer-miso-0.8.0.0. make: *** [Makefile:27: build-wasm] Error 1 ``` Oddly only interactive builds are affected. Additionally, we: - provide a `test-wrapper` for Wasm tests in the Nix shell - restore most Wasm `Makefile` targets from the old `Makefile.wasm32` system - add all Wasm optimizer tools to the Nix shell - sync up our `index.js` shim with https://github.com/georgefst/quadris, mainly to support a local browser Wasi shim, to reduce external dependencies We drop Wasm `repl` and `watch` targets for now until we can sync up with the latest ecosystem improvements. (These were broken in the old non-`haskell.nix` Wasm system, anyway.) Future work will include bundling the frontend distribution with Nix. Signed-off-by: Drew Hess <src@drewhess.com>
Thanks to @georgefst for the
ghc-wasm-patches, which we borrow wholesale from https://github.com/georgefst/quadris, along with some other usefulhaskell.nixbits.