build-all: make BonsaiViewer a normal target, built by default

Can be skipped using `--without-BonsaiViewer` as any other target, if
needed.
This commit is contained in:
Andrej730
2026-08-31 14:58:23 +05:00
parent d0119479a4
commit da28d127d7
5 changed files with 10 additions and 12 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+5 -7
View File
@@ -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
+2 -2
View File
@@ -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.