Skip to content

Commit

Permalink
Only reconfigure when conifgCacheOpts changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsloan committed Nov 24, 2015
1 parent ac57440 commit 7cd87cb
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/Stack/Build/Execute.hs
Original file line number Diff line number Diff line change
Expand Up @@ -627,19 +627,13 @@ ensureConfig newConfigCache pkgDir ExecuteEnv {..} announce cabal cabalfp = do
if boptsReconfigure eeBuildOpts
then return True
else do
-- We can ignore the components portion of the config
-- cache, because it's just used to inform 'construct
-- plan that we need to plan to build additional
-- components. These components don't affect the actual
-- package configuration.
let ignoreComponents cc = cc { configCacheComponents = Set.empty }
-- Determine the old and new configuration in the local directory, to
-- determine if we need to reconfigure.
mOldConfigCache <- tryGetConfigCache pkgDir

mOldCabalMod <- tryGetCabalMod pkgDir

return $ fmap ignoreComponents mOldConfigCache /= Just (ignoreComponents newConfigCache)
return $ fmap configCacheOpts mOldConfigCache /= Just (configCacheOpts newConfigCache)
|| mOldCabalMod /= Just newCabalMod
let ConfigureOpts dirs nodirs = configCacheOpts newConfigCache
when needConfig $ withMVar eeConfigureLock $ \_ -> do
Expand Down

0 comments on commit 7cd87cb

Please sign in to comment.