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

cabal build does not work, despite having happy-1.20 in PATH #262

Closed
sgraf812 opened this issue Jan 21, 2024 · 6 comments
Closed

cabal build does not work, despite having happy-1.20 in PATH #262

sgraf812 opened this issue Jan 21, 2024 · 6 comments

Comments

@sgraf812
Copy link
Collaborator

Here's a log of my attempt to build happy on abcd8c0:

$ cabal --version
cabal-install version 3.10.2.1
compiled using version 3.10.2.1 of the Cabal library
$ cabal build
Resolving dependencies...
Build profile: -w ghc-9.4.7 -O1
In order, the following will be built (use -v for more details):
 - happy-codegen-common-2.0 (lib) (first run)
 - happy-grammar-2.0 (lib) (first run)
 - happy-tabular-2.0 (lib) (first run)
 - happy-frontend-2.0 (lib) (first run)
 - happy-backend-lalr-2.0 (lib) (first run)
 - happy-backend-glr-2.0 (lib) (first run)
 - happy-2.0 (exe:happy) (first run)
Configuring library for happy-codegen-common-2.0..
Configuring library for happy-grammar-2.0..
Preprocessing library for happy-grammar-2.0..
Building library for happy-grammar-2.0..
Preprocessing library for happy-codegen-common-2.0..
Building library for happy-codegen-common-2.0..
[1 of 1] Compiling Happy.Grammar    ( src/Happy/Grammar.lhs, /evo/code/hs/happy/dist-newstyle/build/x86_64-linux/ghc-9.4.7/happy-grammar-2.0/build/Happy/Grammar.o, /evo/code/hs/happy/dist-newstyle/build/x86_64-linux/ghc-9.4.7/happy-grammar-2.0/build/Happy/Grammar.dyn_o )
[1 of 1] Compiling Happy.CodeGen.Common.Options ( src/Happy/CodeGen/Common/Options.lhs, /evo/code/hs/happy/dist-newstyle/build/x86_64-linux/ghc-9.4.7/happy-codegen-common-2.0/build/Happy/CodeGen/Common/Options.o, /evo/code/hs/happy/dist-newstyle/build/x86_64-linux/ghc-9.4.7/happy-codegen-common-2.0/build/Happy/CodeGen/Common/Options.dyn_o )
Configuring library for happy-tabular-2.0..
Configuring library for happy-frontend-2.0..
Preprocessing library for happy-tabular-2.0..
Building library for happy-tabular-2.0..
Preprocessing library for happy-frontend-2.0..
happy: /evo/code/hs/happy/././HappyTemplate-arrays-coerce: openFile: does not exist (No such file or directory)
[1 of 5] Compiling Happy.Tabular.NameSet ( src/Happy/Tabular/NameSet.hs, /evo/code/hs/happy/dist-newstyle/build/x86_64-linux/ghc-9.4.7/happy-tabular-2.0/build/Happy/Tabular/NameSet.o, /evo/code/hs/happy/dist-newstyle/build/x86_64-linux/ghc-9.4.7/happy-tabular-2.0/build/Happy/Tabular/NameSet.dyn_o )
[2 of 5] Compiling Happy.Tabular.First ( src/Happy/Tabular/First.lhs, /evo/code/hs/happy/dist-newstyle/build/x86_64-linux/ghc-9.4.7/happy-tabular-2.0/build/Happy/Tabular/First.o, /evo/code/hs/happy/dist-newstyle/build/x86_64-linux/ghc-9.4.7/happy-tabular-2.0/build/Happy/Tabular/First.dyn_o )
[3 of 5] Compiling Happy.Tabular.LALR ( src/Happy/Tabular/LALR.lhs, /evo/code/hs/happy/dist-newstyle/build/x86_64-linux/ghc-9.4.7/happy-tabular-2.0/build/Happy/Tabular/LALR.o, /evo/code/hs/happy/dist-newstyle/build/x86_64-linux/ghc-9.4.7/happy-tabular-2.0/build/Happy/Tabular/LALR.dyn_o )

