From bd5656b5fc73727631dd3cd1d81d88db40b14f00 Mon Sep 17 00:00:00 2001 From: sim Date: Thu, 10 Sep 2026 13:46:19 +0800 Subject: [PATCH] =?UTF-8?q?build(macos):=20=E6=9E=84=E5=BB=BA=E5=89=8D?= =?UTF-8?q?=E6=B8=85=E7=90=86=E9=87=8D=E5=A4=8D=E7=9A=84=20qwen3-asr-rs=20?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=EF=BC=9B=E6=96=B0=E9=B2=9C=E5=BA=A6=E5=9F=BA?= =?UTF-8?q?=E5=87=86=E6=94=B9=E4=B8=BA=E6=9E=84=E5=BB=BA=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 本地混跑 cargo check/test/build 会按 feature 上下文生成多份 qwen3-asr-rs 构建目录,多份 metallib 会让暂存脚本拒绝猜测 - 打包后原始二进制还会被签名触碰,bundle 新鲜度不能与它比,改与本构建 开始时间比 --- openless-all/app/scripts/build-mac.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/openless-all/app/scripts/build-mac.sh b/openless-all/app/scripts/build-mac.sh index 02682e03..aff48f35 100755 --- a/openless-all/app/scripts/build-mac.sh +++ b/openless-all/app/scripts/build-mac.sh @@ -35,7 +35,17 @@ export RUSTC_WRAPPER="$PWD/scripts/rustc-macos-proc-macro-wrapper.sh" echo "▶ Cargo release strip: ${CARGO_PROFILE_RELEASE_STRIP} (macOS only)" echo "▶ Rust proc-macro host wrapper: ${RUSTC_WRAPPER}" +# 只保留最新一份 qwen3-asr-rs 构建目录:本地混跑 cargo check/test/build 会按不同 +# feature 上下文生成多份,各自带一份 metallib,会让暂存脚本拒绝猜测。 +KEEP_QWEN_DIR="$(ls -dt src-tauri/target/release/build/qwen3-asr-rs-* 2>/dev/null | head -1 || true)" +if [ -n "$KEEP_QWEN_DIR" ]; then + for d in src-tauri/target/release/build/qwen3-asr-rs-*; do + [ "$d" = "$KEEP_QWEN_DIR" ] || rm -rf "$d" + done +fi + echo "▶ tauri build" +BUILD_START_TS="$(date +%s)" TAURI_BUILD_ARGS=(build --ci) case "$(uname -m)" in arm64) @@ -59,8 +69,10 @@ npm run tauri -- "${TAURI_BUILD_ARGS[@]}" || echo "⚠ tauri build 退出码非 APP_VERSION="$(node -p "require('./package.json').version")" DMG_PATH="$DMG_DIR/OpenLess_${APP_VERSION}_${MAC_BUNDLE_ARCH}.dmg" -if [ ! -d "$APP" ] || [ "$APP/Contents/MacOS/openless" -ot "src-tauri/target/release/openless" ]; then - echo "✗ $APP 缺失或早于刚编译的二进制(打包未完成),中止" +# bundle 必须是本次构建产出的(与构建开始时间比;打包后原始二进制还会被签名 +# 触碰,不能拿它当基准)。 +if [ ! -d "$APP" ] || [ "$(stat -f %m "$APP/Contents/MacOS/openless")" -lt "$BUILD_START_TS" ]; then + echo "✗ $APP 缺失或不是本次构建的产物(打包未完成),中止" exit 1 fi