Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"stack build" (ghcjs) fails with "happy" which requires ghc compiler in path #1258

Closed
luigy opened this issue Oct 31, 2015 · 6 comments
Closed

Comments

@luigy
Copy link
Contributor

luigy commented Oct 31, 2015

asked on irc:
is there a particular reason why not to have the ghc compiler in the path as well?

@mgsloan:

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

build log

> stack --version
Version 0.1.7.0, Git revision 193b285e0dc8fd705a7d2475e5a57bb15f4a9990 (2453 commits) x86_64
@mgsloan
Copy link
Contributor

mgsloan commented Mar 11, 2016

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

@tolgap
Copy link

tolgap commented Jun 27, 2016

@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?

@dysinger
Copy link
Contributor

dysinger commented Jun 28, 2016

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

@dysinger
Copy link
Contributor

We should send patches to happy maintainers since this is a (not) happy bug

NCrashed pushed a commit to NCrashed/live-profile-server that referenced this issue Aug 7, 2016
@tolysz
Copy link
Collaborator

tolysz commented Sep 27, 2016

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 setup

https://github.com/tolysz/spock-ghcjs-sample/blob/master/build-lts.sh

And it works fine on any global ghc'less systems

@snoyberg
Copy link
Contributor

snoyberg commented Feb 4, 2020

The next version of Stack will no longer have GHCJS support, closing.

@snoyberg snoyberg closed this as completed Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants