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
Summary:
Compatible with `python -m build -wheel` instead of using the deprecated `python setup.py bdist_wheel`.
A new custom build command builds all CMake targets, and a new custom build_ext command installs built files into the wheel.
A new custom build_py command copies platform-independent files into the wheel instead of copying them into the source tree.
Puts all generated files under `pip-out` instead of mixing with files in the tree.
Uses Command methods like `mkpath` and `copy_file` to benefit from setuptools concepts like dry_run, and to get logging for free.
Adds `flatc` to the wheel and puts it on the user's PATH. Removes the call to `install_flatc.sh` in `install_requirements.sh`; but, leaves the script in place since someone might want to run it on their own.
Also:
- Enables runtime logging for pybindings even in release mode
- Fixes another `-fPIC` requirement when building the `flatcc` host tools
- Picks a number of build jobs based on the cores in the system, instead of defaulting to 9
- Removes now-unnecessary steps from the Getting Started docs
- Removes a use of `${arg^^}`, which doesn't work with older versions of bash
Pull Request resolved: #2499
Test Plan:
Iteration command to test wheel building without completely rebuilding the system:
```
rm -rf \
/tmp/wheel-out \
pip-out/lib* \
pip-out/bdist.* \
pip-out/temp.*/cmake-out/CMake* \
executorch.egg-info \
third-party/flatcc/{bin,lib} \
; \
python setup.py bdist_wheel --dist-dir /tmp/wheel-out
```
To fully rebuild the system, also `rm -rf pip-out`.
The wheel file is written to (e.g.)
```
/tmp/wheel-out/executorch-0.1.0-cp310-cp310-linux_x86_64.whl
```
Examine it with `unzip -l`, or install it with `pip install /tmp/wheel-out/executorch*.whl`.
Also tested creating the wheel via `install_requirements.sh` and creating a simple model file.
```
./install_requirements.sh
python3 -m examples.portable.scripts.export --model_name="add"
<creates add.pte file>
```
Also tested that it can build pybindings with xnnpack when invoked via `install_requirements.sh`:
```
./install_requirements.sh --pybind xnnpack
python -m unittest backends/xnnpack/test/models/mobilenet_v2.py
```
Builds successfully, but trying to run the test currently fails during xnnpack init() due to T184024365. But it fails in the same way that the main branch does, so this new diff does not regress.
Reviewed By: GregoryComer
Differential Revision: D55436863
Pulled By: dbort
fbshipit-source-id: 06fd9b151a1aba1010b0da9571cd27116782125e
0 commit comments