Skip to content

Commit 1ab1f55

Browse files
committed
Install: stop pulling every submodule when a required one is missing
check_and_update_submodules() ran a bare `git submodule update --init --recursive` whenever a required submodule was absent, which fetched all ~24 submodules including llama.cpp and mlx, even though the default build uses neither. Update only the missing required paths instead. flatcc is built unconditionally by third-party/CMakeLists.txt but was only ever fetched as a side effect of the bulk update, so add it to REQUIRED_SUBMODULES. Mark llama.cpp shallow like mlx to trim its clone. This PR was authored with the assistance of Claude Code.
1 parent 4628b2b commit 1ab1f55

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎.gitmodules‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,4 @@
7171
[submodule "backends/native/third-party/llama.cpp"]
7272
path = backends/native/third-party/llama.cpp
7373
url = https://github.com/ggml-org/llama.cpp.git
74+
shallow = true

‎install_executorch.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def clean():
9696
"cpuinfo": "CMakeLists.txt",
9797
"eigen": "CMakeLists.txt",
9898
"flatbuffers": "CMakeLists.txt",
99+
"flatcc": "CMakeLists.txt",
99100
"FP16": "CMakeLists.txt",
100101
"FXdiv": "CMakeLists.txt",
101102
"gflags": "CMakeLists.txt",
@@ -145,7 +146,8 @@ def check_folder(folder: str, file: str) -> bool:
145146
try:
146147
subprocess.check_call(["git", "submodule", "sync", "--recursive"])
147148
subprocess.check_call(
148-
["git", "submodule", "update", "--init", "--recursive"]
149+
["git", "submodule", "update", "--init", "--recursive", "--"]
150+
+ list(missing_submodules)
149151
)
150152
except subprocess.CalledProcessError as e:
151153
logger.error(f"Error updating submodules: {e}")

0 commit comments

Comments
 (0)