@@ -868,20 +868,23 @@ 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 ] 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
- let regex = [s |^(.*/)*boot$|] :: B. ByteString
874
- [bootFile] <- liftIO $ findFilesDeep
873
+
874
+ -- bootstrapped ghc renames boot to boot.source
875
+ let regex = [s |^(.*/)*boot(.source)*$|] :: B. ByteString
876
+ (boot: _) <- liftIO $ findFilesDeep
875
877
tmpUnpack
876
- (makeRegexOpts compExtended
877
- execBlank
878
- regex
879
- )
880
- tver <- liftE $ catchAllE @ _ @ '[ ProcessError , ParseError , NotFoundInPATH ] @ ' [] ( \ _ -> pure Nothing ) $ fmap Just $ getGHCVer
881
- (appendGHCupPath tmpUnpack (takeDirectory bootFile))
882
- pure (bootFile, tver )
878
+ (makeRegexOpts compExtended execBlank regex)
879
+
880
+ let workdir = appendGHCupPath tmpUnpack (takeDirectory boot)
881
+
882
+ lift $ logDebug $ " GHC compile workdir: " <> T. pack (fromGHCupPath workdir)
883
+
884
+ liftE $ applyAnyPatch patches (fromGHCupPath workdir )
883
885
884
- let workdir = appendGHCupPath tmpUnpack (takeDirectory bf)
886
+ tver <- liftE $ catchAllE @ _ @ '[ProcessError , ParseError , NotFoundInPATH ] @ '[] (\ _ -> pure Nothing ) $ fmap Just $ getGHCVer workdir
887
+ pure (workdir, tver)
885
888
886
889
ov <- case vps of
887
890
Just vps' -> fmap Just $ expandVersionPattern tver " " " " " " " " vps'
0 commit comments