summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorAndrew Leech <andrew.leech@planetinnovation.com.au>2024-11-06 10:31:28 +1100
committerDamien George <damien@micropython.org>2024-12-10 17:17:17 +1100
commitfdd606dd5395d9c474775945fa4458a27199653b (patch)
tree70a844599d20c65129aa2bf8fe4f6ed1a8aea107 /py
parente8c3f31ba2e5f004dfb972131d5f7d7a961974c2 (diff)
downloadmicropython-fdd606dd5395d9c474775945fa4458a27199653b.tar.gz
micropython-fdd606dd5395d9c474775945fa4458a27199653b.zip
py/mkrules.mk: Use partial clone for submodules if available.
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>
Diffstat (limited to 'py')
-rw-r--r--py/mkrules.mk6
1 files changed, 5 insertions, 1 deletions
diff --git a/py/mkrules.mk b/py/mkrules.mk
index 0dc1cdfe15..875ddee852 100644
--- a/py/mkrules.mk
+++ b/py/mkrules.mk
@@ -252,7 +252,11 @@ submodules:
$(ECHO) "Updating submodules: $(GIT_SUBMODULES)"
ifneq ($(GIT_SUBMODULES),)
$(Q)cd $(TOP) && git submodule sync $(GIT_SUBMODULES)
- $(Q)cd $(TOP) && git submodule update --init $(GIT_SUBMODULES)
+ # If available, do blobless partial clones of submodules to save time and space.
+ # A blobless partial clone lazily fetches data as needed, but has all the metadata available (tags, etc.).
+ # Fallback to standard submodule update if blobless isn't available (earlier than 2.36.0)
+ $(Q)cd $(TOP) && git submodule update --init --filter=blob:none $(GIT_SUBMODULES) || \
+ git submodule update --init $(GIT_SUBMODULES)
endif
.PHONY: submodules