Merge branch 'compile-overwrite' into master
This commit is contained in:
commit
081582d3e1
@ -992,6 +992,7 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
|
|||||||
, PatchFailed
|
, PatchFailed
|
||||||
, UnknownArchive
|
, UnknownArchive
|
||||||
, TarDirDoesNotExist
|
, TarDirDoesNotExist
|
||||||
|
, NotInstalled
|
||||||
#if !defined(TAR)
|
#if !defined(TAR)
|
||||||
, ArchiveResult
|
, ArchiveResult
|
||||||
#endif
|
#endif
|
||||||
|
@ -20,6 +20,12 @@ source-repository-package
|
|||||||
tag: bf6d28cf989b70286e12fecc183d5bbf5454a1a2
|
tag: bf6d28cf989b70286e12fecc183d5bbf5454a1a2
|
||||||
subdir: hpath-directory
|
subdir: hpath-directory
|
||||||
|
|
||||||
|
-- https://github.com/cjdev/text-conversions/pull/10
|
||||||
|
source-repository-package
|
||||||
|
type: git
|
||||||
|
location: https://github.com/hasufell/text-conversions.git
|
||||||
|
tag: 9abf0e5e5664a3178367597c32db19880477a53c
|
||||||
|
|
||||||
optimization: 2
|
optimization: 2
|
||||||
|
|
||||||
package streamly
|
package streamly
|
||||||
|
14
lib/GHCup.hs
14
lib/GHCup.hs
@ -807,6 +807,7 @@ compileGHC :: ( MonadMask m
|
|||||||
, PatchFailed
|
, PatchFailed
|
||||||
, UnknownArchive
|
, UnknownArchive
|
||||||
, TarDirDoesNotExist
|
, TarDirDoesNotExist
|
||||||
|
, NotInstalled
|
||||||
#if !defined(TAR)
|
#if !defined(TAR)
|
||||||
, ArchiveResult
|
, ArchiveResult
|
||||||
#endif
|
#endif
|
||||||
@ -816,8 +817,9 @@ compileGHC :: ( MonadMask m
|
|||||||
compileGHC dls tver bstrap jobs mbuildConfig patchdir aargs pfreq@(PlatformRequest {..})
|
compileGHC dls tver bstrap jobs mbuildConfig patchdir aargs pfreq@(PlatformRequest {..})
|
||||||
= do
|
= do
|
||||||
lift $ $(logDebug) [i|Requested to compile: #{tver} with #{bstrap}|]
|
lift $ $(logDebug) [i|Requested to compile: #{tver} with #{bstrap}|]
|
||||||
whenM (lift $ ghcInstalled tver)
|
|
||||||
(throwE $ AlreadyInstalled GHC (tver ^. tvVersion))
|
alreadyInstalled <- lift $ ghcInstalled tver
|
||||||
|
alreadySet <- fmap (maybe False (==tver)) $ lift $ ghcSet (_tvTarget tver)
|
||||||
|
|
||||||
-- download source tarball
|
-- download source tarball
|
||||||
dlInfo <-
|
dlInfo <-
|
||||||
@ -840,13 +842,16 @@ compileGHC dls tver bstrap jobs mbuildConfig patchdir aargs pfreq@(PlatformReque
|
|||||||
|
|
||||||
(bindist, bmk) <- liftE $ runBuildAction
|
(bindist, bmk) <- liftE $ runBuildAction
|
||||||
tmpUnpack
|
tmpUnpack
|
||||||
(Just ghcdir)
|
Nothing
|
||||||
(do
|
(do
|
||||||
b <- compileBindist bghc ghcdir workdir
|
b <- compileBindist bghc ghcdir workdir
|
||||||
bmk <- liftIO $ readFileStrict (build_mk workdir)
|
bmk <- liftIO $ readFileStrict (build_mk workdir)
|
||||||
pure (b, bmk)
|
pure (b, bmk)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
when alreadyInstalled $ do
|
||||||
|
lift $ $(logInfo) [i|Deleting existing installation|]
|
||||||
|
liftE $ rmGHCVer tver
|
||||||
liftE $ installPackedGHC bindist
|
liftE $ installPackedGHC bindist
|
||||||
(view dlSubdir dlInfo)
|
(view dlSubdir dlInfo)
|
||||||
ghcdir
|
ghcdir
|
||||||
@ -856,6 +861,9 @@ compileGHC dls tver bstrap jobs mbuildConfig patchdir aargs pfreq@(PlatformReque
|
|||||||
liftIO $ writeFile (ghcdir </> ghcUpSrcBuiltFile) (Just newFilePerms) bmk
|
liftIO $ writeFile (ghcdir </> ghcUpSrcBuiltFile) (Just newFilePerms) bmk
|
||||||
|
|
||||||
reThrowAll GHCupSetError $ postGHCInstall tver
|
reThrowAll GHCupSetError $ postGHCInstall tver
|
||||||
|
|
||||||
|
-- restore
|
||||||
|
when alreadySet $ liftE $ void $ setGHC tver SetGHCOnly
|
||||||
pure ()
|
pure ()
|
||||||
|
|
||||||
where
|
where
|
||||||
|
@ -596,8 +596,8 @@ getChangeLog dls tool (Right tag) =
|
|||||||
-- 1. the build directory, depending on the KeepDirs setting
|
-- 1. the build directory, depending on the KeepDirs setting
|
||||||
-- 2. the install destination, depending on whether the build failed
|
-- 2. the install destination, depending on whether the build failed
|
||||||
runBuildAction :: (Show (V e), MonadReader Settings m, MonadIO m, MonadMask m)
|
runBuildAction :: (Show (V e), MonadReader Settings m, MonadIO m, MonadMask m)
|
||||||
=> Path Abs -- ^ build directory
|
=> Path Abs -- ^ build directory (cleaned up depending on Settings)
|
||||||
-> Maybe (Path Abs) -- ^ install location (e.g. for GHC)
|
-> Maybe (Path Abs) -- ^ dir to *always* clean up on exception
|
||||||
-> Excepts e m a
|
-> Excepts e m a
|
||||||
-> Excepts '[BuildFailed] m a
|
-> Excepts '[BuildFailed] m a
|
||||||
runBuildAction bdir instdir action = do
|
runBuildAction bdir instdir action = do
|
||||||
|
Loading…
Reference in New Issue
Block a user