Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in 3.12: package system-filepath (with custom Setup) cannot be installed with GHC 8.0 #10379

Open
andreasabel opened this issue Sep 20, 2024 · 7 comments
Labels
build-type: custom re: old Cabal versions Interoperability with old version of the Cabal library re: old GHC versions regression in 3.12 regression on master Regression that is unreleased and needs to be fixed before release

Comments

@andreasabel
Copy link
Member

With cabal-install-3.12.1.0, I can trigger this bug

  • by cabal install -w ghc-8.0.2 system-filepath-0.4.14 (latest version of system-filepath)
  • by getting system-filepathand do a cabal install --lib -w ghc-8.0.2
  • or by getting package acid-state (which depends on system-filepath) and then do a cabal build -w ghc-8.0.2

In the wild: https://github.com/acid-state/acid-state/actions/runs/10947885622/job/30397644524?pr=170#step:17:566
Error is:

setup: Unrecognised flags: lib:system-filepath

With cabal master (3.15), I am getting different errors:

unrecognized 'configure' option `--with-doctest=/Users/abel/.cabal/bin/doctest'

unrecognized 'configure' option `--with-runghc=/usr/local/bin/runghc-8.0.2'

None of the mentioned errors occur with -w ghc-8.2.2 (or any higher GHC major version).

If I have to guess, then it is not really the GHC version that matters here but the version of the Cabal library that the Setup.hs is built with. (But I could be on the wrong track.)

  • GHC 8.0 comes with Cabal-1.24
  • GHC 8.2 comes with Cabal-2.0

So, was support for Cabal-1.24 (silently or by accident) dropped in cabal-install-3.12? (Couldn't find it in https://github.com/haskell/cabal/blob/982fb820991e0b29228243ad6dbee23c11adde1d/release-notes/cabal-install-3.12.1.0.md)

A parallel to such unwanted compatibility drop is

Should cabal-install explicitly refuse to work with Cabal < 2?

@andreasabel andreasabel added build-type: custom regression in 3.12 re: old Cabal versions Interoperability with old version of the Cabal library labels Sep 20, 2024
@geekosaur
Copy link
Collaborator

8.0.2 is still in the validate-old-ghcs job and seems to pass. (7.x is gone, mostly because we can't install it via ghcup; while it has 7.10.3, the installer segfaults on Ubuntu.)

There should have been an entry in the changelog about ghcs outside the support window being dropped, per #9722. But it seems @mpickering broke the rules (this requires a changelog entry) and none of us caught it during review, sorry.

@andreasabel
Copy link
Member Author

andreasabel commented Sep 20, 2024

8.0.2 is still in the validate-old-ghcs job and seems to pass.

But does this suite cover installing custom-setup packages with old versions of Cabal?

There should have been an entry in the changelog about ghcs outside the support window being dropped,

The lack of changelog suggests that this drop was maybe unintended.
But what is more important than a changelog entry is a warning/error that cabal-install emits in such situations.

Maybe this table needs to be edited (or something in the proximity of it):

setupMinCabalVersionConstraint
| isGHC, compVer >= mkVersion [9, 10] = mkVersion [3, 12]
| isGHC, compVer >= mkVersion [9, 6] = mkVersion [3, 10]
| isGHC, compVer >= mkVersion [9, 4] = mkVersion [3, 8]
| isGHC, compVer >= mkVersion [9, 2] = mkVersion [3, 6]
| isGHC, compVer >= mkVersion [9, 0] = mkVersion [3, 4]
| isGHC, compVer >= mkVersion [8, 10] = mkVersion [3, 2]
| isGHC, compVer >= mkVersion [8, 8] = mkVersion [3, 0]
| isGHC, compVer >= mkVersion [8, 6] = mkVersion [2, 4]
| isGHC, compVer >= mkVersion [8, 4] = mkVersion [2, 2]
| isGHC, compVer >= mkVersion [8, 2] = mkVersion [2, 0]
| isGHC, compVer >= mkVersion [8, 0] = mkVersion [1, 24]
| isGHC, compVer >= mkVersion [7, 10] = mkVersion [1, 22]
| otherwise = mkVersion [1, 20]

Related is also:

@geekosaur
Copy link
Collaborator

It's supposed to still be supported; this sounds like a case validate-old-ghcs isn't testing. (We don't run a full validate on them, and even if we did we may not have a test for this failure mode.)

@andreasabel
Copy link
Member Author

Here is another instance when trying to build HTTP with ghc-8.0.2: https://github.com/haskell/HTTP/actions/runs/10947125731/job/30395160142#step:17:206

Failed to build entropy-0.4.1.10 (which is required by pureMD5-2.1.4). See the build log above for details.
...
setup: Unrecognised flags: lib:entropy

andreasabel added a commit to haskell/HTTP that referenced this issue Sep 20, 2024
@andreasabel
Copy link
Member Author

andreasabel commented Sep 22, 2024

The error

setup: Unrecognised flags: lib:entropy

suggests that the target syntax "lib:FOO" isn't understood by the generated setup.
Internal libraries entered Cabal in version 2.0:

So one hypothesis is that cabal-install-3.12, when calling the generated setup program, uses a new syntax for targets that became available with Cabal-2.0 together with internal libraries.

What the errors thrown by cabal master concerns,

unrecognized 'configure' option `--with-doctest=/Users/abel/.cabal/bin/doctest'

unrecognized 'configure' option `--with-runghc=/usr/local/bin/runghc-8.0.2'

I could not easily find out when these options were added.

I think these failures deserve some investigation. Adding label "regression on master".

@andreasabel andreasabel added the regression on master Regression that is unreleased and needs to be fixed before release label Sep 22, 2024
@Mikolaj
Copy link
Member

Mikolaj commented Sep 30, 2024

I'm looking at our support window:

cabal/CONTRIBUTING.md

Lines 223 to 224 in 4d298d3

* Our GHC support window is five years for the Cabal library and three
years for cabal-install: that is, the Cabal library must be

and at the 8.0.2 release date of 11th January 2017, which is 7 years ago

https://www.haskell.org/ghc/download_ghc_8_0_2.html

and it seems this is way outside any of our windows (or CONTRIBUTING.md is incomplete).

If that's true, that suggests we have a lot of flexibility tackling this issue. Retroactively editing setupMinCabalVersionConstraint should be fine. If that doesn't improve the error message or accompany it with a good enough explanatory warning, we may try to improve the messages along the lines proposed somewhere in #9917. Or maybe #10395 improves situation here?

We may also want to remove 8.0.2 from old-ghcs CI not to confuse the users that it's fully supported and mention this in the changelog prominently (maybe even edit the old changelog, too).

Should cabal-install explicitly refuse to work with Cabal < 2?

Isn't that too brutal? Doesn't it still work fine in many scenarios?

@andreasabel
Copy link
Member Author

I'm looking at our support window:

If I read this text correctly, it only talks about buildability of Cabal and cabal-install.
It does not say which versions of Cabal (and GHC) the cabal-install tool should support.
Probably this kind of support window should be defined.
The de facto sentence would read:

cabal-install-3.12 officially supports building projects with GHC 8.2 and up. (It might work with older GHC versions in many cases as well.)

Retroactively editing setupMinCabalVersionConstraint should be fine.

This should be tried, maybe it fixes the build, or at least it point to the reason why building is not possible (fingers crossed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-type: custom re: old Cabal versions Interoperability with old version of the Cabal library re: old GHC versions regression in 3.12 regression on master Regression that is unreleased and needs to be fixed before release
Projects
None yet
Development

No branches or pull requests

4 participants