happy icon indicating copy to clipboard operation
happy copied to clipboard

Cabal install fails in sandbox

Open Ongy opened this issue 8 years ago • 6 comments
trafficstars

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

Ongy avatar Jun 25 '17 08:06 Ongy

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.

erikd avatar Jun 25 '17 09:06 erikd

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.

kindaro avatar Jul 27 '18 09:07 kindaro

@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

simonmar avatar Aug 19 '18 09:08 simonmar

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

kindaro avatar Aug 19 '18 10:08 kindaro

@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 avatar Aug 23 '18 18:08 simonmar

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.

simonmar avatar Aug 23 '18 18:08 simonmar