File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -324,9 +324,16 @@ def configure_wasi_python(context, working_dir):
324324 )
325325 lib_dir = os .fsdecode (lib_dirs [0 ])
326326 python_version = lib_dir .rpartition ("-" )[- 1 ]
327- sysconfig_data_dir = (
328- f"{ wasi_build_dir } /build/lib.wasi-wasm32-{ python_version } "
329- )
327+
328+ pybuilddir = working_dir / "pybuilddir.txt"
329+ if pybuilddir .is_file ():
330+ with pybuilddir .open ("r" , encoding = "utf-8" ) as f :
331+ sysconfig_data_dir = f"{ wasi_build_dir } /{ f .read ().strip ()} "
332+ else :
333+ # Fallback if the build hasn't generated the file yet
334+ sysconfig_data_dir = (
335+ f"{ wasi_build_dir } /build/lib.wasi-wasm32-{ python_version } "
336+ )
330337
331338 # Use PYTHONPATH to include sysconfig data which must be anchored to the
332339 # WASI guest's `/` directory.
You can’t perform that action at this time.
0 commit comments