Skip to content

Commit d28670b

Browse files
authored
Clone submodules recursively in install_executorch.py (#10131)
Somehow we still don't clone submodules recursively for some submodules, like tokenizers
1 parent d0f8288 commit d28670b

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

install_executorch.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,10 @@ def check_folder(folder: str, file: str) -> bool:
120120
if missing_submodules:
121121
logger.warning("Some required submodules are missing. Updating submodules...")
122122
try:
123-
subprocess.check_call(["git", "submodule", "sync"])
124-
subprocess.check_call(["git", "submodule", "update", "--init"])
123+
subprocess.check_call(["git", "submodule", "sync", "--recursive"])
124+
subprocess.check_call(
125+
["git", "submodule", "update", "--init", "--recursive"]
126+
)
125127
except subprocess.CalledProcessError as e:
126128
logger.error(f"Error updating submodules: {e}")
127129
exit(1)
@@ -130,13 +132,10 @@ def check_folder(folder: str, file: str) -> bool:
130132
for path, file in missing_submodules.items():
131133
if not check_folder(path, file):
132134
logger.error(f"{file} not found in {path}.")
133-
logger.error("Please run `git submodule update --init`.")
135+
logger.error(
136+
"Submodule update failed. Please run `git submodule update --init --recursive` manually."
137+
)
134138
exit(1)
135-
# Go into tokenizers submodule and install its submodules
136-
tokenizers_path = get_required_submodule_paths().get("tokenizers", None)
137-
if tokenizers_path:
138-
with pushd(tokenizers_path):
139-
subprocess.check_call(["git", "submodule", "update", "--init"])
140139
logger.info("All required submodules are present.")
141140

142141

0 commit comments

Comments
 (0)