From ed3c95d9d7f5157b4edd95a88705e851bf2a46ba Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 13 Oct 2025 17:46:32 +0500 Subject: [PATCH] build-all.py - move unsupported dependencies to script --- nix/build-all.py | 24 ++++++++++++++++++++++-- pyodide/meta.yaml | 2 +- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/nix/build-all.py b/nix/build-all.py index 5e231a4cfa..51485dd6bc 100644 --- a/nix/build-all.py +++ b/nix/build-all.py @@ -381,6 +381,23 @@ else: targets = set(dependency_tree.keys()) targets = set(t for t in targets if "without-%s" % t.lower() not in flags) +if WASM: + SKIP_TARGETS_FOR_WASM = { + "hdf5", + "rocksdb", + "opencollada", + "swig", + "pcre", + "pcre2", + "IfcGeom", + "IfcConvert", + "IfcGeomServer", + } + SKIP_TARGETS_FOR_WASM = {t.lower() for t in SKIP_TARGETS_FOR_WASM} + skip_targets = {t for t in targets if t.lower() in SKIP_TARGETS_FOR_WASM} + if skip_targets: + cecho(f"Skipping targets for wasm build: {', '.join(sorted(skip_targets))}", YELLOW) + targets.difference_update(skip_targets) print("Building:", *sorted(targets, key=lambda t: len(list(gather_dependencies(t))))) @@ -389,7 +406,10 @@ yacc = "yacc" # Used during swig building process, installed with `bison` on De missing_commands: "list[str]" = [] required_commands = [git, bunzip2, tar, cc, cplusplus, autoconf, automake, make, "patch", "cmake", yacc, xz] if "wasm" in flags: - required_commands.remove(yacc) # yacc not needed for wasm builds + # Skip swig build for WASM. + required_commands.append("swig") + required_commands.remove(yacc) + for cmd in required_commands: if which(cmd) is None: missing_commands.append(cmd) @@ -1384,7 +1404,7 @@ if "rocksdb" in targets: ] ) -if not explicit_targets or {"IfcGeom", "IfcConvert", "IfcGeomServer"} & set(explicit_targets): +if not WASM and (not explicit_targets or {"IfcGeom", "IfcConvert", "IfcGeomServer"} & set(explicit_targets)): logger.info("\rConfiguring executables...") exec_args = [ diff --git a/pyodide/meta.yaml b/pyodide/meta.yaml index f18eceb0b2..8878f6d76f 100644 --- a/pyodide/meta.yaml +++ b/pyodide/meta.yaml @@ -7,7 +7,7 @@ source: build: script: | - BUILD_CFG=Release python nix/build-all.py --without-rocksdb --without-hdf5 --without-opencollada --without-swig --without-pcre -v --wasm --py313 IfcOpenShell-Python + BUILD_CFG=Release python nix/build-all.py -v --wasm --py313 mv package/ifcopenshell . cp pyodide/setup.py .