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.