Skip to content

Commit 64d1900

Browse files
committed
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]
1 parent 62098d7 commit 64d1900

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ def __init__(self, src: str, modpath: str):
360360
"/" not in modpath
361361
), f"modpath must be a dotted python module path: saw '{modpath}'"
362362
# This is a real extension, so use the modpath as the name.
363-
super().__init__(src=src, dst=modpath, name=modpath)
363+
super().__init__(src=f"%CMAKE_CACHE_DIR%/{src}", dst=modpath, name=modpath)
364364

365365
def src_path(self, installer: "InstallerBuildExt") -> Path:
366366
"""Returns the path to the source file, resolving globs.

0 commit comments

Comments
 (0)