diff --git a/src/Stack/Build/Execute.hs b/src/Stack/Build/Execute.hs index f45b3803d9..085c17ee70 100644 --- a/src/Stack/Build/Execute.hs +++ b/src/Stack/Build/Execute.hs @@ -425,7 +425,7 @@ executePlan' installedMap plan ee@ExecuteEnv {..} = do -- stack always using transformer stacks that are safe for this use case. runInBase <- liftBaseWith $ \run -> return (void . run) - let actions = concatMap (toActions installedMap runInBase ee) $ Map.elems $ Map.mergeWithKey + let actions = concatMap (toActions installedMap' runInBase ee) $ Map.elems $ Map.mergeWithKey (\_ b f -> Just (Just b, Just f)) (fmap (\b -> (Just b, Nothing))) (fmap (\f -> (Nothing, Just f))) @@ -467,6 +467,12 @@ executePlan' installedMap plan ee@ExecuteEnv {..} = do generateDepsHaddockIndex eeEnvOverride wc eeBaseConfigOpts eeLocals generateSnapHaddockIndex eeEnvOverride wc eeBaseConfigOpts eeGlobalDB when (toCoverage $ boptsTestOpts eeBuildOpts) generateHpcMarkupIndex + where + installedMap' = Map.difference installedMap + $ Map.fromList + $ map (\gid -> (packageIdentifierName $ ghcPkgIdPackageIdentifier gid, ())) + $ Map.keys + $ planUnregisterLocal plan toActions :: M env m => InstalledMap