Skip to content

Instantly share code, notes, and snippets.

@mstksg
Created May 20, 2017 09:37
Show Gist options
  • Save mstksg/8750388084e97551195532a959963d87 to your computer and use it in GitHub Desktop.
Save mstksg/8750388084e97551195532a959963d87 to your computer and use it in GitHub Desktop.
Preparing GHCJS for Stack

Hello

Just writing this down so I don't go crazy and forget later. Let's build a fresh copy of ghcjs from scratch and package it in a way that stack appreciates.

$ git clone git@github.com:ghcjs/ghcjs.git
$ cd ghcjs
$ git checkout ghc-8.0
$ echo "resolver: lts-7.22" > stack.yaml
$ git add .
$ git commit -m "update resolver"
$ stack install
$ stack exec -- ghcjs-boot --dev --no-haddock --no-prof -j4 --ghcjs-boot-dev-branch ghc-8.0 --shims-dev-branch ghc-8.0 --clean
$ stack sdist

For sdist to to work, it uses the branch you are in to get shims. Edit utils/update_archives.sh and explicitly set BRANCH (instead of letting line 145 detect it) to set it explicitly.

Now in a new directory, add the tarball that sdist creates in the usual way. And then

$ stack --reinstall --install-ghc setup

Goodbye

Goodbye.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment