Skip to content

[build] Fix flatc #8858

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Mar 1, 2025
Merged

Conversation

pytorchbot
Copy link
Collaborator

@pytorchbot pytorchbot commented Mar 1, 2025

Stack from ghstack (oldest at bottom):

Fixes #8784

  1. We need to install build/pip_data_bin_init.py.in into <executorch root>/data/bin/__init__.py. This PR rewrite the logic into a
    BuiltFile so that it works well in editable mode.

  2. Since BuiltFile by default looks into cmake cache directory, this PR adds a placeholder %CMAKE_CACHE_DIR% for those are actually built by CMake and for build/pip_data_bin_init.py.in we don't add this placeholder.

  3. Since editable mode doesn't support creating a directory in build command and install it as a new module, I need to create executorch/data/bin/ and add it to the pyproject.toml file, so that executorch.data.bin can be installed by editable mode.

Test:

python -c "from executorch.data.bin import flatc"

Added unittest-editable for Linux and Mac

cc @larryliu0820 @lucylq

* [build] Fix flatc

We need to install `build/pip_data_bin_init.py.in` into `<executorch
root>/data/bin/__init__.py`. This PR rewrite the logic into a
`BuiltFile` so that it works well in editable mode.

Test:

```
python -c "from executorch.data.bin import flatc"
```
Will add unit test in next PR.

[ghstack-poisoned]

* Update on "[build] Fix flatc"

Fixes #8784

We need to install `build/pip_data_bin_init.py.in` into `<executorch
root>/data/bin/__init__.py`. This PR rewrite the logic into a
`BuiltFile` so that it works well in editable mode.

Since `BuiltFile` by default looks into cmake cache directory, this PR adds a placeholder `%CMAKE_CACHE_DIR%` for those are actually built by CMake and for `build/pip_data_bin_init.py.in` we don't add this placeholder.

Test:

```
python -c "from executorch.data.bin import flatc"
```
Will add unit test in next PR.

[ghstack-poisoned]

* Update on "[build] Fix flatc"

Fixes #8784

We need to install `build/pip_data_bin_init.py.in` into `<executorch
root>/data/bin/__init__.py`. This PR rewrite the logic into a
`BuiltFile` so that it works well in editable mode.

Since `BuiltFile` by default looks into cmake cache directory, this PR adds a placeholder `%CMAKE_CACHE_DIR%` for those are actually built by CMake and for `build/pip_data_bin_init.py.in` we don't add this placeholder.

Test:

```
python -c "from executorch.data.bin import flatc"
```
Will add unit test in next PR.

[ghstack-poisoned]

* Update on "[build] Fix flatc"

Fixes #8784

We need to install `build/pip_data_bin_init.py.in` into `<executorch
root>/data/bin/__init__.py`. This PR rewrite the logic into a
`BuiltFile` so that it works well in editable mode.

Since `BuiltFile` by default looks into cmake cache directory, this PR adds a placeholder `%CMAKE_CACHE_DIR%` for those are actually built by CMake and for `build/pip_data_bin_init.py.in` we don't add this placeholder.

Test:

```
python -c "from executorch.data.bin import flatc"
```
Will add unit test in next PR.

[ghstack-poisoned]

(cherry picked from commit d0b27b5)
@pytorchbot pytorchbot mentioned this pull request Mar 1, 2025
Copy link

pytorch-bot bot commented Mar 1, 2025

🔗 Helpful Links

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

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

❌ 1 Cancelled Job

As of commit 21e77f5 with merge base 01c2f36 (image):

CANCELLED JOB - The following job was cancelled. Please retry:

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 Mar 1, 2025
@larryliu0820 larryliu0820 added module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch release notes: build Changes related to build, including dependency upgrades, build flags, optimizations, etc. labels Mar 1, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch release notes: build Changes related to build, including dependency upgrades, build flags, optimizations, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editable mode is error-ing out with flatc message
4 participants