@@ -41,6 +41,7 @@ import qualified Data.Yaml as Yaml
4141import qualified Distribution.Package as C
4242import qualified Distribution.PackageDescription as C
4343import qualified Distribution.Text as C
44+ import Lens.Micro (set )
4445import Path
4546import Path.Find (findFiles )
4647import Path.IO hiding (findExecutable , findFiles , withSystemTempDir )
@@ -770,14 +771,20 @@ checkSnapBuildPlanActual
770771 -> SnapshotDef
771772 -> RIO env BuildPlanCheck
772773checkSnapBuildPlanActual root gpds flags sd = do
773- let forNonSnapshot = ( Just . snd ) <$> setupCabalEnv (sdWantedCompilerVersion sd)
774+ let forNonSnapshot = Just <$> setupCabalEnv (sdWantedCompilerVersion sd)
774775 mactualCompiler <-
775776 case sdResolver sd of
776777 ResolverSnapshot _ -> return Nothing
777778 ResolverCompiler _ -> forNonSnapshot
778779 ResolverCustom _ _ -> forNonSnapshot
779780
780- checkSnapBuildPlan root gpds flags sd mactualCompiler
781+ let inner = checkSnapBuildPlan root gpds flags sd
782+ case mactualCompiler of
783+ Nothing -> inner Nothing
784+ Just (modifiedPath, actualCompiler) -> do
785+ env0 <- ask
786+ let env = set envOverrideL (const $ return modifiedPath) env0
787+ runRIO env $ inner (Just actualCompiler)
781788
782789prettyPath
783790 :: forall r t m . (MonadIO m , RelPath (Path r t ) ~ Path Rel t , AnyPath (Path r t ))
0 commit comments