Skip to content

Fix #12473 cabal-install supports SetupHooks.lhs (literate Haskell) - #12475

Open
mpilgrem wants to merge 2 commits into
masterfrom
fix12473
Open

mpilgrem wants to merge 2 commits into
masterfrom
fix12473

Conversation

@mpilgrem

@mpilgrem mpilgrem commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:


See:

The change to the code follows the pattern of the lines immediately above.

The change to the documentation now distinguishes between a module and its source file.

@ulysses4ever ulysses4ever 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.

Thanks for picking this up! The docs changes are a clear improvement — separating the SetupHooks module from its source file reads much better.

The code change needs one more step, though: as written it finds SetupHooks.lhs but then copies it verbatim to dist-newstyle/.../setup/SetupHooks.hs, so GHC will try to parse the literate source as plain Haskell when it builds the Setup and hooks executables. The Custom branch just above avoids this by running ppUnlit on the .lhs source — we need the same here. Details and a suggestion inline.

The new test also can't see this, since cabal check doesn't go through updateSetupScript (and already accepted SetupHooks.lhs before this PR). A build-based test would catch both the original bug and the unlit issue; see inline.

Comment thread cabal-install/src/Distribution/Client/SetupWrapper.hs Outdated
Comment thread Cabal-hooks/README.md Outdated
Comment thread changelog.d/pr-12475.md
Comment thread cabal-testsuite/PackageTests/Check/SetupHooksLhs/cabal.test.hs Outdated
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.

2 participants