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

Build errors of happy 1.19.8 on GHC 8.4.1-alpha1 #113

Closed
asr opened this issue Jan 12, 2018 · 6 comments
Closed

Build errors of happy 1.19.8 on GHC 8.4.1-alpha1 #113

asr opened this issue Jan 12, 2018 · 6 comments

Comments

@asr
Copy link
Contributor

asr commented Jan 12, 2018

GHC 8.4.1-alpha1 was announced. While testing Agda with this version of GHC, I got errors like this one:

$ cabal install
...
Building executable 'happy' for happy-1.19.8..
...
[15 of 19] Compiling PrettyGrammar    ( src/PrettyGrammar.hs, dist/dist-sandbox-12f2e1a5/build/happy/happy-tmp/PrettyGrammar.o )

src/PrettyGrammar.hs:34:28: error:
    Ambiguous occurrence ‘<>’
    It could refer to either ‘Prelude.<>’,
                             imported from ‘Prelude’ at src/PrettyGrammar.hs:1:8-20
                             (and originally defined in ‘GHC.Base’)
                          or ‘PrettyGrammar.<>’, defined at src/PrettyGrammar.hs:68:9
   |
34 | ppTerm (App x ts) = text x <> ppTuple (map ppTerm ts)
   |                            ^^

Since the upstream version (master branch, commit 8e4dc43) compiles with GHC 8.4.1-alpha1, could you make a release, please?

Blocking agda/agda#2878.

@deepfire
Copy link

deepfire commented Jan 15, 2018

Interestingly, when I try to build a newer version from git (but not from a Hackage release), Cabal seems to think that happy needs happy:

nix-build packages.nix -A happy --argstr compiler ghcHEAD --show-trace --cores 0 --keep-failed
these derivations will be built:
  /nix/store/4sr8f83hl40g0v99xxlrs4rib03n7sx7-happy-1.19.8.drv
building path(s) ‘/nix/store/2grlz2qgcl6h7nhi686lfb8h7xjn0bf9-happy-1.19.8’
setupCompilerEnvironmentPhase
Build with /nix/store/sprynaklr66848acrrp85mygn8wb1jxs-ghc-8.4.20180108.
unpacking sources
unpacking source archive /nix/store/9ag89vh38cx4xbjc880gk8a2cjhadxy5-happy-5ee44ae
source root is happy-5ee44ae
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/tmp/nix-build-happy-1.19.8.drv-0/package.conf.d -j8 -threaded
[1 of 1] Compiling Main             ( Setup.lhs, /tmp/nix-build-happy-1.19.8.drv-0/Main.o )

Setup.lhs:48:22: warning: [-Wdeprecations]
    In the use of ‘rawSystemProgramConf’
    (imported from Distribution.Simple.Program):
    Deprecated: "use runDbProgram instead"
   |
48 |   let runProgram p = rawSystemProgramConf (fromFlagOrDefault normal (buildVerbosity flags))
   |                      ^^^^^^^^^^^^^^^^^^^^
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/2grlz2qgcl6h7nhi686lfb8h7xjn0bf9-happy-1.19.8 --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --with-gcc=gcc --package-db=/tmp/nix-build-happy-1.19.8.drv-0/package.conf.d --ghc-option=-optl=-Wl,-rpath=/nix/store/2grlz2qgcl6h7nhi686lfb8h7xjn0bf9-happy-1.19.8/lib/ghc-8.4.20180108/happy-1.19.8 --ghc-option=-j8 --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-library-vanilla --enable-executable-dynamic --disable-tests --ghc-option=-split-sections
Using Parsec parser
Configuring happy-1.19.8...
Flags chosen: small_base=True
Dependency array -any: using array-0.5.2.0
Dependency base <5: using base-4.11.0.0
Dependency containers >=0.4.2: using containers-0.5.10.2
Dependency mtl >=2.2.1: using mtl-2.2.2
Source component graph: component exe:happy
Configured component graph:
    component happy-1.19.8-7ensv29swlI8cuXvlwmmF0-happy
        include base-4.11.0.0
        include array-0.5.2.0
        include containers-0.5.10.2
        include mtl-2.2.2
Linked component graph:
    unit happy-1.19.8-7ensv29swlI8cuXvlwmmF0-happy
        include base-4.11.0.0
        include array-0.5.2.0
        include containers-0.5.10.2
        include mtl-2.2.2
Ready component graph:
    definite happy-1.19.8-7ensv29swlI8cuXvlwmmF0-happy
        depends base-4.11.0.0
        depends array-0.5.2.0
        depends containers-0.5.10.2
        depends mtl-2.2.2
