This commit is contained in:
2020-02-24 15:09:38 +01:00
parent b3eac9bf54
commit 30ed7f0226
3 changed files with 32 additions and 16 deletions

View File

@@ -556,6 +556,7 @@ installTool :: ( MonadThrow m
, MonadLogger m
, MonadCatch m
, MonadIO m
, MonadFail m
)
=> ToolRequest
-> Maybe PlatformRequest -- ^ if Nothing, looks up current host platform
@@ -570,6 +571,7 @@ installTool :: ( MonadThrow m
, NoDownload
, NoCompatibleArch
, DistroNotFound
, NotInstalled
]
m
()
@@ -607,7 +609,9 @@ installTool treq mpfReq urlSource = do
-- TODO: test if tool is already installed
case treq of
(ToolRequest GHC ver) -> liftE $ installGHC archiveSubdir ghcdir
(ToolRequest GHC ver) -> do
liftE $ installGHC archiveSubdir ghcdir
liftE $ setGHC ver SetGHCOnly
(ToolRequest Cabal ver) -> liftE $ installCabal archiveSubdir bindir
pure ()
@@ -619,7 +623,7 @@ toolAlreadyInstalled ToolRequest {..} = case _tool of
-- | Install an unpacked GHC distribution.
-- | Install an unpacked GHC distribution. This only deals with the GHC build system and nothing else.
installGHC :: (MonadLogger m, MonadIO m)
=> Path Abs -- ^ Path to the unpacked GHC bindist (where the configure script resides)
-> Path Abs -- ^ Path to install to
@@ -642,6 +646,7 @@ installCabal :: (MonadLogger m, MonadCatch m, MonadIO m)
installCabal path inst = do
lift $ $(logInfo) ([s|Installing cabal|])
let cabalFile = [rel|cabal|] :: Path Rel
liftIO $ createDirIfMissing newDirPerms inst
handleIO (throwE . CopyError . show) $ liftIO $ copyFile
(path </> cabalFile)
(inst </> cabalFile)
@@ -667,6 +672,7 @@ setGHC ver sghc = do
-- symlink destination
destdir <- liftIO $ ghcupBinDir
liftIO $ createDirIfMissing newDirPerms destdir
-- for ghc tools (ghc, ghci, haddock, ...)
verfiles <- ghcToolFiles ghcdir