Skip to content

Commit 459d59f

Browse files
Fix wasm_build
1 parent e6a1d23 commit 459d59f

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

Tools/wasm/wasm_build.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
./Tools/wasm/wasm_builder.py --clean build build
2222
2323
"""
24+
2425
import argparse
2526
import enum
2627
import dataclasses
@@ -67,7 +68,9 @@
6768

6869
# path to Emscripten SDK config file.
6970
# auto-detect's EMSDK in /opt/emsdk without ". emsdk_env.sh".
70-
EM_CONFIG = pathlib.Path(os.environ.setdefault("EM_CONFIG", "/opt/emsdk/.emscripten"))
71+
EM_CONFIG = pathlib.Path(
72+
os.environ.setdefault("EM_CONFIG", "/opt/emsdk/.emscripten")
73+
)
7174
EMSDK_MIN_VERSION = (3, 1, 19)
7275
EMSDK_BROKEN_VERSION = {
7376
(3, 1, 14): "https://github.com/emscripten-core/emscripten/issues/17338",
@@ -261,8 +264,7 @@ def _check_emscripten() -> None:
261264
# git / upstream / tot-upstream installation
262265
version = version[:-4]
263266
version_tuple = cast(
264-
Tuple[int, int, int],
265-
tuple(int(v) for v in version.split("."))
267+
Tuple[int, int, int], tuple(int(v) for v in version.split("."))
266268
)
267269
if version_tuple < EMSDK_MIN_VERSION:
268270
raise ConditionError(
@@ -518,7 +520,7 @@ def make_cmd(self) -> List[str]:
518520
def getenv(self) -> Dict[str, Any]:
519521
"""Generate environ dict for platform"""
520522
env = os.environ.copy()
521-
if hasattr(os, 'process_cpu_count'):
523+
if hasattr(os, "process_cpu_count"):
522524
cpu_count = os.process_cpu_count()
523525
else:
524526
cpu_count = os.cpu_count()
@@ -596,7 +598,9 @@ def run_py(self, *args: str) -> int:
596598
"""Run Python with hostrunner"""
597599
self._check_execute()
598600
return self.run_make(
599-
"--eval", f"run: all; $(HOSTRUNNER) ./$(PYTHON) {shlex.join(args)}", "run"
601+
"--eval",
602+
f"run: all; $(HOSTRUNNER) ./$(PYTHON) {shlex.join(args)}",
603+
"run",
600604
)
601605

602606
def run_browser(self, bind: str = "127.0.0.1", port: int = 8000) -> None:
@@ -666,9 +670,12 @@ def build_emports(self, force: bool = False) -> None:
666670
# Pre-build libbz2, libsqlite3, libz, and some system libs.
667671
ports_cmd.extend(["-sUSE_ZLIB", "-sUSE_BZIP2", "-sUSE_SQLITE3"])
668672
# Multi-threaded sqlite3 has different suffix
669-
embuilder_cmd.extend(
670-
["build", "bzip2", "sqlite3-mt" if self.pthreads else "sqlite3", "zlib"]
671-
)
673+
embuilder_cmd.extend([
674+
"build",
675+
"bzip2",
676+
"sqlite3-mt" if self.pthreads else "sqlite3",
677+
"zlib",
678+
])
672679

673680
self._run_cmd(embuilder_cmd, cwd=SRCDIR)
674681

@@ -817,7 +824,9 @@ def build_emports(self, force: bool = False) -> None:
817824

818825
# Don't list broken and experimental variants in help
819826
platforms_choices = list(p.name for p in _profiles) + ["cleanall"]
820-
platforms_help = list(p.name for p in _profiles if p.support_level) + ["cleanall"]
827+
platforms_help = list(p.name for p in _profiles if p.support_level) + [
828+
"cleanall"
829+
]
821830
parser.add_argument(
822831
"platform",
823832
metavar="PLATFORM",

0 commit comments

Comments
 (0)