Using Cabal-2.1.0.0 compiled by ghc-8.4
Using compiler: ghc-8.4.20180108
Using install prefix: /nix/store/2grlz2qgcl6h7nhi686lfb8h7xjn0bf9-happy-1.19.8
Executables installed in:
/nix/store/2grlz2qgcl6h7nhi686lfb8h7xjn0bf9-happy-1.19.8/bin
Libraries installed in:
/nix/store/2grlz2qgcl6h7nhi686lfb8h7xjn0bf9-happy-1.19.8/lib/ghc-8.4.20180108/happy-1.19.8
Dynamic Libraries installed in:
/nix/store/2grlz2qgcl6h7nhi686lfb8h7xjn0bf9-happy-1.19.8/lib/ghc-8.4.20180108/x86_64-linux-ghc-8.4.20180108
Private executables installed in:
/nix/store/2grlz2qgcl6h7nhi686lfb8h7xjn0bf9-happy-1.19.8/libexec/x86_64-linux-ghc-8.4.20180108/happy-1.19.8
Data files installed in:
/nix/store/2grlz2qgcl6h7nhi686lfb8h7xjn0bf9-happy-1.19.8/share/x86_64-linux-ghc-8.4.20180108/happy-1.19.8
Documentation installed in:
/nix/store/2grlz2qgcl6h7nhi686lfb8h7xjn0bf9-happy-1.19.8/share/doc/x86_64-linux-ghc-8.4.20180108/happy-1.19.8
Configuration files installed in:
/nix/store/2grlz2qgcl6h7nhi686lfb8h7xjn0bf9-happy-1.19.8/etc
No alex found
Using ar found on system at:
/nix/store/wxn5gn8amxm1w0ikcx4gbs8a17wvss4j-binutils-2.28.1/bin/ar
No c2hs found
No cpphs found
No doctest found
Using gcc version 6.4.0 given by user at:
/nix/store/i9kmd5fpay17n2dfxzy3nx4pz98qb00a-gcc-wrapper-6.4.0/bin/gcc
Using ghc version 8.4.20180108 found on system at:
/nix/store/sprynaklr66848acrrp85mygn8wb1jxs-ghc-8.4.20180108/bin/ghc
Using ghc-pkg version 8.4.20180108 found on system at:
/nix/store/sprynaklr66848acrrp85mygn8wb1jxs-ghc-8.4.20180108/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.18.2 found on system at:
/nix/store/sprynaklr66848acrrp85mygn8wb1jxs-ghc-8.4.20180108/bin/haddock
No happy found
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.67 found on system at:
/nix/store/sprynaklr66848acrrp85mygn8wb1jxs-ghc-8.4.20180108/bin/hpc
Using hsc2hs version 0.68.3 found on system at:
/nix/store/sprynaklr66848acrrp85mygn8wb1jxs-ghc-8.4.20180108/bin/hsc2hs
No hscolour found
No jhc found
Using ld found on system at:
/nix/store/i9kmd5fpay17n2dfxzy3nx4pz98qb00a-gcc-wrapper-6.4.0/bin/ld
No lhc found
No lhc-pkg found
No pkg-config found
Using runghc version 8.4.20180108 found on system at:
/nix/store/sprynaklr66848acrrp85mygn8wb1jxs-ghc-8.4.20180108/bin/runghc
Using strip version 2.28 found on system at:
/nix/store/wxn5gn8amxm1w0ikcx4gbs8a17wvss4j-binutils-2.28.1/bin/strip
Using tar found on system at:
/nix/store/yph5q0shcy0x524c2088dpqbprdfbzjz-gnutar-1.30/bin/tar
No uhc found
building
Preprocessing executable 'happy' for happy-1.19.8..
Setup: The program 'happy' is required but it could not be found

note: keeping build directory ‘/tmp/nix-build-happy-1.19.8.drv-1’
builder for ‘/nix/store/4sr8f83hl40g0v99xxlrs4rib03n7sx7-happy-1.19.8.drv’ failed with exit code 1

Looks like a Cabal v2 thing to me..

..and indeed: haskell/cabal#4009 -- although it was fixed, or was it?

@asr
Copy link
Contributor Author

asr commented Jan 15, 2018

Interestingly, when I try to build a newer version from git (but not from a Hackage release), Cabal seems to think that happy needs happy

I'm getting the same behaviour on Ubuntu, that is, I can install from Hackage but I cannot install the upstream version on GitHub:

$ cabal install
...
Preprocessing executable 'happy' for happy-1.19.8..
setup: The program 'happy' is required but it could not be found
Failed to install happy-1.19.8

Tested with GHC 8.2.2 and

$ cabal --version
cabal-install version 2.0.0.1
compiled using version 2.0.1.0 of the Cabal library

@deepfire
Copy link

deepfire commented Jan 16, 2018

The solution was to:

rm -f src/AttrGrammarParser.ly src/Parser.ly tests/ParGF.yg

..and the build lived happily thereafter!

Apparently, Cabal sees the files, and makes the right (or wrong, PoV-dependent) deductions from that..

@asr
Copy link
Contributor Author

asr commented Jan 16, 2018

I guess you meant

rm -f src/AttrGrammarParser.ly src/Parser.ly

Anyway, it seems we found again a known situation (see, for example, #88).

@simonmar
Copy link
Member

simonmar commented Feb 4, 2018

To build a Happy tarball that bootstraps without needing Happy installed, you should make sdist from the top of the happy source tree.

@simonmar
Copy link
Member

simonmar commented Feb 4, 2018

Happy 1.19.9 released

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

3 participants