@@ -171,6 +171,7 @@ module Stack.Types.Config
171171 ,configUrlsL
172172 ,cabalVersionL
173173 ,whichCompilerL
174+ ,envOverrideL
174175 -- * Lens reexport
175176 ,view
176177 ,to
@@ -1296,15 +1297,15 @@ flagCacheLocal = do
12961297 root <- installationRootLocal
12971298 return $ root </> $ (mkRelDir " flag-cache" )
12981299
1299- -- | Where to store mini build plan caches
1300+ -- | Where to store 'LoadedSnapshot' caches
13001301configLoadedSnapshotCache
13011302 :: (MonadThrow m , MonadReader env m , HasConfig env , HasGHCVariant env )
1302- => SnapName -- FIXME generalize?
1303+ => LoadedResolver
13031304 -> m (Path Abs File )
1304- configLoadedSnapshotCache name = do
1305+ configLoadedSnapshotCache resolver = do
13051306 root <- view stackRootL
13061307 platform <- platformGhcVerOnlyRelDir
1307- file <- parseRelFile $ T. unpack (renderSnapName name ) ++ " .cache"
1308+ file <- parseRelFile $ T. unpack (resolverName resolver ) ++ " .cache"
13081309 -- Yes, cached plans differ based on platform
13091310 return (root </> $ (mkRelDir " build-plan-cache" ) </> platform </> file)
13101311
@@ -1379,6 +1380,8 @@ parseProjectAndConfigMonoid rootDir =
13791380
13801381 flags <- o ..:? " flags" ..!= mempty
13811382 resolver <- jsonSubWarnings (o ..: " resolver" )
1383+ >>= either (fail . show ) return
1384+ . mapM (parseCustomLocation (Just (toFilePath rootDir)))
13821385 compiler <- o ..:? " compiler"
13831386 msg <- o ..:? " user-message"
13841387 config <- parseConfigMonoidObject rootDir o
@@ -1676,7 +1679,7 @@ data CustomSnapshot = CustomSnapshot
16761679 , csGhcOptions :: ! GhcOptions
16771680 }
16781681
1679- instance FromJSON (WithJSONWarnings (CustomSnapshot , Maybe Resolver )) where
1682+ instance ( a ~ Maybe ( ResolverWith Text )) => FromJSON (WithJSONWarnings (CustomSnapshot , a )) where
16801683 parseJSON = withObjectWarnings " CustomSnapshot" $ \ o -> (,)
16811684 <$> (CustomSnapshot
16821685 <$> o ..:? " compiler"
@@ -1906,3 +1909,8 @@ loadedSnapshotL = envConfigL.lens
19061909
19071910whichCompilerL :: Getting r CompilerVersion WhichCompiler
19081911whichCompilerL = to whichCompiler
1912+
1913+ envOverrideL :: HasConfig env => Lens' env (EnvSettings -> IO EnvOverride )
1914+ envOverrideL = configL. lens
1915+ configEnvOverride
1916+ (\ x y -> x { configEnvOverride = y })
0 commit comments