We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ac68932 commit b5ae0b9Copy full SHA for b5ae0b9
1 file changed
exir/_serialize/_flatbuffer.py
@@ -11,6 +11,7 @@
11
import os
12
import re
13
import shutil
14
+import stat
15
import subprocess
16
17
import tempfile
@@ -252,6 +253,15 @@ def _run_flatc(args: Sequence[str]) -> None:
252
253
if flatc_resource.is_file():
254
# Use the provided flatc binary.
255
with importlib.resources.as_file(flatc_resource) as flatc_path:
256
+ # Ensure the binary has execute permissions (needed for PAR files)
257
+ try:
258
+ current_mode = flatc_path.stat().st_mode
259
+ if not (current_mode & stat.S_IXUSR):
260
+ flatc_path.chmod(
261
+ current_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
262
+ )
263
+ except OSError:
264
+ pass
265
subprocess.run([flatc_path] + list(args), check=True)
266
else:
267
# Expect the `flatc` tool to be on the system path or set as an env var.
0 commit comments