diff options
author | Christian Heimes <christian@python.org> | 2022-08-15 07:41:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-15 07:41:10 +0200 |
commit | 4a7f5a55dc88c14cef880ae38a96018514ca9d83 (patch) | |
tree | 5c93774d5687c3c480006803e6accc72b5516812 | |
parent | e8259e047c42976427b08f100b9d8ba52db7ee69 (diff) | |
download | cpython-git-4a7f5a55dc88c14cef880ae38a96018514ca9d83.tar.gz |
gh-95853: Address wasm build and test issues (GH-95985)
-rw-r--r-- | Lib/test/test_decimal.py | 3 | ||||
-rw-r--r-- | Modules/pyexpat.c | 2 | ||||
-rwxr-xr-x | Tools/wasm/wasm_build.py | 15 |
3 files changed, 14 insertions, 6 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index f7a47c86a3..7c5964e3d5 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -37,7 +37,7 @@ from test.support import (run_unittest, run_doctest, is_resource_enabled, requires_legacy_unicode_capi, check_sanitizer) from test.support import (TestFailed, run_with_locale, cpython_only, - darwin_malloc_err_warning) + darwin_malloc_err_warning, is_emscripten) from test.support.import_helper import import_fresh_module from test.support import threading_helper from test.support import warnings_helper @@ -5605,6 +5605,7 @@ class CWhitebox(unittest.TestCase): # Issue 41540: @unittest.skipIf(sys.platform.startswith("aix"), "AIX: default ulimit: test is flaky because of extreme over-allocation") + @unittest.skipIf(is_emscripten, "Test is unstable on Emscripten") @unittest.skipIf(check_sanitizer(address=True, memory=True), "ASAN/MSAN sanitizer defaults to crashing " "instead of returning NULL for malloc failure.") diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index 678347331e..165cb0effa 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -775,7 +775,7 @@ readinst(char *buf, int buf_size, PyObject *meth) Py_ssize_t len; const char *ptr; - str = PyObject_CallFunction(meth, "n", buf_size); + str = PyObject_CallFunction(meth, "i", buf_size); if (str == NULL) goto error; diff --git a/Tools/wasm/wasm_build.py b/Tools/wasm/wasm_build.py index e7a1f4a600..df90f01a27 100755 --- a/Tools/wasm/wasm_build.py +++ b/Tools/wasm/wasm_build.py @@ -191,7 +191,11 @@ EMSCRIPTEN = Platform( config_site=WASMTOOLS / "config.site-wasm32-emscripten", configure_wrapper=EMSCRIPTEN_ROOT / "emconfigure", make_wrapper=EMSCRIPTEN_ROOT / "emmake", - environ={"EM_COMPILER_WRAPPER": "ccache"} if HAS_CCACHE else {}, + environ={ + # workaround for https://github.com/emscripten-core/emscripten/issues/17635 + "TZ": "UTC", + "EM_COMPILER_WRAPPER": "ccache" if HAS_CCACHE else None, + }, check=_check_emscripten, ) @@ -352,12 +356,15 @@ class BuildProfile: env.setdefault("MAKEFLAGS", f"-j{os.cpu_count()}") platenv = self.host.platform.getenv(self) for key, value in platenv.items(): - if isinstance(value, str): - value = value.format( + if value is None: + env.pop(key, None) + elif isinstance(value, str): + env[key] = value.format( relbuilddir=self.builddir.relative_to(SRCDIR), srcdir=SRCDIR, ) - env[key] = value + else: + env[key] = value return env def _run_cmd(self, cmd: Iterable[str], args: Iterable[str]): |