Permalink
Browse files

'reinstallAddSourceDeps': use correct package DB after 'configure -w'.

  • Loading branch information...
1 parent a824a31 commit c90a7330f7c9dadfebe15d76f2f31e53133394af @23Skidoo 23Skidoo committed Feb 10, 2014
Showing with 8 additions and 4 deletions.
  1. +5 −4 cabal-install/Distribution/Client/Sandbox.hs
  2. +3 −0 cabal-install/Main.hs
@@ -726,10 +726,11 @@ maybeReinstallAddSourceDeps verbosity numJobsFlag configFlags' globalFlags' = do
configProgramPaths = configProgramPaths sandboxConfigFlags
`mappend` configProgramPaths savedFlags,
configProgramArgs = configProgramArgs sandboxConfigFlags
- `mappend` configProgramArgs savedFlags
- -- NOTE: We don't touch the @configPackageDBs@ field because
- -- @sandboxConfigFlags@ contains the sandbox location which was set when
- -- creating @cabal.sandbox.config@.
+ `mappend` configProgramArgs savedFlags,
+ -- NOTE: Unconditionally choosing the value from
+ -- 'dist/setup-config'. Sandbox package DB location may have been
+ -- changed by 'configure -w'.
+ configPackageDBs = configPackageDBs savedFlags
-- FIXME: Is this compatible with the 'inherit' feature?
}
View
@@ -265,6 +265,9 @@ configureAction (configFlags, configExFlags) extraArgs globalFlags = do
whenUsingSandbox useSandbox $ \sandboxDir -> do
initPackageDBIfNeeded verbosity configFlags'' comp conf
+ -- NOTE: We do not write the new sandbox package DB location to
+ -- 'cabal.sandbox.config' here because 'configure -w' must not affect
+ -- subsequent 'install' (for UI compatibility with non-sandboxed mode).
indexFile <- tryGetIndexFilePath config
maybeAddCompilerTimestampRecord verbosity sandboxDir indexFile

0 comments on commit c90a733

Please sign in to comment.