From da28d127d724c0bfb449a535f94025a60525829e Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 31 Aug 2026 14:58:23 +0500 Subject: [PATCH] build-all: make BonsaiViewer a normal target, built by default Can be skipped using `--without-BonsaiViewer` as any other target, if needed. --- .github/workflows/build_osx.yml | 2 +- .github/workflows/build_rocky.yml | 2 +- .github/workflows/build_rocky_arm.yml | 2 +- nix/build-all.py | 12 +++++------- src/bonsaiviewer/docs/installation.rst | 4 ++-- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_osx.yml b/.github/workflows/build_osx.yml index 93a202820f..fb508672c8 100644 --- a/.github/workflows/build_osx.yml +++ b/.github/workflows/build_osx.yml @@ -104,7 +104,7 @@ jobs: # .dylib` failed to resolve at import time. ifcwrap now sets # INSTALL_RPATH to "@loader_path" on Apple. CXXFLAGS="-O3" CFLAGS="-O3 ${DARWIN_C_SOURCE}" ADD_COMMIT_SHA=1 BUILD_CFG=Release \ - BUILD_BONSAIVIEWER=ON QT_DIR="${QT_DIR}" \ + QT_DIR="${QT_DIR}" \ uv run ./nix/build-all.py -v --diskcleanup --ifcopenshell-shared ${MAC_INTEL} \ | tee build.log diff --git a/.github/workflows/build_rocky.yml b/.github/workflows/build_rocky.yml index 0e1078033f..45fdab650b 100644 --- a/.github/workflows/build_rocky.yml +++ b/.github/workflows/build_rocky.yml @@ -75,7 +75,7 @@ jobs: shell: bash run: | set -o pipefail - CXXFLAGS="-O3" CFLAGS="-O3" ADD_COMMIT_SHA=1 BUILD_CFG=Release BUILD_BONSAIVIEWER=ON \ + CXXFLAGS="-O3" CFLAGS="-O3" ADD_COMMIT_SHA=1 BUILD_CFG=Release \ uv run --with aqtinstall ./nix/build-all.py \ -v --diskcleanup --ifcopenshell-shared 2>&1 \ | tee build.log diff --git a/.github/workflows/build_rocky_arm.yml b/.github/workflows/build_rocky_arm.yml index 4ffd2cdc0d..3cd2921ec0 100644 --- a/.github/workflows/build_rocky_arm.yml +++ b/.github/workflows/build_rocky_arm.yml @@ -87,7 +87,7 @@ jobs: shell: bash run: | set -o pipefail - CXXFLAGS="-O3" CFLAGS="-O3" ADD_COMMIT_SHA=1 BUILD_CFG=Release BUILD_BONSAIVIEWER=ON \ + CXXFLAGS="-O3" CFLAGS="-O3" ADD_COMMIT_SHA=1 BUILD_CFG=Release \ uv run --with aqtinstall ./nix/build-all.py \ -v --diskcleanup --ifcopenshell-shared 2>&1 \ | tee build.log diff --git a/nix/build-all.py b/nix/build-all.py index 7e7791cc64..384a221c56 100644 --- a/nix/build-all.py +++ b/nix/build-all.py @@ -25,7 +25,7 @@ """ Example usage: - # Build all targets by default, except BonsaiViewer (it's set explicitly). + # Build all targets by default. python build-all.py # Build just the provided targets. @@ -59,7 +59,6 @@ Used environment variables: Example value: 'pyodide/cpython/installs/python-3.13.2' - ``ADD_COMMIT_SHA`` - `off` by default. If enabled `ADD_COMMIT_SHA` and `VERSION_OVERRIDE` will be set to `ON` while configuring IfcOpenShell - - ``BUILD_BONSAIVIEWER`` - enable building BonsaiViewer, `off` by default. - ``IFCOS_BUILD_PYTHON_WRAPPER`` - enable building the Python wrapper, `on` by default. - ``PYTHON_USER_SITE`` - install the Python wrapper into the user's site-packages directory instead of the interpreter's prefix, `off` by default. @@ -154,7 +153,6 @@ PROJECT_NAME = "IfcOpenShell" USE_CURRENT_PYTHON_VERSION = is_on_off(os.getenv("USE_CURRENT_PYTHON_VERSION"), default=False) ADD_COMMIT_SHA = is_on_off(os.getenv("ADD_COMMIT_SHA"), default=False) IFCOS_BUILD_PYTHON_WRAPPER = is_on_off(os.getenv("IFCOS_BUILD_PYTHON_WRAPPER"), default=True) -BUILD_BONSAIVIEWER = is_on_off(os.getenv("BUILD_BONSAIVIEWER"), default=False) USE_OCCT = is_on_off(os.getenv("USE_OCCT"), default=True) PYTHON_USER_SITE = is_on_off(os.getenv("PYTHON_USER_SITE"), default=False) @@ -547,10 +545,10 @@ else: targets = set(dependency_tree.keys()) targets = set(t for t in targets if t.lower() not in DYNAMIC_ARGS.without) -if not explicit_targets and not BUILD_BONSAIVIEWER: - targets.difference_update({"BonsaiViewer", "qt6"}) -if BUILD_BONSAIVIEWER: - targets.update(gather_dependencies("BonsaiViewer")) + +# Allow `-without-bonsaiviewer` to be a shortcut for `-without-bonsaiviewer -without-qt6`. +if "bonsaiviewer" in DYNAMIC_ARGS.without: + targets.discard("qt6") # Opt-out for the Python wrapper. Currently used by the bonsai CI workflow # on macOS, where the post-plug-in-refactor wrapper hard-links diff --git a/src/bonsaiviewer/docs/installation.rst b/src/bonsaiviewer/docs/installation.rst index a895402d79..b7a74b03f0 100644 --- a/src/bonsaiviewer/docs/installation.rst +++ b/src/bonsaiviewer/docs/installation.rst @@ -33,9 +33,9 @@ uses — is ``nix/build-all.py``. It downloads and compiles every dependency .. code-block:: bash - BUILD_BONSAIVIEWER=ON python3 ./nix/build-all.py + python3 ./nix/build-all.py -Setting ``BUILD_BONSAIVIEWER=ON`` pulls in the ``BonsaiViewer`` and ``qt6`` +By default, the script pulls in the ``BonsaiViewer`` and ``qt6`` targets along with their dependencies. This is self-contained but slow on a cold checkout, because it builds the whole dependency stack from source. The finished executable lands under the platform build tree, e.g.