-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
py/mkrules.mk: Use partial clone for submodules if available. #16163
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
Conversation
Code size report:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #16163 +/- ##
=======================================
Coverage 98.57% 98.57%
=======================================
Files 164 164
Lines 21349 21349
=======================================
Hits 21045 21045
Misses 304 304 ☔ View full report in Codecov by Sentry. |
457663f
to
c3571dd
Compare
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 looks handy, thanks @andrewleech!
MicroPython relies on a number of submodules for third party and chip vendor libraries. Users need to check these out before building their desired ports and Github Actions CI here needs to clone them all multiple times for every build. Many of these are getting significantly larger over time, slowing down usage and consuming more disk space. Newer versions of git have features to avoid pulling all historic / blob data which can have a significant impact of total data use. This commit uses a standard feature of git to do a partial clone, with automatic fallback to previous behavior on error. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
c3571dd
to
fdd606d
Compare
@andrewleech running Eg in
|
Yeah I've seen that pop up in a couple of issue reports too! It certainly was unintentional, I didn't realise a comment there would be echo'd. I've seen comments above make targets before and thought that looked a bit ugly / out of context but now I understand why. |
I made a PR to fix this comment in #16595. |
Summary
Micropython relies on a number of submodules for third party and chip vendor libraries. Users need to check these out before building their desired ports and Github Actions CI here needs to clone them all multiple times for every build.
Many of these are getting significantly larger over time, slowing down usage and consuming more disk space. There can also be resistance to adding larger libraries / sdk's here as submodules to avoid these sort of issues.
As suggested in #11349 (comment) by @dhalbert newer version of git have features to avoid pulling all historic / blob data which can have a significant impact of total data use.
The change here has been directly inspired by adafruit#7225 and adafruit#7788
Testing
Very little so far, it's been pushed here to trigger CI to ensure it still passes and hopefully get an idea of any speed improvements gained.
This is using a standard feature of git with automatic fallback to previous behavior on error.
Trade-offs and Alternatives
Shallow clone is the more common way of achieving this but that often results in issues due to the lack of history metadata, particularly around versions derived from tags etc. While that's less often an issue in submodules this filter method is generally considered a safer means of gaining similar size improvements.