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.
This commit is contained in:
Dion Moult
2026-05-21 15:12:20 +10:00
parent 89cb551dbb
commit a91b1da28b
2 changed files with 13 additions and 4 deletions
+7 -2
View File
@@ -59,7 +59,7 @@ jobs:
shell: bash shell: bash
run: | run: |
set -o pipefail 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 - name: Upload Build Logs
if: always() if: always()
@@ -120,7 +120,11 @@ jobs:
stage_runtime_payload() { stage_runtime_payload() {
dest="$1" dest="$1"
include_geometry_writers="${2:-1}"
while IFS= read -r runtime_file; do 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/" cp -P "$runtime_file" "$dest/"
done < <( done < <(
for runtime_dir in "$install_root/bin" "$install_root/lib" "$install_root/lib64"; do for runtime_dir in "$install_root/bin" "$install_root/lib" "$install_root/lib64"; do
@@ -197,6 +201,7 @@ jobs:
fi fi
[ -d ifcopenshell/__pycache__ ] && rm -rf ifcopenshell/__pycache__ [ -d ifcopenshell/__pycache__ ] && rm -rf ifcopenshell/__pycache__
find ifcopenshell -name "*.pyc" -delete 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 zip -y -r -qq ifcopenshell-${py_version_major}-${VERSION}-${GITHUB_SHA:0:7}-linux64.zip ifcopenshell
mv *.zip ~/output mv *.zip ~/output
popd > /dev/null popd > /dev/null
@@ -210,7 +215,7 @@ jobs:
mkdir -p "$package_dir" mkdir -p "$package_dir"
cp "$exe_path" "$package_dir/" cp "$exe_path" "$package_dir/"
patchelf --set-rpath '$ORIGIN' "$package_dir/$exe" 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" stage_qt_runtime_payload "$exe_path" "$package_dir"
if [ "$exe" = "BonsaiViewer" ]; then if [ "$exe" = "BonsaiViewer" ]; then
mkdir -p "$package_dir/connectors" mkdir -p "$package_dir/connectors"
+6 -2
View File
@@ -59,7 +59,7 @@ jobs:
shell: bash shell: bash
run: | run: |
set -o pipefail 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 - name: Upload Build Logs
if: always() if: always()
@@ -120,7 +120,11 @@ jobs:
stage_runtime_payload() { stage_runtime_payload() {
dest="$1" dest="$1"
include_geometry_writers="${2:-1}"
while IFS= read -r runtime_file; do 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/" cp -P "$runtime_file" "$dest/"
done < <( done < <(
for runtime_dir in "$install_root/bin" "$install_root/lib" "$install_root/lib64"; do for runtime_dir in "$install_root/bin" "$install_root/lib" "$install_root/lib64"; do
@@ -211,7 +215,7 @@ jobs:
mkdir -p "$package_dir" mkdir -p "$package_dir"
cp "$exe_path" "$package_dir/" cp "$exe_path" "$package_dir/"
patchelf --set-rpath '$ORIGIN' "$package_dir/$exe" 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" stage_qt_runtime_payload "$exe_path" "$package_dir"
if [ "$exe" = "BonsaiViewer" ]; then if [ "$exe" = "BonsaiViewer" ]; then
mkdir -p "$package_dir/connectors" mkdir -p "$package_dir/connectors"