This workstation configures ONE Cargo target outside the checkouts for every worktree below the project directory. A build in any worktree therefore replaced the `qbz` another worktree had just built: a parallel session's release build in its own worktree replaced the binary under test in the main one. scripts/qt-target.py now decides where builds go. When the target Cargo resolves lies outside the worktree and nothing pins it (CARGO_TARGET_DIR or CARGO_BUILD_TARGET_DIR), the worktree builds in its own sibling directory, `<target>-worktrees/<worktree>`; rebuilding the same worktree still replaces its own binary. Cargo's default target inside the checkout (macOS, CI, Windows) and explicit overrides are untouched, and no machine path is committed. Two checkouts that share a directory name get a stable suffix instead of one target. qt-run.sh, the runtime gate and direct qt-cargo.py builds and tests all use it. qt-run.sh prints the target and the binary path, and re-points crates/target after each successful build, never over a real directory. The aarch64 scripts build into and install from the same target, and the qbzd acceptance script names the build command that lands its binary there. The first build of a profile in a new worktree target is seeded from the shared target with copy-on-write clones, skipping incremental caches: Cargo rewrites moved build-script paths through root-output (custom_build.rs, "rewrite paths if the target directory has been moved"), so unchanged crates are not compiled again and no data is duplicated. Without clone support nothing is copied and Cargo builds from scratch. The resolution and shortcut handling start from the uncommitted draft in the build-storage-layout worktree. Verified on the main worktree: seeded from the shared release target, Cargo found everything fresh in two seconds, and crates/target now points at the worktree's own target. 33 build-gate tests cover derivation, overrides, name collisions, linking, seeding and the runner end to end. cc
43 lines
2.0 KiB
Bash
43 lines
2.0 KiB
Bash
#!/usr/bin/env bash
|
|
# Shared Linux CI/local runtime gate. Serial builds, no personal profile.
|
|
set -euo pipefail
|
|
cd "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.."
|
|
export QBZ_PREBUILT_SHADERS=1
|
|
# The same target qt-run.sh builds in: this worktree's own when the host shares
|
|
# one target across worktrees, Cargo's default otherwise (scripts/qt-target.py).
|
|
CARGO_TARGET_DIR="$(python3 scripts/qt-target.py resolve)"
|
|
export CARGO_TARGET_DIR
|
|
bash scripts/test-search-local-qml.sh
|
|
bash scripts/test-updates-qml.sh
|
|
bash scripts/test-playback-cache-qml.sh
|
|
bash scripts/test-text-edit-menu-qml.sh
|
|
bash scripts/test-compact-seek-qml.sh
|
|
bash scripts/test-library-folders-qml.sh
|
|
bash scripts/test-array-model-qml.sh
|
|
bash scripts/test-keyed-model-qml.sh
|
|
bash scripts/test-multi-select-qml.sh
|
|
bash scripts/test-wallpaper-field-qml.sh
|
|
bash scripts/test-card-menu-qml.sh
|
|
bash scripts/test-orbit-qml.sh
|
|
node scripts/test_qt_local_views.mjs
|
|
node scripts/test_qt_library.mjs
|
|
node scripts/test_qt_purchases_navigation.mjs
|
|
node scripts/test_qt_kiosk_art.mjs
|
|
node scripts/test_qt_kiosk_navigation.mjs
|
|
node scripts/test_qt_kiosk_feedback.mjs
|
|
node scripts/test_qt_exclusive_gate.mjs
|
|
python3 scripts/qt-cargo.py test --manifest-path crates/Cargo.toml -p qbz-qt --no-fail-fast
|
|
target_dir="$CARGO_TARGET_DIR"
|
|
logs="$(mktemp -d "${TMPDIR:-/tmp}/qbz-qt-gate-XXXXXX")"
|
|
printf '[qt-gate] startup logs: %s\n' "$logs"
|
|
for profile in debug release; do
|
|
args=()
|
|
[[ "$profile" == release ]] && args=(--release)
|
|
python3 scripts/qt-cargo.py build "${args[@]}" --manifest-path crates/Cargo.toml -p qbz-qt
|
|
python3 scripts/qt-smoke.py "$target_dir/$profile/qbz" --log "$logs/$profile.log"
|
|
done
|
|
python3 scripts/qt-target.py link --target-dir "$target_dir" \
|
|
|| printf '[qt-gate] crates/target not re-pointed; binaries are in %s\n' "$target_dir" >&2
|
|
# A healthy offscreen bus cannot expose Qt's synchronous xcb D-Bus startup.
|
|
python3 scripts/qt-smoke.py "$target_dir/release/qbz" --silent-bus --log "$logs/release-silent-bus.log"
|