haskell / happy

The Happy parser generator for Haskell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Version 1.21.0: The program 'happy' is required but it could not be found

Mikolaj opened this issue · comments

GHC 8.10.7, cabal 3.4:

Downloading  happy-1.21.0
Downloaded   happy-1.21.0
Starting     happy-1.21.0 (exe:happy)
Building     happy-1.21.0 (exe:happy)

Failed to build exe:happy from happy-1.21.0.
Build log (
/home/mikolaj/.cabal/logs/ghc-8.10.7/happy-1.21.0-e-happy-f90d659122467dc006ae1efb35dcd10f113a0857663940bcc9c74e11a4405a6f.log
):
Configuring executable 'happy' for happy-1.21.0..
Preprocessing executable 'happy' for happy-1.21.0..
cabal-3.4.0.0: The program 'happy' is required but it could not be found

Cabal doesn’t understand bootstrapping, so you’ll need to do it manually.

cabal install happy -f -bootstrap
cabal install happy -f +bootstrap

Then it should work, assuming $HOME/.cabal/bin is in your $PATH.

My numerous CIs will be unamused. But @Ericson2314 is concocting a solution in cabal.project over at #haskell right now, so there is hope...

On my machine cabal build -fbootstrap does not seem to work, even while happy is in the PATH:

$ cabal --version
cabal-install version 3.6.2.0
compiled using version 3.6.2.0 of the Cabal library
$ happy --version
Happy Version 1.20.0 Copyright (c) 1993-1996 Andy Gill, Simon Marlow (c) 1997-2005 Simon Marlow
$ cabal unpack happy-1.21.0
Unpacking to happy-1.21.0/
$ cd happy-1.21.0
$ cabal build
Resolving dependencies...
Build profile: -w ghc-8.10.6 -O1
In order, the following will be built (use -v for more details):
 - happy-1.21.0 (exe:happy) (first run)
Configuring executable 'happy' for happy-1.21.0..
Preprocessing executable 'happy' for happy-1.21.0..
happy: /private/tmp/happy-1.21.0/./data//HappyTemplate-arrays-coerce: openFile: does not exist (No such file or directory)
$ cabal build -fbootstrap
Resolving dependencies...
Build profile: -w ghc-8.10.6 -O1
In order, the following will be built (use -v for more details):
 - happy-1.21.0 (exe:happy) (configuration changed)
Configuring executable 'happy' for happy-1.21.0..
Preprocessing executable 'happy' for happy-1.21.0..
happy: /private/tmp/happy-1.21.0/./data//HappyTemplate-arrays-coerce: openFile: does not exist (No such file or directory)

Could we avoid this flag altogether? What if we declare an internal library (sharing hs-source-dirs with happy executable), which bootstraps from a parser-combination-based implementation (so it is happy stage0) and is used to bootstrap happy proper?

I have deprecated 1.21.0 on Hackage before anyone else's workflows get broken. Sorry for the disturbance.

@Bodigrim That is basically just what we are thinking :). I will try to make a two-exe, single package 1.21.1, and on master right now we are splitting things up so there will be less ugly sharing of source code between two components.

#212 this is my attempt, but now the issue is needing Cabal to understand that happy-boot is to be used.

@Ericson2314, thank you, but my workflow get slightly broken because 1.21.0 appears in Stackage Nightly (commercialhaskell/stackage#6252). I've used workaround with stack install happy :)