@@ -136,6 +136,22 @@ performBuild pb = do
136136
137137performBuild' :: PerformBuild -> IO [Text]
138138performBuild' pb@PerformBuild {..} = withBuildDir $ \builddir -> do
139+ -- First make sure to fetch all of the dependencies... just in case Hackage
140+ -- has an outage. Don't feel like wasting hours of CPU time.
141+ pbLog $ encodeUtf8 "Pre-fetching all packages\n"
142+ let toDownload = flip map (mapToList $ bpPackages pbPlan)
143+ $ \(name, plan) -> unpack $ concat
144+ [ display name
145+ , "-"
146+ , display $ ppVersion plan
147+ ]
148+ withCheckedProcess
149+ (proc "cabal"
150+ $ "fetch"
151+ : "--no-dependencies"
152+ : toDownload)
153+ $ \ClosedStream Inherited Inherited -> return ()
154+
139155 let removeTree' fp = whenM (isDirectory fp) (removeTree fp)
140156 mapM_ removeTree' [pbInstallDest, pbLogDir]
141157