From 421ee87d044b84c034be7f67a40e0864116c399d Mon Sep 17 00:00:00 2001 From: weichen Date: Mon, 5 Oct 2026 02:23:32 +0000 Subject: [PATCH] Normalize the rebuild args comparison to stop spurious drop warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why: adjust_args_for_bin strips the leading space of its return while the rebuilt args keep it, so every rebuild carrying --dsn/--auth compared unequal and warned that the legacy binary had the flags dropped even when nothing was dropped — misleading during incident triage. Evidence: bash -n clean; against the real dev binary the normalized comparison reports no drop and the flags survive intact; make test green. Impact: warning now fires only when flags are actually filtered; no behavioral change to start/deploy. Refs: PR #188 --- scripts/svc.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/svc.sh b/scripts/svc.sh index 23ecfeb7..2edcec38 100755 --- a/scripts/svc.sh +++ b/scripts/svc.sh @@ -1248,7 +1248,9 @@ agent_do_start() { fi fi local adjusted; adjusted="$(adjust_args_for_bin "$ENV_BIN" "$args")" - if [ "$adjusted" != "$args" ]; then + # adjust_args_for_bin 返回值已去首空格——比较前对 args 同样归一,否则每次 + # 带 --dsn/--auth 的重建都会误报"旧版本二进制已自动省略"(参数实际全保留)。 + if [ "$adjusted" != "${args# }" ]; then c_warn "[$ENV_NAME] 该产物不支持 --dsn/--auth(旧版本二进制),已自动省略:$(mask_dsn "${args:-<无>}") → $(mask_dsn "${adjusted:-<无>}")" fi args="$adjusted"