Skip to content

Commit 99b1539

Browse files
shoumikhinfacebook-github-bot
authored andcommitted
Pass flatc executable path via env var for exir serializer. (#568)
Summary: Pull Request resolved: #568 Reviewed By: dbort Differential Revision: D49843232 fbshipit-source-id: e28768f6e4ec906f3ee794f8e94b1eca712efc54
1 parent 80ee5f6 commit 99b1539

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

exir/_serialize/_flatbuffer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,9 @@ def _run_flatc(args: Sequence[str]) -> None:
186186
with importlib.resources.path(__package__, _FLATC_RESOURCE_NAME) as flatc_path:
187187
subprocess.run([flatc_path] + list(args), check=True)
188188
else:
189-
# Expect the `flatc` tool to be on the system path.
190-
subprocess.run(["flatc"] + list(args), check=True)
189+
# Expect the `flatc` tool to be on the system path or set as an env var.
190+
flatc_path = os.getenv("FLATC_EXECUTABLE", "flatc")
191+
subprocess.run([flatc_path] + list(args), check=True)
191192

192193

193194
def _flatc_compile(output_dir: str, schema_path: str, json_path: str) -> None:

0 commit comments

Comments
 (0)