mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-02-07 03:47:28 +01:00
Install build tools one at a time
This commit is contained in:
parent
e1d3714e8c
commit
f9999a5b57
@ -44,11 +44,9 @@ build settings' bp = do
|
|||||||
let runCabal args handle = runProcess "cabal" args Nothing menv Nothing (Just handle) (Just handle)
|
let runCabal args handle = runProcess "cabal" args Nothing menv Nothing (Just handle) (Just handle)
|
||||||
|
|
||||||
-- First install build tools so they can be used below.
|
-- First install build tools so they can be used below.
|
||||||
case bpTools bp of
|
let installBuildTool tool = do
|
||||||
[] -> putStrLn "No build tools required"
|
putStrLn $ "Installing build tool: " ++ tool
|
||||||
tools -> do
|
ec <- withBinaryFile "build-tools.log" WriteMode $ \handle -> do
|
||||||
putStrLn $ "Installing the following build tools: " ++ unwords tools
|
|
||||||
ph1 <- withBinaryFile "build-tools.log" WriteMode $ \handle -> do
|
|
||||||
let args = addCabalArgs settings
|
let args = addCabalArgs settings
|
||||||
$ "install"
|
$ "install"
|
||||||
: ("--cabal-lib-version=" ++ libVersion)
|
: ("--cabal-lib-version=" ++ libVersion)
|
||||||
@ -56,15 +54,20 @@ build settings' bp = do
|
|||||||
: "-j"
|
: "-j"
|
||||||
: concat
|
: concat
|
||||||
[ extraArgs settings
|
[ extraArgs settings
|
||||||
, tools
|
, [tool]
|
||||||
]
|
]
|
||||||
hPutStrLn handle ("cabal " ++ unwords (map (\s -> "'" ++ s ++ "'") args))
|
hPutStrLn handle ("cabal " ++ unwords (map (\s -> "'" ++ s ++ "'") args))
|
||||||
runCabal args handle
|
ph <- runCabal args handle
|
||||||
ec2 <- waitForProcess ph1
|
waitForProcess ph
|
||||||
unless (ec2 == ExitSuccess) $ do
|
unless (ec == ExitSuccess) $ do
|
||||||
putStrLn "Building of build tools failed, please see build-tools.log"
|
putStrLn $ concat
|
||||||
exitWith ec2
|
[ "Building of "
|
||||||
putStrLn "Build tools built"
|
, tool
|
||||||
|
, " failed, please see build-tools.log"
|
||||||
|
]
|
||||||
|
exitWith ec
|
||||||
|
putStrLn $ tool ++ " built"
|
||||||
|
mapM_ installBuildTool $ bpTools bp
|
||||||
|
|
||||||
ph <- withBinaryFile "build.log" WriteMode $ \handle -> do
|
ph <- withBinaryFile "build.log" WriteMode $ \handle -> do
|
||||||
let args = addCabalArgs settings
|
let args = addCabalArgs settings
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user