You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/ghcjs.md
+23-33Lines changed: 23 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,13 @@
1
1
# GHCJS
2
2
3
-
To use GHCJS with stack`>= 0.1.8`, place a GHCJS version in the [`compiler`](yaml_configuration.md#compiler) field of `stack.yaml`. After this, all stack commands should work with GHCJS, except for `ide`. In particular:
3
+
To use GHCJS with stack, place a GHCJS version in the [`compiler`](yaml_configuration.md#compiler) field of `stack.yaml`. After this, all stack commands should work with GHCJS! In particular:
4
4
5
5
*`stack setup` will install GHCJS from source and boot it, which takes a long time.
6
+
6
7
*`stack build` will compile your code to JavaScript. In particular, the generated code for an executable ends up in `$(stack path --local-install-root)/bin/EXECUTABLE.jsexe/all.js` (bash syntax, where `EXECUTABLE` is the name of your executable).
7
8
8
-
You can also build existing stack projects which target GHC, and instead build them with GHCJS. For example: `stack build --compiler ghcjs-0.1.0.20150924_ghc-7.10.2`
9
+
You can also build existing stack projects which target GHC, and instead build
10
+
them with GHCJS. For example: `stack build --compiler ghcjs-0.2.0.9006020_ghc-7.10.3`
9
11
10
12
Sidenote: If you receive a message like `The program 'ghcjs' version >=0.1 is
11
13
required but the version of .../ghcjs could not be determined.`, then you may
@@ -14,11 +16,12 @@ need to install a different version of `node`. See
14
16
15
17
## Example Configurations
16
18
17
-
### Stack based repacks
19
+
### Recent versions of GHCJS, repacked for stack
18
20
19
-
Upstream `ghcjs` bundles have some specific version of packages, and each version of stack resolver can potentially have a different version of those packages. We might ignore those differences and it usually works, but it might as well break if the package has some different semantics or we install the same package with 2 resolvers.
20
-
One way of remedying this situation is to repack the bundle to use packages at versions from the resolver. This will allow using multiple resolvers for different projects without a clash.
21
-
Using other ways of installing `ghcjs` might require purging `~/.ghcjs` or even `~/.stack` each time we use a different resolver.
21
+
These versions of GHCJS were created by
22
+
[Marcin Tolysz](https://github.com/tolysz), and were particularly crafted to
23
+
include package versions which match those expected by particular stackage
24
+
snapshots.
22
25
23
26
For `ghcjs` based on `ghc-7.10.3` one could try:
24
27
```yaml
@@ -38,7 +41,7 @@ Or for the latest one based on `ghc-8.0.1` (with more features):
0 commit comments