-
Notifications
You must be signed in to change notification settings - Fork 608
Package headers into pip wheel #5734
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
Conversation
Summary: Add a new BaseExtension - HeaderFile. It takes a source directory relative to ExecuTorch root and copies all headers recursively into pip wheel during packaging. The destination is hardcoded to `executorch/include/executorch` in the pip wheel. Test Plan: ```bash python setup.py bdist_wheel ``` This prints out the following lines: ``` creating pip-out/bdist.linux-x86_64/wheel/executorch/include/executorch/runtime creating pip-out/bdist.linux-x86_64/wheel/executorch/include/executorch/runtime/core copying pip-out/lib.linux-x86_64-cpython-311/executorch/include/executorch/runtime/core/array_ref.h -> pip-out/bdist.linux-x86_64/wheel/executorch/include/executorch/runtime/core ... ``` Then install the wheel: ```bash pip install dist/executorch-0.5.0a0+52d5218-cp311-cp311-linux_x86_64.whl ``` And we can find the headers in site-packages ``` /data/users/larryliu/executorch/pip-out/lib.linux-x86_64-cpython-311/executorch/include/executorch/runtime/core/array_ref.h ``` Reviewers: Subscribers: Tasks: Tags:
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/5734
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 32f63ed with merge base 52d5218 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the test plan, please also make sure that you can import and use pybindings, and that flatc
is on your path and still works.
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should have picked up on this earlier. Things are awkward because this is breaking a core aspect of the "build extension" concept.
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Way simpler, thanks! :D Please update the PR description to describe the final form of the change, but it looks great.
@larryliu0820 merged this pull request in d62c7ad. |
@pytorchbot cherry-pick --onto release/0.4 -c fixnewfeature |
Summary: Changes `CustomBuildPy` to take a list of source directories relative to ExecuTorch root and copies all headers recursively into pip wheel during packaging. The destination is hardcoded to `executorch/include/executorch` in the pip wheel. Pull Request resolved: #5734 Test Plan: ```bash python setup.py bdist_wheel ``` This prints out the following lines: ``` creating pip-out/bdist.linux-x86_64/wheel/executorch/include/executorch/runtime creating pip-out/bdist.linux-x86_64/wheel/executorch/include/executorch/runtime/core copying pip-out/lib.linux-x86_64-cpython-311/executorch/include/executorch/runtime/core/array_ref.h -> pip-out/bdist.linux-x86_64/wheel/executorch/include/executorch/runtime/core ... ``` Then install the wheel: ```bash pip install dist/executorch-0.5.0a0+52d5218-cp311-cp311-linux_x86_64.whl ``` And we can find the headers in site-packages ``` /data/users/larryliu/executorch/pip-out/lib.linux-x86_64-cpython-311/executorch/include/executorch/runtime/core/array_ref.h ``` Reviewed By: dbort Differential Revision: D63561966 Pulled By: larryliu0820 fbshipit-source-id: 0c7d8983a89d11e62da006d361ca00b4a061d73c (cherry picked from commit d62c7ad)
Cherry picking #5734The cherry pick PR is at #6138 and it is recommended to link a fixnewfeature cherry pick PR with an issue. The following tracker issues are updated: Details for Dev Infra teamRaised by workflow job |
Summary: Changes `CustomBuildPy` to take a list of source directories relative to ExecuTorch root and copies all headers recursively into pip wheel during packaging. The destination is hardcoded to `executorch/include/executorch` in the pip wheel. Pull Request resolved: #5734 Test Plan: ```bash python setup.py bdist_wheel ``` This prints out the following lines: ``` creating pip-out/bdist.linux-x86_64/wheel/executorch/include/executorch/runtime creating pip-out/bdist.linux-x86_64/wheel/executorch/include/executorch/runtime/core copying pip-out/lib.linux-x86_64-cpython-311/executorch/include/executorch/runtime/core/array_ref.h -> pip-out/bdist.linux-x86_64/wheel/executorch/include/executorch/runtime/core ... ``` Then install the wheel: ```bash pip install dist/executorch-0.5.0a0+52d5218-cp311-cp311-linux_x86_64.whl ``` And we can find the headers in site-packages ``` /data/users/larryliu/executorch/pip-out/lib.linux-x86_64-cpython-311/executorch/include/executorch/runtime/core/array_ref.h ``` Reviewed By: dbort Differential Revision: D63561966 Pulled By: larryliu0820 fbshipit-source-id: 0c7d8983a89d11e62da006d361ca00b4a061d73c (cherry picked from commit d62c7ad)
Package headers into pip wheel (#5734) Summary: Changes `CustomBuildPy` to take a list of source directories relative to ExecuTorch root and copies all headers recursively into pip wheel during packaging. The destination is hardcoded to `executorch/include/executorch` in the pip wheel. Pull Request resolved: #5734 Test Plan: ```bash python setup.py bdist_wheel ``` This prints out the following lines: ``` creating pip-out/bdist.linux-x86_64/wheel/executorch/include/executorch/runtime creating pip-out/bdist.linux-x86_64/wheel/executorch/include/executorch/runtime/core copying pip-out/lib.linux-x86_64-cpython-311/executorch/include/executorch/runtime/core/array_ref.h -> pip-out/bdist.linux-x86_64/wheel/executorch/include/executorch/runtime/core ... ``` Then install the wheel: ```bash pip install dist/executorch-0.5.0a0+52d5218-cp311-cp311-linux_x86_64.whl ``` And we can find the headers in site-packages ``` /data/users/larryliu/executorch/pip-out/lib.linux-x86_64-cpython-311/executorch/include/executorch/runtime/core/array_ref.h ``` Reviewed By: dbort Differential Revision: D63561966 Pulled By: larryliu0820 fbshipit-source-id: 0c7d8983a89d11e62da006d361ca00b4a061d73c (cherry picked from commit d62c7ad) Co-authored-by: Mengwei Liu <[email protected]>
Summary: Changes
CustomBuildPy
to take a list of source directories relative to ExecuTorch root and copies all headers recursively into pip wheel during packaging.The destination is hardcoded to
executorch/include/executorch
in the pip wheel.Test Plan:
This prints out the following lines:
Then install the wheel:
And we can find the headers in site-packages
Reviewers:
Subscribers:
Tasks:
Tags: