haskell / happy

The Happy parser generator for Haskell
Other
276 stars 85 forks source link

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

Closed Mikolaj closed 2 years ago

Mikolaj commented 2 years ago

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
int-index commented 2 years ago

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.

Mikolaj commented 2 years ago

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

Bodigrim commented 2 years ago

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)
Bodigrim commented 2 years ago

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?

Ericson2314 commented 2 years ago

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

Ericson2314 commented 2 years ago

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

Ericson2314 commented 2 years ago

https://github.com/simonmar/happy/pull/212 this is my attempt, but now the issue is needing Cabal to understand that happy-boot is to be used.

RarogCmex commented 2 years ago

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