-
Notifications
You must be signed in to change notification settings - Fork 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
makesystem: speedup pkg cloning if no git-cache is available #16316
Conversation
Maybe it makes more sense to clone with E.g. I would expect developers contributing to e.g. NanoCBOR to have the corresponding Repo cloned elsewhere with full history anyway. Maybe @bergzand and @benpicco have an opinion, as they contribute to other stuff packed in RIOT as well. |
i think you can't clone non braches -> --depth=1 will give you a branch that you do not want since RIOT pkgs want arbitrary commits |
If I take the wolfssl example the complete history is 9 MiB while the blobs are 150 MiB (wee need 7 of them) -> this this saves us ~89% but have all history at hand. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
Does gitcache need the blobs? If not can't we do the same thing in all cases and not include blobs? |
I think the profit wouldn't be worth it with git cache (if you are not short on diskspace on the build system (looking at murdock we are talking about the compile result cache which will be much bigger than what we would safe with this)) -the download size is also less of an issue with a git cache (--- I do not use git cache -> i can not speak much for its usage patters)
|
21b6493
to
b3b2ffa
Compare
@maribu : you might want to have a look at this i changed it to clone without history (depth=1) |
Code looks good to me. Please squash :) |
b3b2ffa
to
6e3c1f0
Compare
6e3c1f0
to
9566eba
Compare
there is no git clone left since git clone does not support getting specific commits ->: - init empty repo, - setup remote origin - configure - fetch - checkout
9566eba
to
cc3fc8e
Compare
rebased an squashed tried to avoid getting all tags - sadly some git segfaults in that case (so get all tags without blobs)
Would just get one tag or(if that fails) branch/commit but the github tools-buildtest action does not like that -> back to filter blobs |
The Murdock failure left is not related to this PR see #17894. I think we can skip compile. |
I did this for testing:
As seen, a chunk of storage is saved and the cloning subjectively felt faster with this PR. Hence, this works as advertised. And Murdock will do the regression testing :) |
The failure of tests/congure_reno/microbit:gnu should be unrelated. |
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.
ACK. As above shown I could confirm that storage requirements are reduced as advertised. Builds with git cache still work (as tested by Murdock with good test coverage) and without (as tested by hand with limited test coverage).
Contribution description
This clones repositories used by pkgs without downloading all the history. Due to git clone not being able to load a specific commit: this initializes the packages directory (PKG_SOURCE_DIR) adds the remote configures it and fetches the least amount of data to checkout the PKG_VERSION (commit-id or branch or tag)
for example: this reduces the download of wolfssl from 159.42 MiB to 9.70 MiB + 6.65 MiB ~=16.35MiB
this method or the previous git cache method is selected by the availability of the PATH named by $(GIT_CACHE_DIR) (default: $HOME/.gitcache)
Testing procedure
make a test/example that uses a pkg that uses a git repo
Issues/PRs references
non to my knowledge