Fix setup on stock macOS bash, shader step false success, battery gate misreport (#4, #5, #7)

- Brace every $NAME that is directly followed by a non-ASCII character in the shell scripts: bash 3.2 in a UTF-8 locale read the first byte of the following character as part of the variable name and aborted under set -u (#4, #6).
- setup.sh and d2rm_pack.py: the shader translation step is complete only when every entry in the completion marker is ok and every library file exists; the script's exit status is no longer hidden by a pipe (#5).
- devbattery.sh / devlock.sh: a missing local timeout or ideviceinfo is reported as such and stops at once, instead of being reported as an offline device and polled for up to an hour (#7).
- smoke_mac.sh builds its package for iPhone only regardless of the project default.

Reported by @SakuraToErii. The setup.sh part of #4 was also submitted by @hubeiqiao in #6.

Co-authored-by: hubeiqiao <12777592+hubeiqiao@users.noreply.github.com>
This commit is contained in:
jhaizhou
2026-10-13 03:17:23 +08:00
co-authored by hubeiqiao
parent 824d2d3f0b
commit 66c3a2fb70
28 changed files with 121 additions and 68 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
# Each run: windowed, camp, 3D 0.75, warm up 35 s and record 12 s; one line: frame count, interval total, main pass (p11) fragment, depth pre-pass (p08) fragment, normalized ratio, number of failure lines
# How to judge: look at 「对p08」(vs p08) relative to the baseline; at least three baseline runs and at least two runs per variant; if the two runs disagree do not report it, and <3% counts as noise; a run with clearly fewer frames or an abnormally small total is void
# The whole batch holds the second Mac's measurement lock (only one measurement runs at a time); each run uses its own directory and produces tables by process id
PN=$(bash "$(dirname "$0")/../../tools/product.sh" name touch); D=${XT_MINI_DIR:-$(ls -dt "${DM_ROOT:-$HOME/dm-work}"/run/mini/*_"$PN" 2>/dev/null | head -1)}; [ -d "$D" ] || { echo "没有 mini 同步目录 ${DM_ROOT:-$HOME/dm-work}/run/mini/*_$PN(先 mini_sync.sh,或用 XT_MINI_DIR 指定)"; exit 2; }; T=$D/src/dm/ios/tools; W=${DM_ROOT:-$HOME/dm-work}/run/xtrace/terr; B=${DM_ROOT:-$HOME/dm-work}/run/xtrace/batch_$(date +%m%d_%H%M%S)_var; mkdir -p $B; O=$B/out.tsv; : > $O
PN=$(bash "$(dirname "$0")/../../tools/product.sh" name touch); D=${XT_MINI_DIR:-$(ls -dt "${DM_ROOT:-$HOME/dm-work}"/run/mini/*_"$PN" 2>/dev/null | head -1)}; [ -d "$D" ] || { echo "没有 mini 同步目录 ${DM_ROOT:-$HOME/dm-work}/run/mini/*_${PN}(先 mini_sync.sh,或用 XT_MINI_DIR 指定)"; exit 2; }; T=$D/src/dm/ios/tools; W=${DM_ROOT:-$HOME/dm-work}/run/xtrace/terr; B=${DM_ROOT:-$HOME/dm-work}/run/xtrace/batch_$(date +%m%d_%H%M%S)_var; mkdir -p $B; O=$B/out.tsv; : > $O
source $T/mlock.sh; mlock_acquire "${XT_OWNER:?先设 XT_OWNER=线名} 着色器变体 $# 局 约 $(( $# * 95 / 60 )) 分钟"; trap mlock_release EXIT
i=0; for v in "$@"; do i=$((i + 1)); R=$B/$(printf %02d $i)_$v
e="DM_NVN_ENC_LABEL=1"; [ $v = base ] || { [ -d $W/$v/b-89f2d5b38edb ] || { echo "没有变体库 $W/$v"; continue; }; e="$e DM_MSL_DIR=$W/$v"; }