From fcc78e7321c2d8e3180338cd0c1ed09a11b28e40 Mon Sep 17 00:00:00 2001 From: Rodrigo Mesquita Date: Mon, 13 Nov 2023 16:44:17 +0000 Subject: [PATCH] Account for .buildinfo in repl when build-type: Configure 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 --- Cabal/src/Distribution/Simple.hs | 8 +++++--- changelog.d/issue-9401 | 11 +++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 changelog.d/issue-9401 diff --git a/Cabal/src/Distribution/Simple.hs b/Cabal/src/Distribution/Simple.hs index c52a02c0f96..58e9f4046b0 100644 --- a/Cabal/src/Distribution/Simple.hs +++ b/Cabal/src/Distribution/Simple.hs @@ -743,8 +743,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 @@ -753,7 +752,8 @@ autoconfUserHooks :: UserHooks 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 @@ -761,6 +761,8 @@ autoconfUserHooks = , preHaddock = readHookWithArgs haddockVerbosity haddockDistPref , preReg = readHook regVerbosity regDistPref , preUnreg = readHook regVerbosity regDistPref + , preTest = readHookWithArgs testVerbosity testDistPref + , preBench = readHookWithArgs benchmarkVerbosity benchmarkDistPref } where defaultPostConf diff --git a/changelog.d/issue-9401 b/changelog.d/issue-9401 new file mode 100644 index 00000000000..40487976543 --- /dev/null +++ b/changelog.d/issue-9401 @@ -0,0 +1,11 @@ +synopsis: Account for .buildinfo in repl, test, and bench +packages: Cabal +prs: #9440 +issues: #9401 + +description: { + +Generated .buildinfo is now respected in cabal repl, cabal test and cabal bench. + +} +