You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove usage of environment variables in wheel building (#9583)
### 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#L20https://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
0 commit comments