haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.57k stars 676 forks source link

Package fails to build with cabal-install 3.11 and GHC 8.0.2 where cabal-install 3.10.x worked #10012

Open vmchale opened 2 weeks ago

vmchale commented 2 weeks ago

Describe the bug

The message:

Failed to build pretty-simple-3.3.0.0. The failure occurred during the final
install step.
Build log (
/development/vanessa/.cache/cabal/logs/ghc-8.0.2/pretty-simple-3.3.0.0-42073c1f3a1b0e661504a136c3aa9a9bda480ded70a5d1b8c570f967f5c38d46.log
):
[1 of 1] Compiling Main             ( /home/vanessa/programming/haskell/done/shake-dhall/dist-newstyle/tmp/src-52302/pretty-simple-3.3.0.0/dist/setup/setup.hs, /home/vanessa/programming/haskell/done/shake-dhall/dist-newstyle/tmp/src-52302/pretty-simple-3.3.0.0/dist/setup/Main.o )
Linking /home/vanessa/programming/haskell/done/shake-dhall/dist-newstyle/tmp/src-52302/pretty-simple-3.3.0.0/dist/setup/setup ...
Configuring pretty-simple-3.3.0.0...
Preprocessing library pretty-simple-3.3.0.0...
[1 of 9] Compiling Text.Pretty.Simple.Internal.Output ( src/Text/Pretty/Simple/Internal/Output.hs, dist/build/Text/Pretty/Simple/Internal/Output.o )
[2 of 9] Compiling Text.Pretty.Simple.Internal.Expr ( src/Text/Pretty/Simple/Internal/Expr.hs, dist/build/Text/Pretty/Simple/Internal/Expr.o )
[3 of 9] Compiling Text.Pretty.Simple.Internal.ExprParser ( src/Text/Pretty/Simple/Internal/ExprParser.hs, dist/build/Text/Pretty/Simple/Internal/ExprParser.o )
[4 of 9] Compiling Text.Pretty.Simple.Internal.ExprToOutput ( src/Text/Pretty/Simple/Internal/ExprToOutput.hs, dist/build/Text/Pretty/Simple/Internal/ExprToOutput.o )
[5 of 9] Compiling Text.Pretty.Simple.Internal.Color ( src/Text/Pretty/Simple/Internal/Color.hs, dist/build/Text/Pretty/Simple/Internal/Color.o )
[6 of 9] Compiling Text.Pretty.Simple.Internal.OutputPrinter ( src/Text/Pretty/Simple/Internal/OutputPrinter.hs, dist/build/Text/Pretty/Simple/Internal/OutputPrinter.o )
[7 of 9] Compiling Text.Pretty.Simple.Internal ( src/Text/Pretty/Simple/Internal.hs, dist/build/Text/Pretty/Simple/Internal.o )
[8 of 9] Compiling Text.Pretty.Simple ( src/Text/Pretty/Simple.hs, dist/build/Text/Pretty/Simple.o )
[9 of 9] Compiling Debug.Pretty.Simple ( src/Debug/Pretty/Simple.hs, dist/build/Debug/Pretty/Simple.o )
setup: Unrecognised flags: lib:pretty-simple

To Reproduce

It arose in my shake-dhall repo:

$ cabal build -w ghc-8.0.2

Expected behavior

It should build and behave as Cabal 3.10.x

System information

philderbeast commented 2 weeks ago

I can reproduce this locally using the latest cabal-install;

$ git rev-parse HEAD
03d98294e1c071be368f04dbe6fc9cb263bea86d

$ cabal install cabal-install:exe:cabal --overwrite-policy=always

$ cabal build all --enable-tests --enable-benchmarks
Warning: this is a debug build of cabal-install with assertions enabled.
Build profile: -w ghc-8.0.2 -O1
...
setup: Unrecognised flags: lib:pretty-simple
Error: [Cabal-7125]
Failed to build pretty-simple-3.3.0.0 (which is required by test:shake-dhall-test from shake-dhall-0.1.1.3).
ffaf1 commented 2 weeks ago

Note that:

https://github.com/haskell/cabal/blob/03d98294e1c071be368f04dbe6fc9cb263bea86d/release-notes/Cabal-3.12.0.0.md?plain=1#L76-L78

Of course if there is a way to fix this for older GHCs, it is more than welcome @philderbeast !

philderbeast commented 2 weeks ago

Bumping up to ghc-8.2.2, all seems good;

$ cabal build all --enable-tests --enable-benchmarks
Warning: this is a debug build of cabal-install with assertions enabled.
Resolving dependencies...
Build profile: -w ghc-8.2.2 -O1
In order, the following will be built (use -v for more details):
...
- pretty-simple-3.3.0.0 (lib:pretty-simple) (requires build)
...
Starting     pretty-simple-3.3.0.0 (all, legacy fallback: build-type is Custom)
...
Building library for shake-dhall-0.1.1.3...
[1 of 2] Compiling Dhall.Dep
[2 of 2] Compiling Development.Shake.Dhall
Warning: this is a debug build of cabal-install with assertions enabled.
Warning: this is a debug build of cabal-install with assertions enabled.
Configuring test suite 'shake-dhall-test' for shake-dhall-0.1.1.3...
Warning: this is a debug build of cabal-install with assertions enabled.
Preprocessing test suite 'shake-dhall-test' for shake-dhall-0.1.1.3...
Building test suite 'shake-dhall-test' for shake-dhall-0.1.1.3...
[1 of 1] Compiling Main
Linking dist-newstyle/.../shake-dhall-test ...

$ cabal build all --enable-tests --enable-benchmarks
Warning: this is a debug build of cabal-install with assertions enabled.
Up to date

I reran the command cabal build to get the "Up to date" because I noticed there's no emphatic output saying that the build was successful, nothing like a :+1:

ulysses4ever commented 2 weeks ago

Technically, we should close this as not-planned because it's out of our GHC support window (thanks, Francesco, for noticing!). But it's a curious bug: I wonder what change between 3.10 and 3.12 leads to it.

philderbeast commented 2 weeks ago
setup: Unrecognised flags: lib:pretty-simple
Error: [Cabal-7125]

That's a fairly general failure, "die if not haddock failure".

https://github.com/haskell/cabal/blob/03d98294e1c071be368f04dbe6fc9cb263bea86d/cabal-install/src/Distribution/Client/Errors.hs#L303

philderbeast commented 2 weeks ago

Same set up has no problem building the dependency by itself;

$ cabal get pretty-simple-3.3.0.0
Warning: this is a debug build of cabal-install with assertions enabled.
Unpacking to pretty-simple-3.3.0.0/

$ cd pretty-simple-3.3.0.0/

$ cabal build all --enable-tests --enable-benchmarks
Warning: this is a debug build of cabal-install with assertions enabled.
Resolving dependencies...
Build profile: -w ghc-8.0.2 -O1
...

$ cabal build all --enable-tests --enable-benchmarks
Warning: this is a debug build of cabal-install with assertions enabled.
Resolving dependencies...
Up to date
mpickering commented 2 weeks ago

I think this is because of the Cabal version used rather than the ghc version in particular.

I imagine it's caused by f70fc980dca50e7e62c5e803f56d2ef0c9fc7e18 (also see #9640)