Skip to content

Cabal install fails in sandbox #89

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

Open
Ongy opened this issue Jun 25, 2017 · 6 comments
Open

Cabal install fails in sandbox #89

Ongy opened this issue Jun 25, 2017 · 6 comments

Comments

@Ongy
Copy link

Ongy commented Jun 25, 2017

Trying to build happy I encountered a problem during the cabal install step.

This is on archlinux with ghc 8.0.2 and cabal from recent git HEAD.

Full log, so you can see what I'm doing. The interesting line is probably:

happy: /tmp/happy-1.19.5/.cabal-sandbox/share/x86_64-linux-ghc-8.0.2/happy-1.19.5/HappyTemplate-arrays-coerce: openFile: does not exist (No such file or directory)

  • cabal get happy
    Unpacking to happy-1.19.5/
  • cd happy-1.19.5
  • cabal sandbox init
    Writing a default package environment file to
    /tmp/happy-1.19.5/cabal.sandbox.config
    Creating a new sandbox at /tmp/happy-1.19.5/.cabal-sandbox
  • cabal install --dependencies-only
    Resolving dependencies...
    Notice: installing into a sandbox located at /tmp/happy-1.19.5/.cabal-sandbox
    Configuring mtl-2.2.1...
    Building mtl-2.2.1...
    Installed mtl-2.2.1
  • cabal configure
    Resolving dependencies...
    [1 of 1] Compiling Main ( dist/setup/setup.hs, dist/setup/Main.o )

dist/setup/setup.hs:21:1: warning: [-Wtabs]
Tab character found here, and in 39 further locations.
Please use spaces instead.
Linking ./dist/setup/setup ...
Configuring happy-1.19.5...

  • cabal build
    Building happy-1.19.5...
    Preprocessing executable 'happy' for happy-1.19.5...
    [ 1 of 18] Compiling Target ( src/Target.lhs, dist/build/happy/happy-tmp/Target.o )
    [ 2 of 18] Compiling Paths_happy ( dist/build/autogen/Paths_happy.hs, dist/build/happy/happy-tmp/Paths_happy.o )
    [ 3 of 18] Compiling ParseMonad ( src/ParseMonad.hs, dist/build/happy/happy-tmp/ParseMonad.o )
    [ 4 of 18] Compiling NameSet ( src/NameSet.hs, dist/build/happy/happy-tmp/NameSet.o )
    [ 5 of 18] Compiling Lexer ( src/Lexer.lhs, dist/build/happy/happy-tmp/Lexer.o )
    [ 6 of 18] Compiling GenUtils ( src/GenUtils.lhs, dist/build/happy/happy-tmp/GenUtils.o )
    [ 7 of 18] Compiling AttrGrammar ( src/AttrGrammar.lhs, dist/build/happy/happy-tmp/AttrGrammar.o )
    [ 8 of 18] Compiling AttrGrammarParser ( dist/build/happy/happy-tmp/AttrGrammarParser.hs, dist/build/happy/happy-tmp/AttrGrammarParser.o )
    [ 9 of 18] Compiling AbsSyn ( src/AbsSyn.lhs, dist/build/happy/happy-tmp/AbsSyn.o )
    [10 of 18] Compiling ParamRules ( src/ParamRules.hs, dist/build/happy/happy-tmp/ParamRules.o )

src/ParamRules.hs:5:1: warning: [-Wdeprecations]
Module ‘Control.Monad.Error’ is deprecated:
Use Control.Monad.Except instead

src/ParamRules.hs:6:1: warning: [-Wdeprecations]
Module ‘Control.Monad.Instances’ is deprecated:
This module now contains no instances and will be removed in the future

src/ParamRules.hs:31:17: warning: [-Wdeprecations]
In the use of type constructor or class ‘ErrorT’
(imported from Control.Monad.Error, but defined in transformers-0.5.2.0:Control.Monad.Trans.Error):
Deprecated: "Use Control.Monad.Trans.Except instead"

src/ParamRules.hs:71:10: warning: [-Wdeprecations]
In the use of type constructor or class ‘ErrorT’
(imported from Control.Monad.Error, but defined in transformers-0.5.2.0:Control.Monad.Trans.Error):
Deprecated: "Use Control.Monad.Trans.Except instead"

