Remove usage of environment variables in wheel building#9583
Merged
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/9583
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New Failures, 2 Pending, 2 Unrelated FailuresAs of commit 69a5ba4 with merge base 7248b19 ( NEW FAILURES - The following jobs have failed:
BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
d1a3972 to
578e720
Compare
578e720 to
4c96f33
Compare
4c96f33 to
93f6112
Compare
larryliu0820
approved these changes
Mar 25, 2025
swolchok
reviewed
Mar 25, 2025
6949e35 to
5501b06
Compare
b989433 to
36ae47e
Compare
mergennachin
approved these changes
Mar 25, 2025
63c33b8 to
a5e6fcf
Compare
a5e6fcf to
69a5ba4
Compare
jathu
added a commit
that referenced
this pull request
Mar 31, 2025
kirklandsign
pushed a commit
that referenced
this pull request
Apr 11, 2025
### Summary We seem to be using a combination of CMAKE_ARGS and environment variables when creating wheels. Ultimately, CMake only uses the cmake args, however we redefine some of these flags as env vars to help `setup.py` determine if a certain feature is turned on. Specifically, it looks for pybinding vars to bundle pybindings. Let's remove this redundancy and just use the CMAKE_ARGS as the single source of truth. For more details and other considerations, see #9494 (abandoned). Note that even in the wheel building jobs, we use cmake args instead of environment variables to control features: https://github.com/pytorch/executorch/blob/644b7ddf14180d97e348faa627f576e13d367d69/.ci/scripts/wheel/envvar_base.sh#L20 https://github.com/pytorch/executorch/blob/644b7ddf14180d97e348faa627f576e13d367d69/.ci/scripts/wheel/envvar_macos.sh#L14-L15 ### Test plan build + check CMakeCache.txt to ensure flags are set ```bash # Expected: EXECUTORCH_BUILD_PYBIND=OFF EXECUTORCH_BUILD_XNNPACK=OFF EXECUTORCH_BUILD_COREML=OFF $ rm -rf pip-out dist && ./install_executorch.sh --pybind off # Expected: EXECUTORCH_BUILD_PYBIND=ON EXECUTORCH_BUILD_XNNPACK=ON EXECUTORCH_BUILD_COREML=OFF $ rm -rf pip-out dist && ./install_executorch.sh # Expected: EXECUTORCH_BUILD_PYBIND=ON EXECUTORCH_BUILD_XNNPACK=OFF EXECUTORCH_BUILD_COREML=ON $ rm -rf pip-out dist && ./install_executorch.sh --pybind coreml # Expected: EXECUTORCH_BUILD_PYBIND=ON EXECUTORCH_BUILD_XNNPACK=ON EXECUTORCH_BUILD_COREML=ON $ rm -rf pip-out dist && ./install_executorch.sh --pybind xnnpack coreml # Throws an error $ rm -rf pip-out dist && ./install_executorch.sh --pybind coreml off ``` cc @larryliu0820 @lucylq
kirklandsign
pushed a commit
that referenced
this pull request
Apr 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
We seem to be using a combination of CMAKE_ARGS and environment variables when creating wheels. Ultimately, CMake only uses the cmake args, however we redefine some of these flags as env vars to help
setup.pydetermine if a certain feature is turned on. Specifically, it looks for pybinding vars to bundle pybindings.Let's remove this redundancy and just use the CMAKE_ARGS as the single source of truth. For more details and other considerations, see #9494 (abandoned).
Note that even in the wheel building jobs, we use cmake args instead of environment variables to control features:
executorch/.ci/scripts/wheel/envvar_base.sh
Line 20 in 644b7dd
executorch/.ci/scripts/wheel/envvar_macos.sh
Lines 14 to 15 in 644b7dd
Test plan
build + check CMakeCache.txt to ensure flags are set
cc @larryliu0820 @lucylq