Skip to content

Commit c8583b4

Browse files
committed
Update on "[BE] Remind users to update submodule"
Summary: Fixing #7243 As titled. This PR adds 2 things: 1. `check_and_update_submodule()` check if required submodule folders exist and at least contains a CMakeLists.txt file. 2. Give useful error when the submodule is corrupted (most likely missing a file, caused by submodule out of sync). Test Plan: 1. Test if we can still install, if submodule is not updated ``` rm -rf third-party/prelude ./install_executorch.sh ``` See the following log ``` ... Processing /data/users/larryliu/executorch Preparing metadata (pyproject.toml): started Running command Preparing metadata (pyproject.toml) 2025-02-05 11:28:46,430 [ExecuTorch] WARNING: Some required submodules are missing. Updating submodules... Submodule path 'third-party/prelude': checked out '851d3f09c452937fc5adef27e2c50f7f304f1646' 2025-02-05 11:28:46,748 [ExecuTorch] INFO: All required submodules are present. 2025-02-05 11:28:47,018 [ExecuTorch] INFO: running dist_info ... ``` This proves that we can update submodule for the user. 2. Test if we can give useful error message, if we are missing a file. ``` rm third-party/gflags/src/gflags.cc ./install_executorch.sh --clean ./install_executorch.sh ``` See the following error: ``` 2025-02-05 12:08:56,889 [ExecuTorch] ERROR: Failed to query buck for sources. Failed command: buck2 cquery inputs(deps('//runtime/executor:program')) This is likely due to missing git submodules or outdated CMake cache. Please run the following before retry: ./install_executorch.sh --clean git submodule update --init --recursive ``` Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D69156975](https://our.internmc.facebook.com/intern/diff/D69156975) [ghstack-poisoned]
1 parent e642591 commit c8583b4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

build/extract_sources.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ def get_sources(
138138
"to missing git submodules or outdated CMake cache. "
139139
"Please run the following before retry:\033[0m\n\n"
140140
" \033[32;1m./install_executorch.sh --clean\033[0m\n"
141-
" \033[32;1mgit submodule update --init --recursive\033[0m\n"
141+
" \033[32;1mgit submodule sync\033[0m\n"
142+
" \033[32;1mgit submodule update --init\033[0m\n"
142143
)
143144
raise e
144145

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,8 @@ def run(self):
740740
"\033[31;1mEither CMake cache is outdated or git submodules are not synced.\n"
741741
"Please run the following before retry:\033[0m\n"
742742
" \033[32;1m./install_executorch.sh --clean\033[0m\n"
743-
" \033[32;1mgit submodule update --init --recursive\033[0m\n"
743+
" \033[32;1mgit submodule sync\033[0m\n"
744+
" \033[32;1mgit submodule update --init\033[0m\n"
744745
)
745746
raise Exception(error + "\n" + additional_log) from e
746747

0 commit comments

Comments
 (0)