on master help sign in
Pre-fetch packages to catch Hackage downtime early
7dd7763Michael Snoyman
ChangeLog.md+4
@@ -1,3 +1,7 @@
1+## 0.3.0.1
2+
3+Pre-fetch all packages from Hackage to catch Hackage downtime early.
4+
1## 0.3.0.0
5## 0.3.0.0
2
6
3* Return progress URL from uploadBundle
7* Return progress URL from uploadBundle
Stackage/PerformBuild.hs+16
@@ -136,6 +136,22 @@ performBuild pb = do
136
136
137performBuild' :: PerformBuild -> IO [Text]
137performBuild' :: PerformBuild -> IO [Text]
138performBuild' pb@PerformBuild {..} = withBuildDir $ \builddir -> do
138performBuild' 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+
139 let removeTree' fp = whenM (isDirectory fp) (removeTree fp)
155 let removeTree' fp = whenM (isDirectory fp) (removeTree fp)
140 mapM_ removeTree' [pbInstallDest, pbLogDir]
156 mapM_ removeTree' [pbInstallDest, pbLogDir]
141
157
stackage.cabal+1−1
@@ -1,5 +1,5 @@
1name: stackage
1name: stackage
2−version: 0.3.0.0
2+version: 0.3.0.1
3synopsis: "Stable Hackage," tools for creating a vetted set of packages from Hackage.
3synopsis: "Stable Hackage," tools for creating a vetted set of packages from Hackage.
4description: Please see <http://www.stackage.org/package/stackage> for a description and documentation.
4description: Please see <http://www.stackage.org/package/stackage> for a description and documentation.
5homepage: https://github.com/fpco/stackage
5homepage: https://github.com/fpco/stackage