diff --git a/.github/workflows/build_rocky.yml b/.github/workflows/build_rocky.yml index a5b2524b21..f36f68ebe4 100644 --- a/.github/workflows/build_rocky.yml +++ b/.github/workflows/build_rocky.yml @@ -20,16 +20,31 @@ jobs: run: | dnf update -y dnf install -y epel-release - dnf install -y gcc gcc-c++ git autoconf automake bison make zip cmake python3 python3-pip \ + # --enablerepo=crb: libstdc++-static (libsupc++.a, needed by the + # bundled FLTK link) lives in Rocky's CodeReady Builder repo, which + # is disabled by default. + dnf install -y --enablerepo=crb gcc gcc-c++ git autoconf automake bison make zip cmake python3 python3-pip \ bzip2 patch mesa-libGL-devel libffi-devel fontconfig-devel \ sqlite-devel bzip2-devel zlib-devel openssl-devel xz-devel \ readline-devel ncurses-devel libffi-devel libuuid-devel git-lfs \ findutils xz byacc patchelf libxkbcommon-devel \ - python3.11 python3.11-pip python3.11-tkinter + python3.11 python3.11-pip python3.11-tkinter \ + dbus-devel \ + libXext-devel libXinerama-devel libXcursor-devel libXrender-devel \ + libXfixes-devel libXft-devel pango-devel cairo-devel libstdc++-static python3 -m pip install typing_extensions aqtinstall git config --global --add safe.directory '*' python3.11 -c "import tkinter; print('Tk', tkinter.TkVersion)" + - name: Install Rust + # The bonsaiviewer-autodesk connector is a Rust crate; the "Package + # .zip archives" step below runs `cargo build --release` via + # packaging/build.py. Match the dedicated connector workflow's stable + # toolchain (dtolnay/rust-toolchain@stable). + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + - name: Install aws cli run: | curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" @@ -66,7 +81,7 @@ jobs: shell: bash run: | set -o pipefail - CXXFLAGS="-O3" CFLAGS="-O3 ${DARWIN_C_SOURCE}" ADD_COMMIT_SHA=1 BUILD_CFG=Release BUILD_BONSAIVIEWER=ON uv run --with typing_extensions --with aqtinstall ./nix/build-all.py -v --diskcleanup 2>&1 | tee build.log + CXXFLAGS="-O3" CFLAGS="-O3 ${DARWIN_C_SOURCE}" ADD_COMMIT_SHA=1 BUILD_CFG=Release BUILD_BONSAIVIEWER=ON uv run --with typing_extensions --with aqtinstall ./nix/build-all.py -v --diskcleanup --shared 2>&1 | tee build.log - name: Upload Build Logs if: always() diff --git a/.github/workflows/build_rocky_arm.yml b/.github/workflows/build_rocky_arm.yml index 618af9c9e8..2fe804505b 100644 --- a/.github/workflows/build_rocky_arm.yml +++ b/.github/workflows/build_rocky_arm.yml @@ -6,7 +6,19 @@ on: jobs: build_ifcopenshell: runs-on: ubuntu-22.04-arm - container: arm64v8/rockylinux:9 + # Rocky 10 (glibc 2.39) — aqt's official Qt6 ARM binaries are built + # against glibc 2.38, which Rocky 9 (glibc 2.34) can't run (moc fails to + # load). The legacy arm64v8/rockylinux Docker image stopped at 9; Rocky 10 + # is published under the rockylinux/rockylinux namespace. + container: + image: rockylinux/rockylinux:10 + # The community rockylinux image omits PATH from its config (the old + # Docker Official arm64v8/rockylinux set it), so GitHub Actions `run:` + # steps fail with `exec: "sh": not found` — docker exec has no /usr/bin + # to resolve the shell. Restore a standard PATH; GITHUB_PATH prepends + # (uv, cargo) are still layered on top by the runner. + env: + PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin steps: - name: Set up uv @@ -20,15 +32,29 @@ jobs: run: | dnf update -y dnf install -y epel-release - dnf install -y gcc gcc-c++ git autoconf automake bison make zip cmake python3 python3-pip \ + # --enablerepo=crb: libstdc++-static (libsupc++.a, needed by the + # bundled FLTK link) lives in Rocky's CodeReady Builder repo, which + # is disabled by default. + dnf install -y --enablerepo=crb gcc gcc-c++ git autoconf automake bison make zip cmake python3 python3-pip \ bzip2 patch mesa-libGL-devel libffi-devel fontconfig-devel \ sqlite-devel bzip2-devel zlib-devel openssl-devel xz-devel \ readline-devel ncurses-devel libffi-devel libuuid-devel git-lfs \ findutils xz byacc patchelf libxkbcommon-devel \ - python3.11 python3.11-pip python3.11-tkinter + python3-tkinter dbus-devel \ + libXext-devel libXinerama-devel libXcursor-devel libXrender-devel \ + libXfixes-devel libXft-devel pango-devel cairo-devel libstdc++-static python3 -m pip install typing_extensions aqtinstall git config --global --add safe.directory '*' - python3.11 -c "import tkinter; print('Tk', tkinter.TkVersion)" + python3 -c "import tkinter; print('Tk', tkinter.TkVersion)" + + - name: Install Rust + # The bonsaiviewer-autodesk connector is a Rust crate; the "Package + # .zip archives" step below runs `cargo build --release` via + # packaging/build.py. Match the dedicated connector workflow's stable + # toolchain (dtolnay/rust-toolchain@stable). + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" - name: Install aws cli run: | @@ -60,13 +86,13 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@v1.2.23 with: - key: ubuntu-22.04-${{ runner.arch }}-rockylinux9 + key: ubuntu-22.04-${{ runner.arch }}-rockylinux10 - name: Run Build Script shell: bash run: | set -o pipefail - CXXFLAGS="-O3" CFLAGS="-O3 ${DARWIN_C_SOURCE}" ADD_COMMIT_SHA=1 BUILD_CFG=Release BUILD_BONSAIVIEWER=ON uv run --with typing_extensions --with aqtinstall ./nix/build-all.py -v --diskcleanup 2>&1 | tee build.log + CXXFLAGS="-O3" CFLAGS="-O3 ${DARWIN_C_SOURCE}" ADD_COMMIT_SHA=1 BUILD_CFG=Release BUILD_BONSAIVIEWER=ON uv run --with typing_extensions --with aqtinstall ./nix/build-all.py -v --diskcleanup --shared 2>&1 | tee build.log - name: Upload Build Logs if: always() @@ -101,7 +127,7 @@ jobs: # connector.json into dist/autodesk/. Same on-disk shape as the # old PyInstaller flow so the symlink + zip steps below # continue to work unchanged. - python3.11 src/bonsaiviewer-autodesk/packaging/build.py + python3 src/bonsaiviewer-autodesk/packaging/build.py autodesk_connector_dir="$PWD/src/bonsaiviewer-autodesk/dist/autodesk" test -d "$autodesk_connector_dir" diff --git a/src/bonsaiviewer/modules/models/Commands.cpp b/src/bonsaiviewer/modules/models/Commands.cpp index 4ae98e4176..ca75273200 100644 --- a/src/bonsaiviewer/modules/models/Commands.cpp +++ b/src/bonsaiviewer/modules/models/Commands.cpp @@ -187,6 +187,22 @@ void renameGroup(SessionState& session, QWidget& host, const QString& group_id) session.setStatusMessage("Models", "Group renamed"); } +void renameModel(SessionState& session, QWidget& host, const QString& model_id) { + const Federation::Model* model = session.federation()->findById(model_id); + if (!model) return; + + bool ok = false; + const QString name = QInputDialog::getText( + &host, "Rename Model", "Model name:", QLineEdit::Normal, model->display_name, &ok); + if (!ok) return; + const QString trimmed = name.trimmed(); + if (trimmed.isEmpty()) return; + + session.federation()->setModelDisplayName(model_id, trimmed); + session.notifyFederationChanged(); + session.setStatusMessage("Models", "Model renamed"); +} + void moveGroup(SessionState& session, const QString& id, const QString& parent_group_id) { session.federation()->setGroupParent(id, parent_group_id); session.notifyFederationChanged(); diff --git a/src/bonsaiviewer/modules/models/Commands.h b/src/bonsaiviewer/modules/models/Commands.h index 78672e713e..15be7e77ed 100644 --- a/src/bonsaiviewer/modules/models/Commands.h +++ b/src/bonsaiviewer/modules/models/Commands.h @@ -55,6 +55,7 @@ namespace bonsaiviewer::modules::models::commands { void toggleVisibility(SessionState& session, ItemKind kind, const QString& id); void addGroup(SessionState& session, QWidget& host, const QString& parent_group_id); void renameGroup(SessionState& session, QWidget& host, const QString& group_id); +void renameModel(SessionState& session, QWidget& host, const QString& model_id); void moveGroup(SessionState& session, const QString& id, const QString& parent_group_id); void moveModels(SessionState& session, const QStringList& ids, const QString& parent_group_id); void removeGroup(SessionState& session, QWidget& host, const QString& group_id); diff --git a/src/bonsaiviewer/modules/models/Panel.cpp b/src/bonsaiviewer/modules/models/Panel.cpp index 509abf6fac..f6874acc9a 100644 --- a/src/bonsaiviewer/modules/models/Panel.cpp +++ b/src/bonsaiviewer/modules/models/Panel.cpp @@ -321,6 +321,12 @@ ModelsPanel::ModelsPanel(bonsaiviewer::SessionState* session_state, parent_group_id = idOf(parent_index); } + QAction* rename = menu.addAction( + components::icons::makeSvgIcon(":/icons/cube.svg"), "Rename"); + connect(rename, &QAction::triggered, this, [this, id]() { + commands::renameModel(*session_state_, *this, id); + }); + QAction* add_group = menu.addAction( components::icons::makeSvgIcon(":/icons/folder-plus.svg"), "New Group"); connect(add_group, &QAction::triggered, this, [this, parent_group_id]() { diff --git a/src/ifcviewer/ViewportWindow.cpp b/src/ifcviewer/ViewportWindow.cpp index c1acab8bbc..6e70280173 100644 --- a/src/ifcviewer/ViewportWindow.cpp +++ b/src/ifcviewer/ViewportWindow.cpp @@ -45,6 +45,10 @@ #define NOMCX #define NOSERVICE #include +#elif defined(Q_OS_MAC) +// Cocoa bridge declared here, implemented in the adjacent .mm file. Must be +// visible before createWgpuSurface() below calls wgpu_macos_attach_metal_layer. +#include "MetalSurface_mac.h" #endif #include @@ -832,10 +836,6 @@ bool ViewportWindow::initWgpu() { # define WIN32_LEAN_AND_MEAN # endif # include -#elif defined(Q_OS_MAC) -// Cocoa bridge declared in MetalSurface_mac.h, implemented in the -// adjacent .mm file. Keeps Objective-C out of this pure-C++ TU. -# include "MetalSurface_mac.h" #endif // Private bool createSurface() removed in #84-l — its body is now