haskell / cabal

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

Default cabal.project in cabal repo fails with cabal-install older than latest release; hard to diagnose #8133

Open Mikolaj opened 2 years ago

Mikolaj commented 2 years ago

Our default project file is confusing to newbies with an older cabal-install installed. In particular, the file has tests enabled, but cabal-testsuite apparently requires cabal-install >= 3.6 to compile (Custom setup, sigh), which is not stated in any obvious place the newbie would look at and the compilation errors are opaque. I'm being told @ezyang may be the last person alive to know why the tests need a new cabal to compile and how we'd get around to simplifying their compilation.

To be fair, in README we say to use cabal install --project-file=cabal.project.release cabal-install. However, I think, at least another warning in the default project file would be needed or commenting out the test suite, with an explanation, or perhaps even kill the project file, though the -fno-ignore-asserts are useful and also a newbie with Tests: True in the global config file would be bitten just as before.

OTOH, if cabal devs just do cabal build and so the project file is supposed to be the perfect default for them, we should not make life harder for them, e.g., by disabling the testsuite. But if so, it's worth mentioning somewhere (is it?), or new cabal devs may be usure whether to follow the readme, or use the default cabal.project.

ezyang commented 2 years ago

https://github.com/haskell/cabal/tree/master/cabal-testsuite#design-notes explains it

Mikolaj commented 2 years ago

Thank you! Oh dear, this is a real tour the force. I hoped the novelties in 3.6 and 3.8 (or perhaps the improved cabal scripts?) could help us get rid of the Custom setup, but I'm no longer sure. Still, for anybody interested in tackling the hard core of this issue, identifying what is missing to get rid of the Custom setup (and perhaps opening tickets for that) would be a very valuable step forward.

andreabedini commented 1 year ago

@Mikolaj is this still relevant? I arrive here from this comment https://github.com/haskell/cabal/blob/eaa5245ef4949a9f02a82c7e225ab11cc64bba85/.github/workflows/validate.yml#L226

Mikolaj commented 1 year ago

@andreabedini: I think this is still true (though we might be getting away with slightly older cabals, but it's risky) and, if not, we should change https://github.com/haskell/cabal/tree/master/cabal-testsuite#design-notes.

andreabedini commented 12 months ago

@Mikolaj note that haskell/cabal#9463 removes this comment, maybe we should keep it then. I have to say I don't understand the situation well.

Mikolaj commented 12 months ago

@andreabedini: indeed, even if the comment is outdated (I can't be sure), the link to the issue is valuable in case this fails again for the same or different reasons.

ulysses4ever commented 11 months ago

I put back latest and the reference to this issue in #9330.

andreabedini commented 11 months ago

Can we reproduce this problem at least? I admit I have not tried.

geekosaur commented 3 weeks ago

I would like to note that build-alpine has that comment but every other build uses 3.12.1.0 with a link to #10251.