mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
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:
parent
757c383d24
commit
6087f491ea
5 changed files with 42 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue