on bcabc00 help sign in
stackage/Stackage/Build.hs
33 lines 1.1 kB history raw
1module Stackage.Build
2 ( build
3 ) where
5import Control.Monad (unless)
6import Stackage.CheckPlan
7import Stackage.InstallInfo
8import Stackage.Tarballs
9import Stackage.Test
10import Stackage.Util
11import System.Exit (ExitCode (ExitSuccess), exitWith)
12import System.IO (IOMode (WriteMode), withBinaryFile)
13import System.Process (runProcess, waitForProcess)
15build :: IO ()
16build = do
17 ii <- getInstallInfo
19 rm_r "cabal-dev"
21 checkPlan ii
22 putStrLn "No mismatches, starting the sandboxed build."
24 ph <- withBinaryFile "build.log" WriteMode $ \handle ->
25 runProcess "cabal-dev" ("install":"-fnetwork23":iiPackageList ii) Nothing Nothing Nothing (Just handle) (Just handle)
26 ec <- waitForProcess ph
27 unless (ec == ExitSuccess) $ exitWith ec
29 putStrLn "Sandbox built, beginning individual test suites"
30 runTestSuites ii
32 putStrLn "All test suites that were expected to pass did pass, building tarballs."
33 makeTarballs ii