@@ -48,11 +48,18 @@ build settings' bp = do
49 -- First install build tools so they can be used below.
49 -- First install build tools so they can be used below.
50 let installBuildTool tool = do
50 let installBuildTool tool = do
51+ let toolsDir = packageDir settings ++ "-tools"
53+ ecInit <- rawSystem "ghc-pkg" ["init", toolsDir]
54+ unless (ecInit == ExitSuccess) $ do
55+ putStrLn "Unable to create package database via ghc-pkg init"
51 putStrLn $ "Installing build tool: " ++ tool
58 putStrLn $ "Installing build tool: " ++ tool
52 ec <- withBinaryFile "build-tools.log" WriteMode $ \handle -> do
59 ec <- withBinaryFile "build-tools.log" WriteMode $ \handle -> do
53 hSetBuffering handle NoBuffering
60 hSetBuffering handle NoBuffering
55− let args = addCabalArgs settings BSBuild
62+ let args = addCabalArgs settings BSTools
56 $ "install"
63 $ "install"
57 : ("--cabal-lib-version=" ++ libVersion)
64 : ("--cabal-lib-version=" ++ libVersion)
58 : "--build-log=logs-tools/$pkg.log"
65 : "--build-log=logs-tools/$pkg.log"
@@ -69,6 +76,7 @@ build settings' bp = do
70 exitWith ec
77 exitWith ec
71 putStrLn $ tool ++ " built"
78 putStrLn $ tool ++ " built"
72 mapM_ installBuildTool $ bpTools bp
80 mapM_ installBuildTool $ bpTools bp
74 putStrLn "Beginning Stackage build"
82 putStrLn "Beginning Stackage build"