Skip to content

Commit b2f5468

Browse files
Clone submodules recursively in install_executorch.py (#10140)
Somehow we still don't clone submodules recursively for some submodules, like tokenizers Co-authored-by: Anthony Shoumikhin <[email protected]>
1 parent 9c3b80d commit b2f5468

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

install_executorch.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,10 @@ def check_folder(folder: str, file: str) -> bool:
116116
if missing_submodules:
117117
logger.warning("Some required submodules are missing. Updating submodules...")
118118
try:
119-
subprocess.check_call(["git", "submodule", "sync"])
120-
subprocess.check_call(["git", "submodule", "update", "--init"])
119+
subprocess.check_call(["git", "submodule", "sync", "--recursive"])
120+
subprocess.check_call(
121+
["git", "submodule", "update", "--init", "--recursive"]
122+
)
121123
except subprocess.CalledProcessError as e:
122124
logger.error(f"Error updating submodules: {e}")
123125
exit(1)
@@ -126,13 +128,10 @@ def check_folder(folder: str, file: str) -> bool:
126128
for path, file in missing_submodules.items():
127129
if not check_folder(path, file):
128130
logger.error(f"{file} not found in {path}.")
129-
logger.error("Please run `git submodule update --init`.")
131+
logger.error(
132+
"Submodule update failed. Please run `git submodule update --init --recursive` manually."
133+
)
130134
exit(1)
131-
# Go into tokenizers submodule and install its submodules
132-
tokenizers_path = get_required_submodule_paths().get("tokenizers", None)
133-
if tokenizers_path:
134-
with pushd(tokenizers_path):
135-
subprocess.check_call(["git", "submodule", "update", "--init"])
136135
logger.info("All required submodules are present.")
137136

138137

0 commit comments

Comments
 (0)