Skip to content

Commit

Permalink
Account for .buildinfo in repl when build-type: Configure (backport #…
Browse files Browse the repository at this point in the history
…9440) (#9612)

* Account for .buildinfo in repl when build-type: Configure (#9440)

In `autoconfUserHooks` we were not updating the `preRepl` hook to read
additional build information from /package/@.buildinfo@.

Additionally updates `autoconfUserHooks` to read additional build info
information for the remaining pre-hooks that are not pre-conf.

Fixes #9401

(cherry picked from commit ee1e6b8)

# Conflicts:
#	Cabal/src/Distribution/Simple.hs

* Update Simple.hs

---------

Co-authored-by: Rodrigo Mesquita <rodrigo.m.mesquita@gmail.com>
Co-authored-by: Hécate Moonlight <Kleidukos@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 12, 2024
1 parent f1a168a commit c805ff1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Cabal/src/Distribution/Simple.hs
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,7 @@ simpleUserHooks =
--
-- * 'postConf' runs @.\/configure@, if present.
--
-- * the pre-hooks 'preBuild', 'preClean', 'preCopy', 'preInst',
-- 'preReg' and 'preUnreg' read additional build information from
-- * the pre-hooks, except for pre-conf, read additional build information from
-- /package/@.buildinfo@, if present.
--
-- Thus @configure@ can use local system information to generate
Expand All @@ -588,14 +587,17 @@ autoconfUserHooks
= simpleUserHooks
{
postConf = defaultPostConf,
preBuild = readHookWithArgs buildVerbosity buildDistPref, -- buildCabalFilePath,
preBuild = readHookWithArgs buildVerbosity buildDistPref,
preRepl = readHookWithArgs replVerbosity replDistPref,
preCopy = readHookWithArgs copyVerbosity copyDistPref,
preClean = readHook cleanVerbosity cleanDistPref,
preInst = readHook installVerbosity installDistPref,
preHscolour = readHook hscolourVerbosity hscolourDistPref,
preHaddock = readHookWithArgs haddockVerbosity haddockDistPref,
preReg = readHook regVerbosity regDistPref,
preUnreg = readHook regVerbosity regDistPref
preUnreg = readHook regVerbosity regDistPref,
preTest = readHookWithArgs testVerbosity testDistPref,
preBench = readHookWithArgs benchmarkVerbosity benchmarkDistPref
}
where defaultPostConf :: Args -> ConfigFlags -> PackageDescription
-> LocalBuildInfo -> IO ()
Expand Down
11 changes: 11 additions & 0 deletions changelog.d/issue-9401
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
synopsis: Account for .buildinfo in repl, test, and bench
packages: Cabal
prs: #9440
issues: #9401

description: {

Generated <project>.buildinfo is now respected in cabal repl, cabal test and cabal bench.

}

0 comments on commit c805ff1

Please sign in to comment.