Skip to content

gh-95853: Address wasm build and test issues (GH-95985) #95985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lib/test/test_decimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
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
Expand Down Expand Up @@ -5605,6 +5605,7 @@ def __abs__(self):
# 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.")
Expand Down
2 changes: 1 addition & 1 deletion Modules/pyexpat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
15 changes: 11 additions & 4 deletions Tools/wasm/wasm_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ def _check_emscripten():
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,
)

Expand Down Expand Up @@ -352,12 +356,15 @@ def getenv(self) -> dict:
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]):
Expand Down