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 doesn't build happy #1427

Closed
ndmitchell opened this issue Nov 25, 2015 · 8 comments
Closed

stack doesn't build happy #1427

ndmitchell opened this issue Nov 25, 2015 · 8 comments
Assignees
Milestone

Comments

@ndmitchell
Copy link
Contributor

As per https://ci.appveyor.com/project/ndmitchell/hlint/build/1.0.51, I am building haskell-src-exts, and that has a build-tool of happy, but cabal says:

setup-Simple-Cabal-1.22.4.0-i386-windows-ghc-7.10.2.exe: The program 'happy'
version >=1.19 is required but it could not be found.

It seems happy is no longer being automatically installed, as I can't find any logs for building happy. Or is happy installed from binary? If so, does the PATH need adjusting to find it?

@ndmitchell
Copy link
Contributor Author

BTW, this used to work, so is either a regression, or a change in my build script that breaks it (but I think stack should be doing it for me, meaning I couldn't break it).

@mgsloan
Copy link
Contributor

mgsloan commented Nov 26, 2015

Hmm, strange! Could be related to #1366 (comment)

For me, it built and installed happy when I did

  • stack init --resolver lts-3.15
  • Added haskell-src-exts-1.17.0 to extra-deps
  • stack build

@ndmitchell
Copy link
Contributor Author

On my Windows system I did where happy, renamed them all to -happy.exe, did stack upgrade --git, then in a checkout of haskell-src-exts I did stack init --solver then stack build. Stack didn't try and build happy, and died with the same error messages I got above. This is reproducing on an entirely different machine to the Appveyor one, so it seems to reproduce, at the very least on Windows.

@mgsloan, are you sure you didn't already have happy on your PATH? Or perhaps you already had haskell-src-exts compiled and just copied it this time?

@ndmitchell
Copy link
Contributor Author

For info, I believe this is a regression, because this was the first thing I ever tried with stack (as it answers a long-standing hlint issue), and it worked back then.

@yamafaktory
Copy link

Get the same issue (happy is required but not found) when trying to compile some simple examples with reflex and GHCJS. Did a stack upgrade --git before too.

@borsboom borsboom self-assigned this Dec 14, 2015
@borsboom
Copy link
Contributor

It looks like this is related to the resolver. When a nightly or lts resolver is used, happy does get installed. However, when a the ghc resolver is used, it does not get installed (and adding happy to the extra-deps doesn't help).

@borsboom
Copy link
Contributor

The crux of the problem appears to be here, including the comment:

    -- TODO Currently, this will only consider and install tools from the
    -- snapshot. It will not automatically install build tools from extra-deps
    -- or local packages.
    toolMap = getToolMap mbp0

@snoyberg, since that TODO is yours, do you have any thoughts? Would it make sense to add extra-deps or local packages to the MiniBuildPlan (I'm not sure where else that's used), or would it be better to find another way to pass that info into getToolMap?

Aside from that, for @ndmitchell's use case, we'd also need to have stack init --solver add happy to the extra-deps.

@borsboom
Copy link
Contributor

This appears to be a duplicate of #595.

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

4 participants