Skip to content

Allow minor Cabal version bumps without recompiling - #12289

Merged
mergify[bot] merged 1 commit into
haskell:masterfrom
sheaf:T11416
Sep 12, 2026
Merged

Allow minor Cabal version bumps without recompiling#12289
mergify[bot] merged 1 commit into
haskell:masterfrom
sheaf:T11416

Conversation

@sheaf

@sheaf sheaf commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Fix for #11416: we now don't store the specific Cabal library version used to provide the Setup CLI, which allows us to re-use an install plan made with another Cabal library version that is still compatible (e.g. across a minor version bump).

No test, as this requires building with two different versions of cabal-install in CI a minor version apart, which seems tricky to achieve. I checked locally and the change does fix the reported reproducer.


Template Α: This PR modifies behaviour or interface


QA notes

We want to ensure that we can do a build, then do a minor version change to cabal-install, then build again, without the error in #11416 and also without recompilation.

Manual QA steps:

  • Create a package with build-type: Simple which has a testsuite component. Any package at all will do.
  • Run cabal test for this package, with the cabal-install built with this patch.
  • Do a minor version bump to cabal-install and its Cabal library and rebuild cabal-install.
  • Re-run cabal test: it should succeed and not cause recompilation.

We now don't store the specific Cabal library version used to provide
the Setup CLI, which allows us to re-use an install plan made with
another Cabal library version that is still compatible (e.g. across a
minor version bump).

Fixes haskell#11416

@Mikolaj Mikolaj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Please set the merge_me label.

@andreasabel andreasabel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been asked to review this PR since I reported the issue.
I am not familiar with the internal workings of Cabal so I cannot comment on the implementation of the solution.
What I could do here is to verify that the test case covers the issue.
But there is no test case included here.

@sheaf

sheaf commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator Author

I have been asked to review this PR since I reported the issue. I am not familiar with the internal workings of Cabal so I cannot comment on the implementation of the solution. What I could do here is to verify that the test case covers the issue. But there is no test case included here.

The problem is that reproducing involves building a package with two different versions of cabal-install, while all of the testsuite framework only works with a single version of cabal-install.

@andreasabel

Copy link
Copy Markdown
Member

The problem is that reproducing involves building a package with two different versions of cabal-install, while all of the testsuite framework only works with a single version of cabal-install.

That's fine. Asking for a new test framework that would cover such cases would be feature creep. So we have to confine ourselves anecdotal testing here (which I trust you have performed).

@ffaf1

ffaf1 commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

The problem is that reproducing involves building a package with two different versions of cabal-install, while all of the testsuite framework only works with a single version of cabal-install.

Yes, those are QA notes.

Is it feasible to add them? That way, other cabal devs could test on their enviroment.

@sheaf

sheaf commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator Author

Is it feasible to add them? That way, other cabal devs could test on their enviroment.

I added QA notes to the OP. Please let me know if what I wrote isn't sufficient.

@ffaf1

ffaf1 commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Many thanks! I ran your instructions and indeed it does not choke as in #11416.

Sadly, this cannot be backported to 3.18 as it breaks API.

@Mikolaj

Mikolaj commented Aug 31, 2026

Copy link
Copy Markdown
Member

@sheaf: Or maybe there's a way to fix this without breaking the API?

@sheaf

sheaf commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator Author

@sheaf: Or maybe there's a way to fix this without breaking the API?

Fundamentally the issue is that, without this patch, cabal-install is serialising to the on-disk cache the exact version of Cabal it was linked against. The fix needs it to stop doing that which changes the binary instance of LocalBuildInfo.

It would be possible to continue to write this information to disk but have some logic to carefully ignore it but that seems worse in terms of maintainability. Given that this is not a regression I don't think it's a huge problem that the fix does not get backported.

@Mikolaj

Mikolaj commented Aug 31, 2026

Copy link
Copy Markdown
Member

@sheaf: thank you. @ffaf1: I support your decision not to backport this one. Let's keep the release note about it, maybe also in Release Notes for 3.18.2.0, and move on. After all, it's not a regression in 3.18 nor even in 3.16, I think.

@sheaf sheaf added merge me Tell Mergify Bot to merge and removed attention: needs-review labels Sep 10, 2026
@mergify mergify Bot added ready and waiting Mergify is waiting out the cooldown period merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days queued labels Sep 10, 2026
@mergify

mergify Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-09-12 09:14 UTC · Rule: default · triggered by rule Put pull requests in the rebase+merge queue
  • Checks passed · on draft merge queue: checking #12289 on master (a7e1439) #12354
  • Merged2026-09-12 11:00 UTC · at bbed2f789436fb32e64e69e0c8a9d2633e747955 · merge

This pull request spent 1 hour 46 minutes 27 seconds in the queue, including 1 hour 34 minutes 55 seconds running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Doctest Cabal
    • check-neutral = Doctest Cabal
    • check-skipped = Doctest Cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Meta checks
    • check-neutral = Meta checks
    • check-skipped = Meta checks
  • any of [🛡 GitHub branch protection]:
    • check-success = docs/readthedocs.org:cabal
    • check-neutral = docs/readthedocs.org:cabal
    • check-skipped = docs/readthedocs.org:cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Validate post job
    • check-neutral = Validate post job
    • check-skipped = Validate post job
  • any of [🛡 GitHub branch protection]:
    • check-success = fourmolu
    • check-neutral = fourmolu
    • check-skipped = fourmolu
  • any of [🛡 GitHub branch protection]:
    • check-success = hlint
    • check-neutral = hlint
    • check-skipped = hlint
  • any of [🛡 GitHub branch protection]:
    • check-success = Bootstrap post job
    • check-neutral = Bootstrap post job
    • check-skipped = Bootstrap post job
  • any of [🛡 GitHub branch protection]:
    • check-success = whitespace
    • check-neutral = whitespace
    • check-skipped = whitespace
  • any of [🛡 GitHub branch protection]:
    • check-success = Check sdist post job
    • check-neutral = Check sdist post job
    • check-skipped = Check sdist post job
  • any of [🛡 GitHub branch protection]:
    • check-success = Changelogs
    • check-neutral = Changelogs
    • check-skipped = Changelogs

@mergify
mergify Bot merged commit bbed2f7 into haskell:master Sep 12, 2026
72 checks passed
@mergify mergify Bot removed the queued label Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge me Tell Mergify Bot to merge ready and waiting Mergify is waiting out the cooldown period

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cabal package not visible to build auto-generated setup.hs

5 participants