Being more flexible in when not to explicitly set the sysroot when compiling for WASI (GH-142242)
(cherry picked from commit
c5252045d3a7164f1829503d122091b5e469fda3)
Co-authored-by: Brett Cannon <brett@python.org>
for env_var, binary_name in list(env.items()):
env[env_var] = os.fsdecode(wasi_sdk_path / "bin" / binary_name)
- if wasi_sdk_path != pathlib.Path("/opt/wasi-sdk"):
+ if not wasi_sdk_path.name.startswith("wasi-sdk"):
for compiler in ["CC", "CPP", "CXX"]:
env[compiler] += f" --sysroot={sysroot}"