Shallow and concurrent git clones#10254
Conversation
844e1bb to
fd373ad
Compare
|
This change also affects |
fd373ad to
eb4f43c
Compare
0416a52 to
85b2a5c
Compare
|
This is ready |
85b2a5c to
0d9629a
Compare
|
I've addressed your review @ulysses4ever. Merging this now! |
|
@alt-romes can you resolve the conflicts? |
Cloning the entire repository for the purpose of compiling packages specified in source-repository-packages is wasted effort. To read and compile the package, we need only the HEAD of the repository, thus a shallow clone is sufficient. Note that this doesn't change the behaviour of `cabal get -s` which still does a full clone (--depth=1 is only used in vcsSyncRepo, not in vcsCloneRepo) Fixes haskell#7264
Cloning/synchronising VCS repos can be unnecessarily slow if done serially. By synchronizing the repos concurrently we make much better use of time. Introduces rerunConcurrentlyIfChanged, a Rebuild monad function that runs, from multiple actions, the actions that need rebuilding concurrently.
0d9629a to
c89ab54
Compare
|
Hi, I'm working on the VCS test suite and (while running it in verbose mode) I noticed this: As a result, I'm not sure this feature is actually being tested. When I patched the test suite to use the |
|
I have a number of PRs to make the VCS tests easier to work with open right now; I'll see if I can work on this when I get them merged:
|
|
Hi, I'm running into an issue on GitHub CI that seems to have to do with this behavior change. This arises when cabal.project contains two source-repository-package stanzas for the same repository, but different directories. I have found no good way to work around the issue. |
|
Thanks @jgm, I think I found the pandoc CI run with this problem but can't find the source. Could you please raise an issue for this and include the Update: I may have found it, if the commit that first sees the problem in CI is jgm/pandoc@af3af04? source-repository-package
type: git
location: https://github.com/jgm/commonmark-hs.git
subdir: commonmark
tag: 48b95bab66401d94f80b7c84c5c33ab9e2cd39ea
source-repository-package
type: git
location: https://github.com/jgm/commonmark-hs.git
subdir: commonmark-extensions
tag: 204e4bb2e91bac82203468de207d8e2f79700dc0 |
|
This looks like severe regression. We need a fresh ticket |
|
OK, I can be a bit more precise about this now. You are right about the commit that first sees the problem. I tried to fix this in a subsequent commit by using the same tag for both subdirectories, and that does seem to have worked: https://github.com/jgm/pandoc/actions/runs/26708083903 . So perhaps the problem is not as severe as I had thought. |
|
Good to know that switching to the same commit across different srp's fixes it! I have a standalone reproducer with CI exercising the failure now: https://github.com/ulysses4ever/cabal-srp-shallow-reference-reproducer |
Please read Github PR Conventions and then fill in one of these two templates.
Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR:
Manual QA: Create or use a package with multiple source-repository-package dependencies,
cabal clean, thencabal build. You should see two repositories start being cloned at the same time, and then see other repositories being cloned concurrently as jobs are finished. The reason why only two repositories get cloned in parallel is that the limit of asynchronous downloads is == 2, to mimicasyncFetchPackages.Questions: The maximum two-job cap on cloning concurrency seems too low, I think it would be best if it could be configured (as a follow up MR?)