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

happy can't be installed from a sandbox #4593

Closed
sol opened this issue Jul 7, 2017 · 8 comments
Closed

happy can't be installed from a sandbox #4593

sol opened this issue Jul 7, 2017 · 8 comments

Comments

@sol
Copy link
Member

sol commented Jul 7, 2017

Steps to reproduce:

$ cabal unpack happy && cd happy-* && cabal sandbox init && cabal install --prefix ~/.bin
Unpacking to happy-1.19.5/
Writing a default package environment file to
/home/sol/sandbox/haskell/happy-1.19.5/cabal.sandbox.config
Creating a new sandbox at
/home/sol/sandbox/haskell/happy-1.19.5/.cabal-sandbox
Resolving dependencies...
Notice: installing into a sandbox located at
/home/sol/sandbox/haskell/happy-1.19.5/.cabal-sandbox
Configuring mtl-2.2.1...
Building mtl-2.2.1...
Installed mtl-2.2.1
Configuring happy-1.19.5...
Building happy-1.19.5...
Failed to install happy-1.19.5
Build log ( /home/sol/sandbox/haskell/happy-1.19.5/.cabal-sandbox/logs/happy-1.19.5.log ):
cabal: Entering directory '.'
[1 of 1] Compiling Main             ( dist/dist-sandbox-8adab01b/setup/setup.hs, dist/dist-sandbox-8adab01b/setup/Main.o )
Linking ./dist/dist-sandbox-8adab01b/setup/setup ...
Configuring happy-1.19.5...
Building happy-1.19.5...
Preprocessing executable 'happy' for happy-1.19.5...
setup: The program 'happy' is required but it could not be found
cabal: Leaving directory '.'
cabal: Error: some packages failed to install:
happy-1.19.5 failed during the building phase. The exception was:
ExitFailure 1
@23Skidoo
Copy link
Member

23Skidoo commented Jul 7, 2017

Looks like a duplicate of #4574.

@sol
Copy link
Member Author

sol commented Jul 7, 2017

@23Skidoo I guess kind of. #4574 has a different error message (specifically, I assume the data files for happy are missing). In my case, I don't have happy at all. Anyhow, the bug boils down to:

  • Cabal tries to generate AttrGrammarParser.hs and Parser.hs, even though they are already present in dist/.

I think in general this even makes sense, and with that sentiment you could call this a "bug" in happy.

The surprising/buggy thing is that Cabal behaves different within/outside of a sandbox.

sol added a commit to sol/tinc that referenced this issue Jul 7, 2017
@p-alik
Copy link

p-alik commented Jul 7, 2017

I think in general this even makes sense, and with that sentiment you could call this a "bug" in happy.

see https://mail.haskell.org/pipermail/haskell-cafe/2017-June/127358.html for the happy-1.19.5 topic

@23Skidoo
Copy link
Member

23Skidoo commented Jul 7, 2017

@p-alik I think that's an unrelated issue.

@hvr
Copy link
Member

hvr commented Jul 7, 2017

This sounds related to the conceptual problem with happy I described in haskell/happy#88 (comment) - the circular build-tool dependency on itself; I've shortly talked to @simonmar whether at some point we could get rid of it by changing the way the packaging works - to be continued

@simonmar
Copy link
Member

I object somewhat to this being described as a "conceptual problem with Happy"! The way this was supposed to work was that cabal sdist would include the generated source files in the package, and cabal install would use them. Happy deliberately doesn't declare a dependency on itself in the .cabal file, because it is supposed to build without needing itself installed. This sort of worked with cabal install, but broke with sandboxes and new-build. I've opened issues around the flakiness of this in the past, e.g.: #2940

However, it's been broken for quite a while and in the interests of making stuff work for people I've gone ahead and checked in the generated source files: haskell/happy@ea3c22d

@hvr
Copy link
Member

hvr commented Jul 13, 2017

@simonmar Alright, the main problem is that the sdist tarball contains the generated Parser.hs file in a folder that isn't mentioned in the respective component's hs-source-dirs. How would you specify Cabal shall behave here?

@phadej
Copy link
Collaborator

phadej commented Aug 31, 2020

sandbox functionality is removed.

@phadej phadej closed this as completed Aug 31, 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

6 participants