From 1b4facd83990cca66d6b13c2d794f727bf2636f3 Mon Sep 17 00:00:00 2001 From: Anthony Shoumikhin Date: Mon, 14 Apr 2025 11:04:42 -0700 Subject: [PATCH] Clone submodules recursively in install_executorch.py (#10131) Somehow we still don't clone submodules recursively for some submodules, like tokenizers (cherry picked from commit d28670b182fb18eb6c01e66f08e3a7480e3677e5) --- install_executorch.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/install_executorch.py b/install_executorch.py index 491ba19dec1..97f1d53488e 100644 --- a/install_executorch.py +++ b/install_executorch.py @@ -116,8 +116,10 @@ def check_folder(folder: str, file: str) -> bool: if missing_submodules: logger.warning("Some required submodules are missing. Updating submodules...") try: - subprocess.check_call(["git", "submodule", "sync"]) - subprocess.check_call(["git", "submodule", "update", "--init"]) + subprocess.check_call(["git", "submodule", "sync", "--recursive"]) + subprocess.check_call( + ["git", "submodule", "update", "--init", "--recursive"] + ) except subprocess.CalledProcessError as e: logger.error(f"Error updating submodules: {e}") exit(1) @@ -126,13 +128,10 @@ def check_folder(folder: str, file: str) -> bool: for path, file in missing_submodules.items(): if not check_folder(path, file): logger.error(f"{file} not found in {path}.") - logger.error("Please run `git submodule update --init`.") + logger.error( + "Submodule update failed. Please run `git submodule update --init --recursive` manually." + ) exit(1) - # Go into tokenizers submodule and install its submodules - tokenizers_path = get_required_submodule_paths().get("tokenizers", None) - if tokenizers_path: - with pushd(tokenizers_path): - subprocess.check_call(["git", "submodule", "update", "--init"]) logger.info("All required submodules are present.")