diff --git a/cabal-install/src/Distribution/Client/FetchUtils.hs b/cabal-install/src/Distribution/Client/FetchUtils.hs index 4c7d8e4f327336102b6b951f74833d245bc90792..a4f5a95f792723e2b08685ad7b0e6fef2837108a 100644 --- a/cabal-install/src/Distribution/Client/FetchUtils.hs +++ b/cabal-install/src/Distribution/Client/FetchUtils.hs @@ -252,13 +252,15 @@ asyncFetchPackages verbosity repoCtxt pkglocs body = do -- Suppress marking here, because 'withAsync' means -- that we get nondeterministic interleaving. -- It is essential that we don't catch async exceptions here, - -- specifically AsyncCancelled thrown at us from withAsync. + -- specifically 'AsyncCancelled' thrown at us from 'concurrently'. result <- Safe.try $ fetchPackage (verboseUnmarkOutput verbosity) repoCtxt pkgloc putMVar var result - withAsync fetchPackages $ \_ -> - body (Map.fromList asyncDownloadVars) + (_, res) <- concurrently + fetchPackages + (body $ Map.fromList asyncDownloadVars) + pure res -- | Expect to find a download in progress in the given 'AsyncFetchMap'