mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-18 14:32:36 +00:00
Mirror of snaporca ac85277bac..0e7cb3ec78 (six changes, applied as a patch to DesignPanel.cpp rather than copied, so this fork's 30 permitted divergent lines survive — parity re-checked afterwards: the five shared files are byte-identical, DesignCanvas.cpp and DesignPanel.cpp differ by exactly 16 and 30 lines). - The straight slot's inline field says Radius, which is what it sets. It stores the half-width and passed the typed number through unchanged, so 30 produced a 60 mm slot. - The offer opens from the keyboard (Menu, Shift+F10), anchored on the viewport rather than wherever the pointer happens to be. The card hint names the new route. - The sketch card's Plane combo is gone; the plane comes from the viewport. Also stops build_candidate collapsing a face plane to a base plane while editing. - Mass properties and the dead Edit row are wired into the offer; DesignOffer.hpp is regenerated from tool_atlas.json, verified by re-running the generator and diffing. - docs/rig_build_traps.md + scripts/rig-build.sh, which derives its fork identity from project() so it cannot be pointed at the other fork's image or volume. - docs/design_tab.md refreshed (44 commits stale) + a PR description, with this fork's own merge-base and diff shape rather than snaporca's. Built green in the deps container with the new script and verified on the rig: Menu and Shift+F10 both open the offer at the viewport centre with the pointer parked off-canvas, and the sketch card shows no Plane row. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LyRwbuq6fjn3VV9U9UvhBM
77 lines
3.9 KiB
Bash
Executable File
77 lines
3.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Rebuild the GUI binary the design rig launches — in a THROWAWAY container, writing into the
|
|
# same build-cache volume the rig's long-lived GUI container reads from.
|
|
#
|
|
# NEVER build inside the GUI container (snaporca-gui / orcacad-gui). Its baked /OrcaSlicer tree
|
|
# is the Jun-13 Snapmaker-derived source, so a `cmake .` in there silently reconfigures the
|
|
# shared build dir as project(Snapmaker_Orca) and this fork's targets vanish. That is Trap 1 of
|
|
# five; all of them, with symptoms and exact recovery commands, are in docs/rig_build_traps.md.
|
|
# Read that file before debugging a configure or link failure this script reports.
|
|
#
|
|
# Usage:
|
|
# scripts/rig-build.sh # configure + build the fork's GUI target
|
|
# DRY_RUN=1 scripts/rig-build.sh # print the resolved fork identity and exit, no container
|
|
set -euo pipefail
|
|
|
|
REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
|
|
# Fork identity is DERIVED from the repo, never hardcoded, so this file is byte-identical in
|
|
# both forks and cannot be mirrored into the wrong one. Pointing a fork at the other fork's
|
|
# image or volume is not a slow failure: with the wrong image CMake dies at configure, and with
|
|
# the wrong volume the two forks silently trade build artefacts.
|
|
PROJECT="$(sed -n 's/^project(\([A-Za-z_0-9]*\)).*/\1/p' "$REPO/CMakeLists.txt" | head -1)"
|
|
case "$PROJECT" in
|
|
Snapmaker_Orca) PREFIX=snaporca; BIN=snapmaker-orca ;;
|
|
OrcaSlicer) PREFIX=orcacad; BIN=orca-slicer ;;
|
|
*) echo "FATAL: unrecognised project($PROJECT) in $REPO/CMakeLists.txt" >&2; exit 2 ;;
|
|
esac
|
|
TARGET="$PROJECT"
|
|
IMAGE="${PREFIX}-deps"
|
|
BUILD_VOL="${PREFIX}_buildcache"
|
|
|
|
echo "REPO=$REPO PROJECT=$PROJECT IMAGE=$IMAGE BUILD_VOL=$BUILD_VOL TARGET=$TARGET BIN=$BIN"
|
|
|
|
if [ -n "${DRY_RUN:-}" ]; then
|
|
echo "DRY_RUN: resolution only, no container started"
|
|
exit 0
|
|
fi
|
|
|
|
# Every one of these mounts covers a trap, none is decorative:
|
|
# CMakeLists.txt + cmake/ carry the SLIC3R_CAD gate — inherit the baked copies and the cache
|
|
# says SLIC3R_CAD=ON while -DSLIC3R_CAD is never defined, so every #ifdef block compiles out.
|
|
# deps_src/ carries pybind11, which the image predates.
|
|
# src/, resources/, localization/, version.inc are the code under test.
|
|
rc=0
|
|
docker run --rm \
|
|
-v "$REPO/src":/OrcaSlicer/src \
|
|
-v "$REPO/resources":/OrcaSlicer/resources \
|
|
-v "$REPO/cmake":/OrcaSlicer/cmake \
|
|
-v "$REPO/deps_src":/OrcaSlicer/deps_src \
|
|
-v "$REPO/localization":/OrcaSlicer/localization \
|
|
-v "$REPO/CMakeLists.txt":/OrcaSlicer/CMakeLists.txt \
|
|
-v "$REPO/version.inc":/OrcaSlicer/version.inc \
|
|
-v "$BUILD_VOL":/OrcaSlicer/build \
|
|
"$IMAGE" bash -lc "
|
|
cd /OrcaSlicer/build || exit 1
|
|
cmake . > /tmp/cfg.log 2>&1 || { echo 'CONFIGURE FAILED'; tail -25 /tmp/cfg.log; exit 1; }
|
|
# Twice, deliberately. src/libslic3r/CMakeLists.txt publishes OCCT_LIBS as CACHE INTERNAL
|
|
# at the END of its own configure, so a first pass after that list changes links the
|
|
# PREVIOUS one and drops TKBool/TKOffset — a wall of TopOpeBRepBuild undefined references
|
|
# that reads as a broken OCCT install and is not. Trap 4.
|
|
cmake . > /tmp/cfg2.log 2>&1 || { echo 'RECONFIGURE FAILED'; tail -25 /tmp/cfg2.log; exit 1; }
|
|
ninja -f build-Release.ninja -j\"$(nproc)\" $TARGET > /tmp/bld.log 2>&1
|
|
rc=\$?
|
|
echo \"EXIT=\$rc\"
|
|
grep -n 'error:' /tmp/bld.log | head -20
|
|
tail -4 /tmp/bld.log
|
|
ls -la /OrcaSlicer/build/src/Release/$BIN 2>/dev/null
|
|
exit \$rc
|
|
" || rc=$?
|
|
|
|
# A target-only build writes src/Release/, but this fork's gui-session.sh may default BIN to the
|
|
# PACKAGED path that only build_linux.sh refreshes — launching with the default would then run a
|
|
# stale binary. Pass BIN explicitly. See docs/rig_build_traps.md.
|
|
echo "=== launch the rig on the binary just built ==="
|
|
echo " docker exec -e BIN=/OrcaSlicer/build/src/Release/$BIN ${PREFIX}-gui /OrcaSlicer/scripts/gui-session.sh"
|
|
exit "$rc"
|