-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Shallow clones of submodules #34228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sorry for barging in, but why are time git clone --depth=1 'https://github.com/rust-lang/llvm.git' '/tmp/llvm/'
time curl -L 'https://github.com/rust-lang/llvm/archive/master.tar.gz' | tar -C '/tmp/llvm2/' -xzf -
|
I believe we can do this today with @sanmai-NL yeah git submodules aren't always the speediest but they work most reliably because all you need is git to clone the repo, not other tools. |
@alexcrichton: that makes sense, on the other hand, the potential influence on behavior during build of local Git config makes it a less suitable tool for batch downloading than e.g. |
The submodules are updated every time you run |
I think this topic needs benchmarks and other evaluations. I recall that Rust build times are an issue of concern. This dependency fetching aspect seems like low hanging fruit to reduce the build time. Use case
A quick analysis of the solutions so far, purely focusing on efficiency considerations Solution A: Current solution
Solution B: Current solution with
Solution C: mkdir -- '/tmp/llvm/' &&
cd -- "$_" &&
curl --location --time-cond 'llvm-master.tar.gz' --output 'llvm-master.tar.gz' 'https://codeload.github.com/rust-lang/llvm/tar.gz/master' &&
tar -x -z -f 'llvm-master.tar.gz' &&
cd - Feasibility: Possible if
Observations
|
Even though we're talking about an initial cost, still, doing the whole build in RAM (ramdisk) is perfectly possible with just 3GB + compression. (probably less without full cloning) Downloading a source snapshot is preferable in that scenario but using an equivalent shallow clone could become attractive too. Regardless of anything else, my original issue still stands and looks like the lowest of low hanging fruit. |
This is an interesting issue because it talks about the experience of users on slow connections, rather than CI (which has been my focus) - the solution I have in mind for CI (caching) doesn't end up with any benefits for users. Let's pretend "github doesn't allow shallow submodule clone" was resolved (for the sake of discussion):
For CI I personally think caching is a better avenue to investigate (as I mention on the issue linked above), but any solution suggested here would be a great start. |
Closing. Shallow clones of submodules aren't feasible today due to not knowing how shallow we need to be. |
(This is a new issue for this comment on #30107.)
Right now
configure
performs deep clones of submodules (and recursively). This means downloading tons and tons of history (especially in the case of LLVM). Bad for slow connections, etc.But we should be able to perform "shallow" clones, passing
--depth 1
togit submodule update
.I've tried this locally, and git wasn't happy about it:
I am pretty sure this is this issue. The solution requires the
uploadpack.allowReachableSHA1InWant
repository configuration flag, which, if isaacs/github#436 is up-to-date, is not set on GitHub.So I think this issue is blocked on isaacs/github#436, for a start.
The text was updated successfully, but these errors were encountered: