on cc26f37 help sign in
stackage/Stackage/Build.hs
35 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) $ do
28 putStrLn "Build failed, please see build.log"
29 exitWith ec
31 putStrLn "Sandbox built, beginning individual test suites"
32 runTestSuites ii
34 putStrLn "All test suites that were expected to pass did pass, building tarballs."
35 makeTarballs ii