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
+52-69Lines changed: 52 additions & 69 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,13 @@
1
1
# GHCJS
2
2
3
-
To use GHCJS with stack `>= 0.1.8`, place a GHCJS version in the
4
-
[`compiler`](yaml_configuration.md#compiler) field of `stack.yaml`. After
5
-
this, all stack commands should work with GHCJS, except for `ide`. In
6
-
particular:
7
-
8
-
*`stack setup` will install GHCJS from source and boot it, which takes a long
9
-
time.
10
-
*`stack build` will compile your code to JavaScript. In particular, the
11
-
generated code for an executable ends up in `$(stack path
12
-
--local-install-root)/bin/EXECUTABLE.jsexe/all.js` (bash syntax, where
13
-
`EXECUTABLE` is the name of your executable).
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
+
5
+
*`stack setup` will install GHCJS from source and boot it, which takes a long time.
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).
14
8
15
9
You can also build existing stack projects which target GHC, and instead build
16
-
them with GHCJS. For example: `stack build --compiler
17
-
ghcjs-0.1.0.20150924_ghc-7.10.2`
10
+
them with GHCJS. For example: `stack build --compiler ghcjs-0.2.0.9006020_ghc-7.10.3`
18
11
19
12
Sidenote: If you receive a message like `The program 'ghcjs' version >=0.1 is
20
13
required but the version of .../ghcjs could not be determined.`, then you may
@@ -23,37 +16,70 @@ need to install a different version of `node`. See [stack issue
23
16
24
17
## Example Configurations
25
18
26
-
### GHCJS `master` (a.k.a. improved base)
19
+
### Recent versions of GHCJS, repacked for stack
27
20
28
-
To use the master branch, a.k.a improved base, add the following to your `stack.yaml`:
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.
29
25
30
-
GHCJS compiled with GHC 7.10.3 LTS-5.12 (stack.yaml upgraded from stock GHCJS)
If you do not use the same resolver, say, an older LTS snapshot, you will get
65
+
some warnings like this:
66
+
52
67
```
68
+
Ignoring that the GHCJS boot package "aeson" has a different version, 0.9.0.1, than the resolver's wanted version, 0.8.0.2
69
+
Ignoring that the GHCJS boot package "attoparsec" has a different version, 0.13.0.1, than the resolver's wanted version, 0.12.1.6
70
+
Ignoring that the GHCJS boot package "scientific" has a different version, 0.3.3.8, than the resolver's wanted version, 0.3.4.2
71
+
...
72
+
```
73
+
74
+
These warnings can usually be safely ignored, but they do indicate a divergence
75
+
between your snapshot's packages, and those that are being used to compile your
76
+
project. You will normally get these warnings when using a GHCJS tarball that
77
+
has not been packaged with a particular snapshot in mind.
53
78
54
79
### GHCJS (old base)
55
80
56
-
You can use this resolver for GHCJS (old base) in your `stack.yaml`:
81
+
If you want to build some older GHCJS packages, you may need to use the "old
82
+
base" GHCJS. To do this, use the following compiler info:
57
83
58
84
```yaml
59
85
compiler: ghcjs-0.1.0.20150924_ghc-7.10.2
@@ -103,49 +129,6 @@ You can also put both the yaml files in the same directory, and have e.g.
103
129
104
130
If you don't want to use a snapshot, instead place the ghcjs version in the `resolver` field of your `stack.yaml`. This is also necessary when using stack `< 0.1.8`.
105
131
106
-
## Comunity Repacks
107
-
108
-
Each version of resolvers can potentially have diferent versions of packages that the upstream bundle has.
109
-
One way of remeding this situation is to repack the bundle and include packages at version from the resolver.
110
-
Until `ghcjs` will recognise `stack` we need to install a separate version of `ghcjs` for each resolver. In the future we would need to reinstall only if the version of booted packages change or maybe just boot it for the new resolver.
111
-
112
-
However it is only a possible future development.
113
-
Currently, for more recent snapshots one could try:
If `stack setup` command fails to successfully complete with message: `commitBuffer: invalid argument (invalid character)`, it means you have a locale problem.
0 commit comments