[3.14] Being more flexible in when not to explicitly set the sysroot when compiling for WASI (GH-142242) (GH-142246)

Being more flexible in when not to explicitly set the sysroot when compiling for WASI (GH-142242)
(cherry picked from commit c5252045d3)

Co-authored-by: Brett Cannon <brett@python.org>
This commit is contained in:
Miss Islington (bot) 2025-12-04 01:16:37 +01:00 committed by GitHub
parent 319c6a2ae1
commit afaa3b02f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -269,7 +269,7 @@ def wasi_sdk_env(context):
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}"