From a91b1da28b926e3b1ce697463ed9d9be5c90b8b3 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Thu, 21 May 2026 15:12:20 +1000 Subject: [PATCH] Reduce Rocky package size Build Rocky artifacts with shared IfcOpenShell libraries and keep geometry writer plugins out of executable packages while preserving them for Python packages. Generated with the assistance of an AI coding tool. --- .github/workflows/build_rocky.yml | 9 +++++++-- .github/workflows/build_rocky_arm.yml | 8 ++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_rocky.yml b/.github/workflows/build_rocky.yml index da518d25bc..8e2bdd3d34 100644 --- a/.github/workflows/build_rocky.yml +++ b/.github/workflows/build_rocky.yml @@ -59,7 +59,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 python3 ./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 python3 ./nix/build-all.py -v --diskcleanup --shared 2>&1 | tee build.log - name: Upload Build Logs if: always() @@ -120,7 +120,11 @@ jobs: stage_runtime_payload() { dest="$1" + include_geometry_writers="${2:-1}" while IFS= read -r runtime_file; do + if [ "$include_geometry_writers" != "1" ] && [[ "$(basename "$runtime_file")" == ifcopenshell.geometry.writer.* ]]; then + continue + fi cp -P "$runtime_file" "$dest/" done < <( for runtime_dir in "$install_root/bin" "$install_root/lib" "$install_root/lib64"; do @@ -197,6 +201,7 @@ jobs: fi [ -d ifcopenshell/__pycache__ ] && rm -rf ifcopenshell/__pycache__ find ifcopenshell -name "*.pyc" -delete + stage_runtime_payload ifcopenshell zip -y -r -qq ifcopenshell-${py_version_major}-${VERSION}-${GITHUB_SHA:0:7}-linux64.zip ifcopenshell mv *.zip ~/output popd > /dev/null @@ -210,7 +215,7 @@ jobs: mkdir -p "$package_dir" cp "$exe_path" "$package_dir/" patchelf --set-rpath '$ORIGIN' "$package_dir/$exe" - stage_runtime_payload "$package_dir" + stage_runtime_payload "$package_dir" 0 stage_qt_runtime_payload "$exe_path" "$package_dir" if [ "$exe" = "BonsaiViewer" ]; then mkdir -p "$package_dir/connectors" diff --git a/.github/workflows/build_rocky_arm.yml b/.github/workflows/build_rocky_arm.yml index ca1a451cae..55b18672b2 100644 --- a/.github/workflows/build_rocky_arm.yml +++ b/.github/workflows/build_rocky_arm.yml @@ -59,7 +59,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 python3 ./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 python3 ./nix/build-all.py -v --diskcleanup --shared 2>&1 | tee build.log - name: Upload Build Logs if: always() @@ -120,7 +120,11 @@ jobs: stage_runtime_payload() { dest="$1" + include_geometry_writers="${2:-1}" while IFS= read -r runtime_file; do + if [ "$include_geometry_writers" != "1" ] && [[ "$(basename "$runtime_file")" == ifcopenshell.geometry.writer.* ]]; then + continue + fi cp -P "$runtime_file" "$dest/" done < <( for runtime_dir in "$install_root/bin" "$install_root/lib" "$install_root/lib64"; do @@ -211,7 +215,7 @@ jobs: mkdir -p "$package_dir" cp "$exe_path" "$package_dir/" patchelf --set-rpath '$ORIGIN' "$package_dir/$exe" - stage_runtime_payload "$package_dir" + stage_runtime_payload "$package_dir" 0 stage_qt_runtime_payload "$exe_path" "$package_dir" if [ "$exe" = "BonsaiViewer" ]; then mkdir -p "$package_dir/connectors"