... | ... | @@ -105,19 +105,7 @@ Build using Hadrian, no surprises here: |
|
|
[nix-shell:~/programming/ghc]$ hadrian/build -j12 --flavour=quick-js --bignum=native --docs=none
|
|
|
```
|
|
|
|
|
|
That should take around 30 minutes to complete. `hsc2hs` should be very slow (we're sorry) because its running `emcc` several times. Similarly, expect the `CCS.hs` module itself to take minutes (again, we're sorry! I (Jeff) promise we have a ticket for it). Once that's done you need to export the path to the JS shims and `jsbits` in the base library. This will be the case until we finish patching the `js-sources` field in cabal. So run:
|
|
|
```
|
|
|
[nix-shell:~/programming/ghc]$ export JS_RTS_PATH=/path/to/ghc/js/
|
|
|
|
|
|
[nix-shell:~/programming/ghc]$ export JS_BASE_PATH=/path/to/ghc/libraries/base/jsbits/
|
|
|
```
|
|
|
On my machine, those invocations look like this:
|
|
|
```
|
|
|
[nix-shell:~/programming/ghc]$ export JS_RTS_PATH=/home/doyougnu/programming/ghc/js/
|
|
|
|
|
|
[nix-shell:~/programming/ghc]$ export JS_BASE_PATH=/home/doyougnu/programming/ghc/libraries/base/jsbits/
|
|
|
```
|
|
|
These environment variables are checked by the JS backend linker. The linker will error out if they are not set properly so be sure you have done this! Now you should have a working Haskell to JavaScript compiler. Good luck!
|
|
|
That should take around 30 minutes to complete. `hsc2hs` should be very slow (we're sorry) because its running `emcc` several times. Similarly, expect the `CCS.hs` module itself to take minutes (again, we're sorry! I (Jeff) promise we have a ticket for it). Now you should have a working Haskell to JavaScript compiler. Good luck!
|
|
|
|
|
|
## Running the test suite
|
|
|
You can run the test suite like so:
|
... | ... | @@ -137,11 +125,6 @@ set -euo pipefail |
|
|
export EMCC_SKIP_SANITY_CHECK=1
|
|
|
export EM_IGNORE_SANITY=1
|
|
|
|
|
|
## flags to which are currently required to find shims and base.
|
|
|
## IMPORTANT: you must change these to the right paths for your environment!
|
|
|
export JS_RTS_PATH=~/path/to/ghc/js-staging/js/
|
|
|
export JS_BASE_PATH=~/path/to/ghc/js-staging/libraries/base/jsbits/
|
|
|
|
|
|
## configure using emconfigure, targeting js-backend
|
|
|
emconfigure ./configure --target=js-unknown-ghcjs
|
|
|
|
... | ... | |