Skip to content

Commit 65fe62d

Browse files
committed
Merge branch 'stable'
2 parents 35b589c + 2825b48 commit 65fe62d

4 files changed

Lines changed: 55 additions & 71 deletions

File tree

doc/custom_snapshot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ you can now use the custom snapshot like this:
2424
resolver:
2525
name: simple-snapshot # Human readable name for the snapshot
2626
location: simple-snapshot.yaml
27-
```
27+
```
2828

2929
This is an example of a custom snapshot stored in the filesystem. They are
3030
assumed to be mutable, so you are free to modify it. We detect that the snapshot

doc/ghcjs.md

Lines changed: 52 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
# GHCJS
22

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).
148

159
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`
1811

1912
Sidenote: If you receive a message like `The program 'ghcjs' version >=0.1 is
2013
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
2316

2417
## Example Configurations
2518

26-
### GHCJS `master` (a.k.a. improved base)
19+
### Recent versions of GHCJS, repacked for stack
2720

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.
2925

30-
GHCJS compiled with GHC 7.10.3 LTS-5.12 (stack.yaml upgraded from stock GHCJS)
26+
For `ghcjs` based on `ghc-7.10.3` one could try:
3127
```yaml
32-
compiler: ghcjs-0.2.0.20160414_ghc-7.10.3
28+
resolver: lts-6.20
29+
compiler: ghcjs-0.2.0.9006020_ghc-7.10.3
3330
compiler-check: match-exact
31+
3432
setup-info:
3533
ghcjs:
3634
source:
37-
ghcjs-0.2.0.20160414_ghc-7.10.3:
38-
url: https://s3.amazonaws.com/ghcjs/ghcjs-0.2.0.20160414_ghc-7.10.3.tar.gz
39-
sha1: 6d6f307503be9e94e0c96ef1308c7cf224d06be3
35+
ghcjs-0.2.0.9006020_ghc-7.10.3:
36+
url: http://ghcjs.tolysz.org/lts-6.20-9006020.tar.gz
37+
sha1: a6cea90cd8121eee3afb201183c6e9bd6bacd94a
4038
```
4139
42-
GHCJS compiled with GHC 7.10.2 LTS-3.6 (stack.yaml that comes with GHCJS)
40+
Or for the latest one based on `ghc-8.0.1` (with more features):
4341
```yaml
44-
compiler: ghcjs-0.2.0.20160414_ghc-7.10.2
42+
resolver: lts-7.2
43+
compiler: ghcjs-0.2.1.9007002_ghc-8.0.1
4544
compiler-check: match-exact
45+
4646
setup-info:
4747
ghcjs:
4848
source:
49-
ghcjs-0.2.0.20160414_ghc-7.10.2:
50-
url: https://s3.amazonaws.com/ghcjs/ghcjs-0.2.0.20160414_ghc-7.10.2.tar.gz
51-
sha1: f0a7243e781e27ebfe601eebaf5c57422007c142
49+
ghcjs-0.2.1.9007002_ghc-8.0.1:
50+
url: http://ghcjs.tolysz.org/ghc-8.0-2016-10-01-lts-7.2-9007002.tar.gz
51+
sha1: a41ae415328e2b257d40724d13d1386390c26322
52+
```
53+
The later can be generated via: https://github.com/tolysz/prepare-ghcjs
54+
the fromer is a bit more manual. Those bundles are only tested against the latest `node-6.7.0`.
55+
56+
Older resolvers:
57+
58+
|resolver|url|sha1|
59+
|---|---|---|
60+
| lts-7.1 | http://ghcjs.tolysz.org/ghc-8.0-2016-09-26-lts-7.1-9007001-mem.tar.gz | e640724883238593e2d2f7f03991cb413ec0347b |
61+
| lts-6.19 | http://ghcjs.tolysz.org/lts-6.19-9006019.tar.gz | ef4264d5a93b269ee4ec8f9d5139da030331d65a |
62+
| lts-6.18 | http://ghcjs.tolysz.org/lts-6.18-9006018.tar.gz | 3e9f345116c851349a5a551ffd94f7e0b74bfabb |
63+
64+
If you do not use the same resolver, say, an older LTS snapshot, you will get
65+
some warnings like this:
66+
5267
```
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.
5378

5479
### GHCJS (old base)
5580

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:
5783

5884
```yaml
5985
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.
103129

104130
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`.
105131

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:
114-
```yaml
115-
resolver: lts-6.19
116-
compiler: ghcjs-0.2.0.9006019_ghc-7.10.3
117-
compiler-check: match-exact
118-
119-
setup-info:
120-
ghcjs:
121-
source:
122-
ghcjs-0.2.0.9006019_ghc-7.10.3:
123-
url: http://tolysz.org/ghcjs/lts-6.19-9006019.tar.gz
124-
sha1: ef4264d5a93b269ee4ec8f9d5139da030331d65a
125-
```
126-
127-
Or for the latest (with more features):
128-
```yaml
129-
resolver: lts-7.1
130-
compiler: ghcjs-0.2.1.9007001_ghc-8.0.1
131-
compiler-check: match-exact
132-
133-
setup-info:
134-
ghcjs:
135-
source:
136-
ghcjs-0.2.1.9007001_ghc-8.0.1:
137-
url: http://tolysz.org/ghcjs/ghc-8.0-2016-09-26-lts-7.1-9007001-mem.tar.gz
138-
sha1: e640724883238593e2d2f7f03991cb413ec0347b
139-
```
140-
The later can be generated via: https://github.com/tolysz/prepare-ghcjs
141-
the fromer is a bit more manual.
142-
143-
Older resolvers:
144-
145-
|resolver|url|sha1|
146-
|---|---|---|
147-
| lts-6.18 | http://tolysz.org/ghcjs/lts-6.18-9006019.tar.gz | 3e9f345116c851349a5a551ffd94f7e0b74bfabb |
148-
149132
## Setting up GHCJS on Windows
150133

151134
If `stack setup` command fails to successfully complete with message: `commitBuffer: invalid argument (invalid character)`, it means you have a locale problem.

doc/yaml_configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ Specifies how dependencies are resolved. There are currently four resolver types
185185
* No snapshot, just use packages shipped with the compiler
186186
* For GHC this looks like `resolver: ghc-7.10.2`
187187
* For GHCJS this looks like `resolver: ghcjs-0.1.0_ghc-7.10.2`.
188-
* [Custom snapshot](https://github.com/commercialhaskell/stack/wiki/Custom-Snapshot)
188+
* [Custom snapshot](custom_snapshot.md)
189189

190190
Each of these resolvers will also determine what constraints are placed on the
191191
compiler version. See the [compiler-check](#compiler-check) option for some

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pages:
2323
- Non-standard project initialization: nonstandard_project_init.md
2424
- Shell Auto-completion: shell_autocompletion.md
2525
- Travis CI: travis_ci.md
26+
- Custom snapshots: custom_snapshot.md
2627
- Code Coverage: coverage.md
2728
- Advanced documentation:
2829
- Architecture: architecture.md

0 commit comments

Comments
 (0)