Skip to content

Commit

Permalink
synchronize source repos concurrently
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundnoble committed Nov 16, 2024
1 parent c18d677 commit 2743ce4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
18 changes: 10 additions & 8 deletions cabal-install/src/Distribution/Client/ProjectConfig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ resolveBuildTimeSettings
cabalLogsDirectory
</> "$compiler"
</> "$libname"
<.> "log"
<.> "log"
givenTemplate = flagToMaybe projectConfigLogFile

useDefaultTemplate
Expand Down Expand Up @@ -1245,10 +1245,10 @@ fetchAndReadSourcePackages
preferredHttpTransport
sequenceA
[ fetchAndReadSourcePackageRemoteTarball
verbosity
distDirLayout
getTransport
uri
verbosity
distDirLayout
getTransport
uri
| ProjectPackageRemoteTarball uri <- pkgLocations
]

Expand Down Expand Up @@ -1403,15 +1403,17 @@ syncAndReadSourcePackagesRemoteRepos
]

let progPathExtra = fromNubList projectConfigProgPathExtra
let numJobs = 4 -- hardcoded for now
getConfiguredVCS <- delayInitSharedResources $ \repoType ->
let vcs = Map.findWithDefault (error $ "Unknown VCS: " ++ prettyShow repoType) repoType knownVCSs
in configureVCS verbosity progPathExtra vcs

concat
<$> sequenceA
<$> sequenceConcurrentlyBoundedRebuild
numJobs
[ rerunIfChanged verbosity monitor repoGroup' $ do
vcs' <- getConfiguredVCS repoType
syncRepoGroupAndReadSourcePackages vcs' pathStem repoGroup'
vcs' <- getConfiguredVCS repoType
syncRepoGroupAndReadSourcePackages vcs' pathStem repoGroup'
| repoGroup@((primaryRepo, repoType) : _) <- Map.elems reposByLocation
, let repoGroup' = map fst repoGroup
pathStem =
Expand Down
5 changes: 5 additions & 0 deletions changelog.d/synchronize-source-repos-concurrently
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
synopsis: Synchronize source repositories concurrently
packages: cabal-install
prs: #0000
significance: significant

0 comments on commit 2743ce4

Please sign in to comment.