SIGN IN SIGN UP

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: https://github.com/pytorch/executorch/pull/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
M
Mengwei Liu committed
d62c7ad21dbf515091767c37b90564435fd08764
Parent: 2d0237c
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 10/1/2024, 7:59:36 PM