You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prepare Stack for Cabal's changing approach to hooks #6542
The Hooks build type was introduced in Cabal 3.14. GHC 9.12.1 comes with Cabal-3.14.1.0.
Currently:
Stack itself has build type Custom, which makes use of generateBuildModule; and
Stack uses replHook in StackSetupShim.hs to cause Cabal to create the autogenerated files for every configured component, without building everything, before Stack uses ghc --interactive.
I believe this is incorrect for a package with Custom build-type in which the custom Setup creates autogenerated modules. Is there a reason you cannot call Setup repl here?
About your previous question re: Cabal-hooks not being a boot package. I thought about this and I think it is all working as designed. You are allowed to depend on whatever package you want in the setup-depends of a build-type: Hooks package; for example the package author may have added build-type: lens. So I think Cabal-hooks not being a boot package should not pose any particular difficulty here. Does that line up with your experience when adding the support for build-type: Hooks in stack?
I'd love to know anything else you thought was poorly documented so that we can improve the docs.
@sheaf, as Cabal-hooks is not a GHC boot package, it will not be included in Stackage snapshot's 'automatically'. It would be a Good Thing if Cabal-hooks could participate in Stackage snapshots (the currently relevant one being nightly-2026-10-22 for GHC 9.12.4/Cabal-3.14.2.0).
Pinging @Mikolaj on the topic of Cabal-hooks and Stackage, as I see cabal-install and cabal-install-solver from the same GitHub repository are listed under his name on Stackage.
@Mikolaj, you should not add to a Stackage snapshot any packages that are GHC boot packages (eg Cabal, Cabal-syntax), they come in indirectly by the snapshot specifying a version of GHC (and it causes trouble if they also come in directly). Any other packages published on Hackage can be added directly.
Activity
mpilgrem commentedon Mar 31, 2024
Currently:
Stack has:
Cabal-3.10.3.0has:and, for
stack --verbose ghcifor a simple one-package projectboo(extract, reformatted):mpilgrem commentedon Mar 31, 2024
An alternative to the
replHook'trick' would be for the 'setup' executable to get the information thatinitialBuildStepsneeds. Proof of concept:Re #6542 Take a direct approach to `initialBuildSteps`
Re #6542 Take a direct approach to `initialBuildSteps`
Re #6542 Take a direct approach to `initialBuildSteps`
Re #6542 Take a direct approach to `initialBuildSteps`
Re #6542 Take a direct approach to `initialBuildSteps`
Re #6542 Add Well-Typed's patch to the repository, so it is to hand
Merge pull request #6545 from commercialhaskell/re6542-SetupHooks
sheaf commentedon Apr 3, 2024
I believe this is incorrect for a package with
Custombuild-type in which the custom Setup creates autogenerated modules. Is there a reason you cannot callSetup replhere?Merge pull request #6544 from commercialhaskell/re6542
Re #6542 Take a direct approach to `initialBuildSteps`
6 remaining items
Re #6542 Step 1 - Stack acknowledges that build type Hooks unsupported
Merge pull request #6971 from commercialhaskell/fix6542-1
Fix #6542 Support Hooks build type
Fix #6542 Support Hooks build type
mpilgrem commentedon Oct 21, 2026
@ulysses4ever, the
masterbranch version of Stack now supports theHooksbuild type.ulysses4ever commentedon Oct 21, 2026
Thanks a lot @mpilgrem! Impressive turnaround time, truly. Looking forward for a release.
Merge pull request commercialhaskell#6972 from commercialhaskell/fix6…
sheaf commentedon Oct 22, 2026
Great work @mpilgrem, that's fantastic.
About your previous question re:
Cabal-hooksnot being a boot package. I thought about this and I think it is all working as designed. You are allowed to depend on whatever package you want in thesetup-dependsof abuild-type: Hookspackage; for example the package author may have addedbuild-type: lens. So I thinkCabal-hooksnot being a boot package should not pose any particular difficulty here. Does that line up with your experience when adding the support forbuild-type: Hooksin stack?I'd love to know anything else you thought was poorly documented so that we can improve the docs.
mpilgrem commentedon Oct 22, 2026
@sheaf, as
Cabal-hooksis not a GHC boot package, it will not be included in Stackage snapshot's 'automatically'. It would be a Good Thing ifCabal-hookscould participate in Stackage snapshots (the currently relevant one beingnightly-2026-10-22for GHC 9.12.4/Cabal-3.14.2.0).chreekat commentedon Oct 23, 2026
Ooh yes, that seems like a great idea. You can find instructions at https://github.com/commercialhaskell/stackage/#add-your-package
mpilgrem commentedon Oct 23, 2026
Pinging @Mikolaj on the topic of
Cabal-hooksand Stackage, as I seecabal-installandcabal-install-solverfrom the same GitHub repository are listed under his name on Stackage.Mikolaj commentedon Oct 23, 2026
Yes, that makes sense. I currently see only two cabal packages on Stackage:
Which of the six we publish to Hackage shall I add: Cabal-syntax Cabal Cabal-hooks hooks-exe cabal-install cabal-install-solver?
mpilgrem commentedon Oct 23, 2026
@Mikolaj, you should not add to a Stackage snapshot any packages that are GHC boot packages (eg
Cabal,Cabal-syntax), they come in indirectly by the snapshot specifying a version of GHC (and it causes trouble if they also come in directly). Any other packages published on Hackage can be added directly.Fix #6542 Support Hooks build type