cabal
cabal copied to clipboard
Assertion failure on `cabal build/haddock --enable-doc`
Using GHC 9.2.3 and cabal master:
$ cabal haddock --haddock-for-hackage --enable-doc
Warning: this is a debug build of cabal-install with assertions enabled.
Resolving dependencies...
Build profile: -w ghc-9.2.3 -O0
In order, the following will be built (use -v for more details):
- OneTuple-0.3.1 (lib) (requires build)
...
- generically-0.1 (lib) (requires build)
Assertion failed
CallStack (from HasCallStack):
assert, called at src/Distribution/Client/ProjectPlanning.hs:246:5 in cabal-install-3.9.0.0-inplace:Distribution.Client.ProjectPlanning
Also triggered by cabal build --enable-doc.
It is this assertion https://github.com/haskell/cabal/blob/23536274bb7baabe5c33140620471e897cf34cf2/cabal-install/src/Distribution/Client/ProjectPlanning.hs#L242-L248
Here is the packed up directory in which I can reproduce the bug:
cabal-assertion-failed.zip
(I hope it can be reproduced even without my .cabal directory...)
Possibly related: #6659, #6006 and the tickets mentioned in the latter.
Indeed, looks like #6006. The new thing is that even a plain cabal haddock fails, since it includes --enable-documentation by default now.
Could we have a flag --ingore-assertions to force cabal to continue?
Could we have a flag
--ingore-assertionsto forcecabalto continue?
We'd need our own assert, but yes, should not be hard. This is in a dev build with assertions enabled, right? Not 3.8RC1?
This is in a dev build with assertions enabled, right? Not 3.8RC1?
Yes, it is 3.9.0.0.
~~Fail to repro with the current master (dd312ec).~~ It does reproduces still.
Fail to repro with the current
master(dd312ec).
@ulysses4ever : I can reproduce this with latest master and also GHC 9.2.4. Did you unzip my project and tried it there?
I tried to build OneTuple and generically. What is "your project"?
Oh, sorry, now I see it
I have tracked down the failure to the setDocumentation function in pruneInstallPlanPass1.
The essential issue is that pruneInstallPlanPass1 can't modify anything in an elaborated package which affects the hash, and by disabling documentation at this point you affect the hash of the package.