gh-95853: WASM: better version and asset handling in scripts (GH-96045)

- support EMSDK tot-upstream and git releases
- allow WASM assents for wasm64-emscripten and WASI. This makes single file distributions on WASI easier.
- decouple WASM assets from browser builds
This commit is contained in:
Christian Heimes 2022-08-19 08:36:12 +02:00 committed by GitHub
parent 757c383d24
commit 6087f491ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 6 deletions

View file

@ -108,6 +108,14 @@ OMIT_MODULE_FILES = {
"_zoneinfo": ["zoneinfo/"],
}
SYSCONFIG_NAMES = (
"_sysconfigdata__emscripten_wasm32-emscripten",
"_sysconfigdata__emscripten_wasm32-emscripten",
"_sysconfigdata__wasi_wasm32-wasi",
"_sysconfigdata__wasi_wasm64-wasi",
)
def get_builddir(args: argparse.Namespace) -> pathlib.Path:
"""Get builddir path from pybuilddir.txt
"""
@ -120,7 +128,11 @@ def get_sysconfigdata(args: argparse.Namespace) -> pathlib.Path:
"""Get path to sysconfigdata relative to build root
"""
data_name = sysconfig._get_sysconfigdata_name()
assert "emscripten_wasm32" in data_name
if not data_name.startswith(SYSCONFIG_NAMES):
raise ValueError(
f"Invalid sysconfig data name '{data_name}'.",
SYSCONFIG_NAMES
)
filename = data_name + ".py"
return args.builddir / filename