-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Use Shallow Submodule Init to Reduce Clone Times #1605
base: master
Are you sure you want to change the base?
Use Shallow Submodule Init to Reduce Clone Times #1605
Conversation
@@ -12,6 +12,7 @@ jobs: | |||
build: | |||
runs-on: ${{ matrix.os }} | |||
strategy: | |||
fail-fast: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed. But right now it is hard to debug actions as all jobs exit when one fails.
@@ -347,7 +347,7 @@ endif | |||
$(srcdir)/%/.git: | |||
cd $(srcdir) && \ | |||
flock `git rev-parse --git-dir`/config git submodule init $(dir $@) && \ | |||
flock `git rev-parse --git-dir`/config git submodule update --progress $(dir $@) | |||
flock `git rev-parse --git-dir`/config git -c "http.version=HTTP/1.1" submodule update --progress --depth 1 $(dir $@) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`-c "http.version=HTTP/1.1" forces http 1.1 to avoid error which was seen in previous PR.
Looks like the git server of uclibc-ng does not like shallow clones. I've seen that shallow clones can be configured in
|
Yeah, I'm testing this out locally. I can't get it to take... but hopefully I'll figure it out soon. It would definitely be preferable to do it this way instead of forcing it. |
Reopening with new PR due to being unable to reopen #1603 (force push/rebase caused history mismatch).
Added
--depth 1
to thegit submodule update
command inMakefile.in
.To test I setup a docker image which built the repository with
./configure --prefix=/opt/riscv --with-arch=rv32gc --with-abi=ilp32d
. The image with this change was 14.77 GB where as the version without this change was 16.93 GB. That is a savings of 2.16 GB. This won't be a big deal for people developing in a stable environment where they only init the submodules once, but for cases where the build is happening in a container this is a big gain.A different approach would be to populate the
shallow
property in.gitmodules
. However, this approach only saves about 100MB, perhaps because theshallow
property is not applied recursively.