mirror of
https://github.com/python/cpython.git
synced 2026-10-28 10:25:05 +08:00
GH-160135: Make sure the target triple makes it through configure (GH-160739)
This commit is contained in:
1 parent
d54c2d89b7
commit
4521718ca5
2 files changed
+16
-7
No files matched your search
@@ -565,10 +565,15 @@ class OtherFileTests:
|
||||
self.assertEqual(f.writable(), True)
|
||||
if sys.platform != "darwin" and \
|
||||
'bsd' not in sys.platform and \
|
||||
not sys.platform.startswith(('sunos', 'aix')):
|
||||
# Somehow /dev/tty appears seekable on some BSDs
|
||||
not sys.platform.startswith(('sunos', 'aix')) and \
|
||||
not is_wasi:
|
||||
# Somehow /dev/tty appears seekable on some BSDs and
|
||||
# WASI.
|
||||
self.assertEqual(f.seekable(), False)
|
||||
self.assertEqual(f.isatty(), True)
|
||||
if not is_wasi:
|
||||
# wasi-libc special-cases stdin to be a TTY, but
|
||||
# nothing else is supported.
|
||||
self.assertEqual(f.isatty(), True)
|
||||
f.close()
|
||||
finally:
|
||||
os.unlink(TESTFN)
|
||||
|
||||
@@ -181,8 +181,9 @@ 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 not wasi_sdk_path.name.startswith("wasi-sdk"):
|
||||
for compiler in ["CC", "CPP", "CXX"]:
|
||||
for compiler in ["CC", "CPP", "CXX"]:
|
||||
env[compiler] += f" --target={context.host_triple}"
|
||||
if not wasi_sdk_path.name.startswith("wasi-sdk"):
|
||||
env[compiler] += f" --sysroot={sysroot}"
|
||||
|
||||
env["PKG_CONFIG_PATH"] = ""
|
||||
@@ -229,7 +230,11 @@ def configure_wasi_python(context, working_dir):
|
||||
"https://github.com/bytecodealliance/wasmtime"
|
||||
)
|
||||
host_runner = context.host_runner.format_map(args)
|
||||
env_additions = {"CONFIG_SITE": config_site, "HOSTRUNNER": host_runner}
|
||||
env_additions = {
|
||||
"CONFIG_SITE": config_site,
|
||||
"HOSTRUNNER": host_runner,
|
||||
"CFLAGS": f"{os.environ.get('CFLAGS', '')} -DPY_CALL_TRAMPOLINE".strip(),
|
||||
}
|
||||
build_python = os.fsdecode(context.build_python_interpreter)
|
||||
# The path to `configure` MUST be relative, else `python.wasm` is unable
|
||||
# to find the stdlib due to Python not recognizing that it's being
|
||||
@@ -239,7 +244,6 @@ def configure_wasi_python(context, working_dir):
|
||||
f"--host={context.host_triple}",
|
||||
f"--build={context.build_python_path.name}",
|
||||
f"--with-build-python={build_python}",
|
||||
"CFLAGS=-DPY_CALL_TRAMPOLINE",
|
||||
]
|
||||
if context.is_debug:
|
||||
configure.append("--with-pydebug")
|
||||
|
||||
Reference in new issue
Block a user