-
Notifications
You must be signed in to change notification settings - Fork 537
A warning/note message for reminding people to clone submodule after the first clone. #7243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This may be more work than we want to do, but I've seen some projects lazy-clone submodules at build time. That also carries the advantage of only pulling submodules that we actually need. If you aren't building all of the various NPU backends, for example, you don't have to pull them down. I believe CMake also has some level of git integration to help with this. Another closely related problem I've seen is forgetting to update submodules after pulling the latest ET. This can lead to weird build errors and sometimes takes me a few minutes to realize what's wrong. I'm not sure if there's a good way to detect this, though. |
Summary: Fixing #7243 As titled. This adds messages when we suspect the user forgot to update git submodule or cleanup the CMake cache. Test Plan: ``` rm -rf third-party/prelude ./install_executorch.sh ``` See the following error messages ``` Command failed: From load at implicit location Caused by: File not found: `prelude//prelude.bzl` CMake Error at build/Utils.cmake:230 (message): executorch: source list generation failed Call Stack (most recent call first): CMakeLists.txt:386 (extract_sources) -- Configuring incomplete, errors occurred! Traceback (most recent call last): File "<string>", line 643, in run File "/home/larryliu/miniconda3/envs/executorch/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 388, in spawn spawn(cmd, search_path, dry_run=self.dry_run) File "/home/larryliu/miniconda3/envs/executorch/lib/python3.11/site-packages/setuptools/_distutils/spawn.py", line 68, in spawn raise DistutilsExecError(f"command {cmd!r} failed with exit code {exitcode}") distutils.errors.DistutilsExecError: command '/home/larryliu/miniconda3/envs/executorch/bin/cmake' failed with exit code 1 ... Exception: command '/home/larryliu/miniconda3/envs/executorch/bin/cmake' failed with exit code 1 ExecuTorch: Either CMake cache is outdated or git submodules are not synced. ExecuTorch: Please run the following before retry: ExecuTorch: ./install_executorch.sh --clean ExecuTorch: git submodule update --init --recursive error: subprocess-exited-with-error ``` Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D69156975](https://our.internmc.facebook.com/intern/diff/D69156975) [ghstack-poisoned]
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 ``` See the following error: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D69156975](https://our.internmc.facebook.com/intern/diff/D69156975) [ghstack-poisoned]
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]
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]
* [BE] Remind users to update submodule Summary: As titled. This adds messages when we suspect the user forgot to update git submodule or cleanup the CMake cache. Test Plan: See the following error messages Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned] * Update on "[BE] Remind users to update submodule" Summary: Fixing #7243 As titled. This adds messages when we suspect the user forgot to update git submodule or cleanup the CMake cache. Test Plan: ``` rm -rf third-party/prelude ./install_executorch.sh ``` See the following error messages ``` Command failed: From load at implicit location Caused by: File not found: `prelude//prelude.bzl` CMake Error at build/Utils.cmake:230 (message): executorch: source list generation failed Call Stack (most recent call first): CMakeLists.txt:386 (extract_sources) -- Configuring incomplete, errors occurred! Traceback (most recent call last): File "<string>", line 643, in run File "/home/larryliu/miniconda3/envs/executorch/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 388, in spawn spawn(cmd, search_path, dry_run=self.dry_run) File "/home/larryliu/miniconda3/envs/executorch/lib/python3.11/site-packages/setuptools/_distutils/spawn.py", line 68, in spawn raise DistutilsExecError(f"command {cmd!r} failed with exit code {exitcode}") distutils.errors.DistutilsExecError: command '/home/larryliu/miniconda3/envs/executorch/bin/cmake' failed with exit code 1 ... Exception: command '/home/larryliu/miniconda3/envs/executorch/bin/cmake' failed with exit code 1 ExecuTorch: Either CMake cache is outdated or git submodules are not synced. ExecuTorch: Please run the following before retry: ExecuTorch: ./install_executorch.sh --clean ExecuTorch: git submodule update --init --recursive error: subprocess-exited-with-error ``` Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D69156975](https://our.internmc.facebook.com/intern/diff/D69156975) [ghstack-poisoned] * 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 ``` See the following error: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D69156975](https://our.internmc.facebook.com/intern/diff/D69156975) [ghstack-poisoned] * 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] * 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]
I just did a fresh clone, pulled in your PR (#8229) and tried install_executorch.sh, before the git submodule init/update steps. Here's my error: https://gist.github.com/mergennachin/e218cfe00b4809a14d2a2ffe4abd61f4 In your Test Plan, you didn't actually test a fresh clone scenario. |
@mergennachin I believe this is fixed. Can you retry? |
Closing for now feel free to reopen |
Here's my repro:
|
Ah sorry, should've run |
🚀 The feature, motivation and pitch
At first trial, they forgot to clone with submodule → got error cannot find “gflags“ → they need to remember to clone submodule.
Alternatives
No response
Additional context
No response
RFC (Optional)
No response
cc @larryliu0820
The text was updated successfully, but these errors were encountered: