"stack build" (ghcjs) fails with "happy" which requires ghc compiler in path
luigy opened this issue · 6 comments
asked on irc:
is there a particular reason why not to have the ghc compiler in the path as well?
The reason GHC isn't on the path is that it's a pain to have the code keep track of two different compiler versions. For most things it works great to only have GHCJS, but that's a good point - this isn't the case for build tools
> stack --version
Version 0.1.7.0, Git revision 193b285e0dc8fd705a7d2475e5a57bb15f4a9990 (2453 commits) x86_64Note that the cause is that the setup script for happy hardcodes GHC. Other than a circumstance like that GHCJS builds should /not/ demand a GHC. However, given that cases like this exist, I could be persuaded to have it put the matching GHC on the path if it exists.
As my other comment suggests, it could also be that we want to default to using GHC for arbitrary build-tool dependencies. I'm not sure if GHCJS could build a working happy.
@mgsloan So what actually is the workaround? I'm trying to setup GHCJS for some researching, but stack build fails when trying to build happy with the same error you described. How do I correctly set the path for GHC so happy can compile?
I've added a GHC to my PATH (at the end of the PATH). It's a ugly hack but it seems to work.
export PATH=$PATH:$HOME/.stack/programs/x86_64-linux/ghc-7.10.3/bin
We should send patches to happy maintainers since this is a (not) happy bug
I use
export OLDPATH=$PATH
alias stackjs='stack --stack-yaml stack-ghcjs.yaml'
alias stack7='stack --stack-yaml stack.yaml'
stack7 setup
stack7 install alex happy hscolour
PATH=`stack7 path --bin-path 2>/dev/null`:$OLDPATH
echo SETUP
stackjs setuphttps://github.com/tolysz/spock-ghcjs-sample/blob/master/build-lts.sh
And it works fine on any global ghc'less systems
The next version of Stack will no longer have GHCJS support, closing.