Skip to content

fix(cabal-testsuite, Cabal): build the custom Setup with Cabal 3.18.1.0 - #12369

Open
zlonast wants to merge 1 commit into
haskell:masterfrom
zlonast:cabal-testsuite-cabal-3.18.1.0
Open

zlonast wants to merge 1 commit into
haskell:masterfrom
zlonast:cabal-testsuite-cabal-3.18.1.0

Conversation

@zlonast

@zlonast zlonast commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Fix: #12186


Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

Comment thread cabal-testsuite/Setup.hs
-- yield 'Nothing'), so the raw output is not valid source code. Use the
-- exported 'mkPackageName' / 'mkUnitId' instead.
fixupCompilerShow :: String -> String
fixupCompilerShow = go

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.

if possible, could this be done where the constructors are visible?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

As I understand it, we can use the new cabal-testsuite on older branches. However, Show and Read haven't been updated in those older branches, which is where the problem arises.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I've added it; now we have even more CPP macros.

@zlonast
zlonast force-pushed the cabal-testsuite-cabal-3.18.1.0 branch from 1513bf8 to 0875578 Compare September 25, 2026 14:10
@zlonast zlonast changed the title fix(cabal-testsuite): build the custom Setup with Cabal 3.18.1.0 fix(cabal-testsuite, Cabal): build the custom Setup with Cabal 3.18.1.0 Sep 25, 2026
@philderbeast philderbeast mentioned this pull request Oct 7, 2026
1 of 2 tasks

@philderbeast philderbeast left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is everything here needed to bump setup-depends in cabal-testsuite?

Comment on lines +156 to +157
setup-depends: Cabal ^>= 3.18.1.0,
Cabal-syntax ^>= 3.18.1.0,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If this is extending #12348, could you add @fendor as co-author?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sorry, another force push removed the co-authorship.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think my only changes are these two lines, so I don't think I deserve a co-authorship for just that 😅

Comment thread cabal-testsuite/Setup.hs Outdated
Comment on lines +26 to +27
$ mkVerbosity defaultVerbosityHandles
$ fromFlagOrDefault normal (configVerbosity flags)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is the recurring calling pattern that #11778 adds utility functions for.

-- | The verbosity from the setup verbosity or 'normal' if the flag is not set.
setupOrNormalVerbosity :: VerbosityHandles -> CommonSetupFlags -> Verbosity
setupOrNormalVerbosity verbHandles =
  mkVerbosity verbHandles . Cabal.fromFlagOrDefault normal . setupVerbosity

I see that setupVerbosity is configVerbosity:

{ setupVerbosity = configVerbosity

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added

@zlonast
zlonast force-pushed the cabal-testsuite-cabal-3.18.1.0 branch from 0875578 to 9d0d698 Compare October 8, 2026 06:48
@zlonast

zlonast commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator Author

Is everything here needed to bump setup-depends in cabal-testsuite?

Unfortunately, yes. cabal-testsuite's Setup.hs is not a plain custom Setup: during configure it generates the module Test.Cabal.ScriptEnv0.hs, embedding pieces of the computed LocalBuildInfo as Haskell source. The Setup itself is compiled against the external setup-depends Cabal (3.18.1.0), while the generated module is compiled against the in-tree lib:Cabal (3.19)

It is also worth noting that cabal-version: latest corresponds to 3.16.1.0, whereas we need 3.18.1.0.

Basically, our cabal-testsuite is sensitive to changes, so if we don't pin it, it will fail next time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cabal-3.18.1.0 with older lib:Cabal custom setup package crashes HLS

5 participants