src/Happy/Tabular/LALR.lhs:290:9: warning: [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a pattern binding:
        Patterns of type ‘(Int, [[(Name, Int)]],
                           [Set Lr0Item])’ not matched:
            (_, [], _)
            (_, ((_:_):_), _)
    |
290 | >       (_, ([]:intgotos), newNewSets) =
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

src/Happy/Tabular/LALR.lhs:438:12: warning: [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a lambda abstraction:
        Patterns of type ‘[((Int, Lr0Item), NameSet.IntSet)]’ not matched:
            []
    |
438 | >     map (\cs@(((a,b),_):_) -> (a,b,NameSet.unions $ map snd cs)) .
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[4 of 5] Compiling Happy.Tabular.Info ( src/Happy/Tabular/Info.lhs, /evo/code/hs/happy/dist-newstyle/build/x86_64-linux/ghc-9.4.7/happy-tabular-2.0/build/Happy/Tabular/Info.o, /evo/code/hs/happy/dist-newstyle/build/x86_64-linux/ghc-9.4.7/happy-tabular-2.0/build/Happy/Tabular/Info.dyn_o )
[5 of 5] Compiling Happy.Tabular    ( src/Happy/Tabular.lhs, /evo/code/hs/happy/dist-newstyle/build/x86_64-linux/ghc-9.4.7/happy-tabular-2.0/build/Happy/Tabular.o, /evo/code/hs/happy/dist-newstyle/build/x86_64-linux/ghc-9.4.7/happy-tabular-2.0/build/Happy/Tabular.dyn_o )
Error: cabal: Failed to build happy-frontend-2.0 (which is required by
exe:happy from happy-2.0).

According to https://haskell-happy.readthedocs.io/en/latest/contributing.html#build-instructions, this should just work.
Apparently the build has trouble finding a generated file, /evo/code/hs/happy/././HappyTemplate-arrays-coerce. Perhaps it is looking in the wrong path, but fd -uup doesn't turn it up either.

@sgraf812
Copy link
Collaborator Author

sgraf812 commented Jan 21, 2024

$ runghc bootstraph.sh worked for me, but I don't see it documented (yet?). Also it pollutes git status.

@int-index
Copy link
Collaborator

I can't reproduce this locally. The build succeeds for me. Are you sure it's a fresh clone of the repo?

@int-index
Copy link
Collaborator

despite having happy-1.20 in PATH

Actually, it sounds like your happy in PATH was not installed correctly. You'd probably see a similar error trying to build other projects with it.

@sgraf812
Copy link
Collaborator Author

sgraf812 commented Feb 4, 2024

How strange. It works if I start a clean build in a nix-shell --pure -p ghc cabal-install happy. Nevermind then, sorry for the noise.

@sgraf812
Copy link
Collaborator Author

sgraf812 commented Jun 6, 2024

Actually I must take that back. Perhaps I didn't read it right back in Feb or perhaps I tried it on another machine. This is on Ubuntu 22.04:

$ nix-shell --pure -p ghc cabal-install happy
...
$ cabal build
...
[5 of 5] Compiling Happy.Tabular    ( src/Happy/Tabular.lhs, /evo/code/hs/happy/dist-newstyle/build/x86_64-linux/ghc-9.4.8/happy-tabular-2.0/build/Happy/Tabular.o, /evo/code/hs/happy/dist-newstyle/build/x86_64-linux/ghc-9.4.8/happy-tabular-2.0/build/Happy/Tabular.dyn_o )
Error: cabal: Failed to build happy-frontend-2.0 (which is required by
exe:happy from happy-2.0).

same error as in #274.

@sgraf812
Copy link
Collaborator Author

sgraf812 commented Jun 6, 2024

I will close this issue again in favor of #274, where Vlad already started to diagnose the error.

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

2 participants