src/ParamRules.hs:72:27: warning: [-Wdeprecations]
In the use of ‘runErrorT’
(imported from Control.Monad.Error, but defined in transformers-0.5.2.0:Control.Monad.Trans.Error):
Deprecated: "Use Control.Monad.Trans.Except instead"
[11 of 18] Compiling Grammar ( src/Grammar.lhs, dist/build/happy/happy-tmp/Grammar.o )
[12 of 18] Compiling First ( src/First.lhs, dist/build/happy/happy-tmp/First.o )
[13 of 18] Compiling LALR ( src/LALR.lhs, dist/build/happy/happy-tmp/LALR.o )
[14 of 18] Compiling Info ( src/Info.lhs, dist/build/happy/happy-tmp/Info.o )
[15 of 18] Compiling ProduceCode ( src/ProduceCode.lhs, dist/build/happy/happy-tmp/ProduceCode.o )
[16 of 18] Compiling ProduceGLRCode ( src/ProduceGLRCode.lhs, dist/build/happy/happy-tmp/ProduceGLRCode.o )
[17 of 18] Compiling Parser ( dist/build/happy/happy-tmp/Parser.hs, dist/build/happy/happy-tmp/Parser.o )
[18 of 18] Compiling Main ( src/Main.lhs, dist/build/happy/happy-tmp/Main.o )
Linking dist/build/happy/happy ...
++ realpath dist/build/happy

  • export PATH=/tmp/happy-1.19.5/dist/build/happy:/home/ongy/.bin/:/home/ongy/.cabal/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
  • PATH=/tmp/happy-1.19.5/dist/build/happy:/home/ongy/.bin/:/home/ongy/.cabal/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
  • cabal install
    Resolving dependencies...
    Notice: installing into a sandbox located at /tmp/happy-1.19.5/.cabal-sandbox
    Configuring happy-1.19.5...
    Building happy-1.19.5...
    Failed to install happy-1.19.5
    Build log ( /tmp/happy-1.19.5/.cabal-sandbox/logs/ghc-8.0.2/happy-1.19.5-GUPzpM8oSlA9ybE7TUr7pj.log ):
    cabal: Entering directory '.'
    [1 of 1] Compiling Main ( dist/dist-sandbox-661b7d0a/setup/setup.hs, dist/dist-sandbox-661b7d0a/setup/Main.o )
    Linking ./dist/dist-sandbox-661b7d0a/setup/setup ...
    Configuring happy-1.19.5...
    Building happy-1.19.5...
    Preprocessing executable 'happy' for happy-1.19.5...
    happy: /tmp/happy-1.19.5/.cabal-sandbox/share/x86_64-linux-ghc-8.0.2/happy-1.19.5/HappyTemplate-arrays-coerce: openFile: does not exist (No such file or directory)
    cabal: Leaving directory '.'
    cabal: Error: some packages failed to install:
    happy-1.19.5-GUPzpM8oSlA9ybE7TUr7pj failed during the building phase. The
    exception was:
    ExitFailure 1
@erikd
Copy link
Member

erikd commented Jun 25, 2017

I suspect its the git HEAD version of cabal. Works fine for me with cabal version 1.24.0.2.

Probably worth raising this as a bug against cabal though.

simonmar added a commit that referenced this issue Jul 13, 2017
Seems wrong to me, but it's the simplest way to fix issues with cabal
sandboxes and new-build.
@kindaro
Copy link

kindaro commented Jul 27, 2018

I experience the same issue, though with new-build. I use cabal-install 2.3.0.0 and the current happy, cloned right from here just now.

@simonmar
Copy link
Member

@kindaro Happy is non-standard because it is bootstrapped. See the README.md file for instructions on how to build: https://github.com/simonmar/happy/blob/master/README.md

@kindaro
Copy link

kindaro commented Aug 19, 2018

@simonmar   What you are saying is that this package is not going to be handled by new-build?

If there is only one supported way to build, I would humbly suggest to expand the Readme correspondingly, because practically all other packages can be built by several methods (cabal, cabal/new, stack, nix...), and us humans tend to have a preferred build method, so it is best to get explicitly discouraged at an early stage.

Also, the support for the old style commands will get dropped from cabal-install eventually, so at some point some other build method will have to be supported.

P.S. I am sorry if I am being obvious.

@simonmar
Copy link
Member

@simonmar What you are saying is that this package is not going to be handled by new-build?

No, not at all! It works fine with new-build. But you have to build it from the package uploaded to Hackage, not directly from a git checkout. For more details, see the readme.

@simonmar
Copy link
Member

Oh, I got confused between Alex and Happy. Alex is the one with the build instructions in the readme, it looks like we haven't done this for Happy yet. But it should still work to build it from the Hackage package instead of a git clone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants