Open mpilgrem opened 3 months ago
Haddocks for Cabal-3.11.0.0
: https://ghc.gitlab.haskell.org/ghc/doc/libraries/Cabal-3.11.0.0-inplace/index.html
initialBuildSteps
was:
-- | Runs 'componentInitialBuildSteps' on every configured component.
initialBuildSteps :: FilePath -- ^"dist" prefix
-> PackageDescription -- ^mostly information from the .cabal file
-> LocalBuildInfo -- ^Configuration information
-> Verbosity -- ^The verbosity to use
-> IO ()
initialBuildSteps distPref pkg_descr lbi verbosity =
withAllComponentsInBuildOrder pkg_descr lbi $ \_comp clbi ->
componentInitialBuildSteps distPref pkg_descr lbi clbi verbosity
The history:
What Stack is doing is this: before using ghc --interactive
, it uses replHook
(with initialBuildSteps
) as a way of getting Cabal to create the autogenerated files for every configured component. To use initialBuildSteps
, Stack needs access to (a) the 'dist' prefix (FilePath
) (b) PackageDescription
(c) LocalBuildInfo
(d) Vebosity
- replHook
is one way to get that information (some of it - the 'dist' prefix, verbosity - is provided via the ReplFlags
value).
Stack introduced this to cause Cabal to create the autogenerated files for every configured component, without building everything else, making stack ghci
or stack repl
more efficient.
It is confusing and depressing that Cabal invests little to no energy to understand whether they're breaking other main downstream users.
Did you open an issue at Cabal?
@hasufell, the corresponding Cabal issue is https://github.com/haskell/cabal/issues/9856.
There is now a temporary workaround in Stack's master
branch, as Cabal-3.11.0.0
exports what is needed for Stack to recreate the missing initialBuildSteps
.
GHC 9.10.0.20240328 is available (Alpha 2, first alpha for Windows). However
stack build
with:fails with (extract, reformatted for clarity):