Skip to content

Commit 627859c

Browse files
committed
SetupWrapper: configure progs when building Setup
This commit configures the unconfigured programs in the program database when we are building a custom Setup script. This ensures that we can find the "strip" program which might otherwise still be unconfigured.
1 parent b548291 commit 627859c

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

cabal-install/src/Distribution/Client/SetupWrapper.hs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ import Distribution.Simple.Program
9090
, runDbProgramCwd
9191
)
9292
import Distribution.Simple.Program.Db
93-
( prependProgramSearchPath
93+
( configureAllKnownPrograms
94+
, prependProgramSearchPath
9495
, progOverrideEnv
9596
)
9697
import Distribution.Simple.Program.Find
@@ -1026,11 +1027,19 @@ getExternalSetupMethod verbosity options pkg bt = do
10261027
createDirectoryIfMissingVerbose verbosity True setupCacheDir
10271028
installExecutableFile verbosity src cachedSetupProgFile
10281029
-- Do not strip if we're using GHCJS, since the result may be a script
1029-
when (maybe True ((/= GHCJS) . compilerFlavor) $ useCompiler options') $
1030+
when (maybe True ((/= GHCJS) . compilerFlavor) $ useCompiler options') $ do
1031+
-- Add the relevant PATH overrides for the package to the
1032+
-- program database.
1033+
setupProgDb
1034+
<- prependProgramSearchPath verbosity
1035+
(useExtraPathEnv options)
1036+
(useExtraEnvOverrides options)
1037+
(useProgramDb options')
1038+
>>= configureAllKnownPrograms verbosity
10301039
Strip.stripExe
10311040
verbosity
10321041
platform
1033-
(useProgramDb options')
1042+
setupProgDb
10341043
cachedSetupProgFile
10351044
return cachedSetupProgFile
10361045
where

0 commit comments

Comments
 (0)