|
21 | 21 | ./Tools/wasm/wasm_builder.py --clean build build |
22 | 22 |
|
23 | 23 | """ |
| 24 | + |
24 | 25 | import argparse |
25 | 26 | import enum |
26 | 27 | import dataclasses |
|
67 | 68 |
|
68 | 69 | # path to Emscripten SDK config file. |
69 | 70 | # 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 | +) |
71 | 74 | EMSDK_MIN_VERSION = (3, 1, 19) |
72 | 75 | EMSDK_BROKEN_VERSION = { |
73 | 76 | (3, 1, 14): "https://github.com/emscripten-core/emscripten/issues/17338", |
@@ -261,8 +264,7 @@ def _check_emscripten() -> None: |
261 | 264 | # git / upstream / tot-upstream installation |
262 | 265 | version = version[:-4] |
263 | 266 | 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(".")) |
266 | 268 | ) |
267 | 269 | if version_tuple < EMSDK_MIN_VERSION: |
268 | 270 | raise ConditionError( |
@@ -518,7 +520,7 @@ def make_cmd(self) -> List[str]: |
518 | 520 | def getenv(self) -> Dict[str, Any]: |
519 | 521 | """Generate environ dict for platform""" |
520 | 522 | env = os.environ.copy() |
521 | | - if hasattr(os, 'process_cpu_count'): |
| 523 | + if hasattr(os, "process_cpu_count"): |
522 | 524 | cpu_count = os.process_cpu_count() |
523 | 525 | else: |
524 | 526 | cpu_count = os.cpu_count() |
@@ -596,7 +598,9 @@ def run_py(self, *args: str) -> int: |
596 | 598 | """Run Python with hostrunner""" |
597 | 599 | self._check_execute() |
598 | 600 | 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", |
600 | 604 | ) |
601 | 605 |
|
602 | 606 | 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: |
666 | 670 | # Pre-build libbz2, libsqlite3, libz, and some system libs. |
667 | 671 | ports_cmd.extend(["-sUSE_ZLIB", "-sUSE_BZIP2", "-sUSE_SQLITE3"]) |
668 | 672 | # 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 | + ]) |
672 | 679 |
|
673 | 680 | self._run_cmd(embuilder_cmd, cwd=SRCDIR) |
674 | 681 |
|
@@ -817,7 +824,9 @@ def build_emports(self, force: bool = False) -> None: |
817 | 824 |
|
818 | 825 | # Don't list broken and experimental variants in help |
819 | 826 | 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 | +] |
821 | 830 | parser.add_argument( |
822 | 831 | "platform", |
823 | 832 | metavar="PLATFORM", |
|
0 commit comments