Skip to content

Package headers into pip wheel #6138

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

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

pytorchbot
Copy link
Collaborator

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:

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:

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:

Copy link

pytorch-bot bot commented Oct 10, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/6138

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures

As of commit 9c3c804 with merge base eecf74f (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 10, 2024
Copy link
Contributor

@jackzhxng jackzhxng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferring to @dbort

@jackzhxng jackzhxng requested a review from dbort October 11, 2024 01:30
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)
@larryliu0820 larryliu0820 force-pushed the cherry-pick-5734-by-pytorch_bot_bot_ branch from d3f40f2 to 9c3c804 Compare October 11, 2024 16:17
@larryliu0820
Copy link
Contributor

Rebased

@larryliu0820 larryliu0820 merged commit 0635968 into release/0.4 Oct 11, 2024
94 of 96 checks passed
@larryliu0820 larryliu0820 deleted the cherry-pick-5734-by-pytorch_bot_bot_ branch October 11, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants