on fd62aee help sign in
stackage/Stackage/Build.hs
37 lines 1.2 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 putStrLn "Creating a build plan"
18 ii <- getInstallInfo
20 putStrLn "Wiping out old cabal-dev folder"
21 rm_r "cabal-dev"
23 checkPlan ii
24 putStrLn "No mismatches, starting the sandboxed build."
26 ph <- withBinaryFile "build.log" WriteMode $ \handle ->
27 runProcess "cabal-dev" ("install":"-fnetwork23":iiPackageList ii) Nothing Nothing Nothing (Just handle) (Just handle)
28 ec <- waitForProcess ph
29 unless (ec == ExitSuccess) $ do
30 putStrLn "Build failed, please see build.log"
31 exitWith ec
33 putStrLn "Sandbox built, beginning individual test suites"
34 runTestSuites ii
36 putStrLn "All test suites that were expected to pass did pass, building tarballs."
37 makeTarballs ii