hhvm / packaging

The sources for how we have built the HHVM packages.
MIT License
65 stars 65 forks source link

Make a shallow clone in make-source-tarball #297

Closed Atry closed 2 years ago

Atry commented 2 years ago

This PR would speed up make-source-tarball.

fredemmott commented 2 years ago

This looks good, but please test before landing. Either don't backport, or test on old versions too.

Older versions of git and github used to have issues with recursive submodules with shallow clones - they'd only be usable if the HEAD was pushed to recently.

AIUI this won't be a problem if you don't backport it - now that we don't use submodules for boost or mysql, I think we're out of recursive ones - that said, this may bite you later

Atry commented 2 years ago

Yes, I have used this script for testing Ubuntu 21.10 builds.

Atry commented 2 years ago

I think this is correct, but the documentation for 'git clone' says "If you want to clone submodules shallowly, also pass --shallow-submodules". Should we also be passing that here? Or do we not have any active submodules until after the 'git submodule update ...' command you also touched later on?

I think --shallow-submodules is also good. However it would requires slightly changing the structure of the script, which is not under test yet. I prefer not to refactor it if it just works for now. We may want to refactor it next time when there is a need to change the script.