@@ -868,23 +868,22 @@ compileGHC targetGhc crossTarget vps bstrap hghc jobs mbuildConfig patches aargs
868
868
tmpDownload <- lift withGHCupTmpDir
869
869
tmpUnpack <- lift mkGhcupTmpDir
870
870
tar <- liftE $ download uri Nothing Nothing Nothing (fromGHCupPath tmpDownload) Nothing False
871
- (bf , tver) <- liftE $ cleanUpOnError @ '[UnknownArchive , ArchiveResult , ProcessError , PatchFailed , DownloadFailed , DigestError , ContentLengthError , GPGError ] tmpUnpack $ do
871
+ (workdir , tver) <- liftE $ cleanUpOnError @ '[UnknownArchive , ArchiveResult , ProcessError , PatchFailed , DownloadFailed , DigestError , ContentLengthError , GPGError ] tmpUnpack $ do
872
872
liftE $ unpackToDir (fromGHCupPath tmpUnpack) tar
873
873
874
- liftE $ applyAnyPatch patches (fromGHCupPath tmpUnpack)
875
-
876
- let regex = [s |^(.*/)*boot$|] :: B. ByteString
877
- [bootFile] <- liftIO $ findFilesDeep
874
+ let regex = [s |^(.*/)*compiler/ghc.cabal.in$|] :: B. ByteString
875
+ (ghcCabalIn: _) <- liftIO $ findFilesDeep
878
876
tmpUnpack
879
- (makeRegexOpts compExtended
880
- execBlank
881
- regex
882
- )
883
- tver <- liftE $ catchAllE @ _ @ '[ ProcessError , ParseError , NotFoundInPATH ] @ ' [] ( \ _ -> pure Nothing ) $ fmap Just $ getGHCVer
884
- (appendGHCupPath tmpUnpack (takeDirectory bootFile))
885
- pure (bootFile, tver )
877
+ (makeRegexOpts compExtended execBlank regex)
878
+
879
+ let workdir = appendGHCupPath tmpUnpack (takeDirectory (takeDirectory ghcCabalIn))
880
+
881
+ lift $ logDebug $ " GHC compile workdir: " <> T. pack (fromGHCupPath workdir)
882
+
883
+ liftE $ applyAnyPatch patches (fromGHCupPath workdir )
886
884
887
- let workdir = appendGHCupPath tmpUnpack (takeDirectory bf)
885
+ tver <- liftE $ catchAllE @ _ @ '[ProcessError , ParseError , NotFoundInPATH ] @ '[] (\ _ -> pure Nothing ) $ fmap Just $ getGHCVer workdir
886
+ pure (workdir, tver)
888
887
889
888
ov <- case vps of
890
889
Just vps' -> fmap Just $ expandVersionPattern tver " " " " " " " " vps'
0 commit comments