Skip to content

Commit af126a3

Browse files
committed
fix(e2e295): 归一化用了 ^ 锚定,而 Windows 上那个 token 是带引号的
ninja 通道会给需要引号的路径加引号,于是同一个 flag 到达时是 `"-fprebuilt-module-path=C$:\Users\..."` —— 锚定的模式匹配不到它, 比对随后就栽在这个过滤器本来要去掉的那个 token 上。 在 windows-x86_64 上实测:它把一条本该绿的恒等式变成红的,而原因与被编译的 东西毫无关系。改成子串匹配。⚠️ Linux 侧仍然能在未修二进制上变红(已复验)。
1 parent 1b6f527 commit af126a3

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tests/e2e/295_naming_the_host_target_changes_nothing.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,16 @@ line_of() { # channel, extra args… → that line of build.ninja, or nothing
9797
# token that names which machine. `-fprebuilt-module-path=` names the build
9898
# directory, which differs because the fingerprint does; that is the mechanism
9999
# working, not a difference in what is compiled.
100+
#
101+
# ⚠️ NOT ANCHORED WITH `^`, AND WINDOWS IS WHY. The ninja channel QUOTES a token
102+
# whose path needs it, so the same flag arrives as
103+
# `"-fprebuilt-module-path=C$:\Users\..."` — an anchored pattern misses it and
104+
# the comparison then fails on the one token this filter exists to remove.
105+
# Measured on windows-x86_64, where it turned a green invariant into a red one
106+
# for a reason that had nothing to do with what was being compiled.
100107
normalise() {
101108
printf '%s\n' "$1" | tr ' ' '\n' \
102-
| grep -v '^--target=' | grep -v '^-fprebuilt-module-path=' \
109+
| grep -v -- '--target=' | grep -v -- '-fprebuilt-module-path=' \
103110
| grep -v '^$' | sort
104111
}
105112

0 commit comments

Comments
 (0)