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

"The program happy is required but it could not be found" after building happy #157

Closed
DanBurton opened this issue Jun 1, 2015 · 3 comments

Comments

@DanBurton
Copy link
Contributor

From running stack build on the stackage-server repo, lts-2.10.

happy-1.19.5: build: ERROR
Stdout was:
Building happy-1.19.5...
Preprocessing executable 'happy' for happy-1.19.5...

Stderr was:
Setup.lhs: The program happy is required but it could not be found
@snoyberg snoyberg added this to the Second release milestone Jun 2, 2015
@snoyberg snoyberg self-assigned this Jun 2, 2015
@snoyberg
Copy link
Contributor

snoyberg commented Jun 2, 2015

Ugh, what a terribly ugly hack happy uses:

haskell/happy#29

It hard-codes that you're using the dist directory. The only solution to this I can think of is to hard-code a hack that "when you're building happy, manually move the dist directory to the one we're expecting." Either that or "when building happy, don't modify the builddir." Both are equally unpalatable to me.

snoyberg added a commit that referenced this issue Jun 2, 2015
Ugly reasoning here: happy hard-codes that dist will be used by
generating files and including them in the sdist tarball. We don't build
in dist, which causes errors if happy isn't present. This fixes it. See
the issue for more discussion
(#157).
@snoyberg
Copy link
Contributor

snoyberg commented Jun 2, 2015

OK, I opted for the first route. I feel dirty now, but it seems to be working. @DanBurton confirmed?

@DanBurton
Copy link
Contributor Author

Confirmed. Here's how I checked:

  1. set resolver: lts-2.11
  2. stack exec -- happy --version reports that happy doesn't exist on the PATH.
  3. stack build (succeeds)
  4. stack exec -- happy --version now prints a version

Tested on the stackage-server repo again.

@DanBurton DanBurton removed their assignment Jun 9, 2015
wincent added a commit to wincent/docvim that referenced this issue Dec 8, 2020
Seeing an issue like this:

    commercialhaskell/stack#157

Fix from here:

    https://stackoverflow.com/a/39019781

With this, this (ie. building updated Ferret docs) works:

    git clone https://github.com/wincent/docvim.git
    cd docvim
    pacman -S stack happy
    bin/docvim \
        -c ~/.vim/pack/bundle/opt/ferret \
        ~/.vim/pack/bundle/opt/ferret/README.md \
        ~/.vim/pack/bundle/opt/ferret/doc/ferret.txt
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

2 participants