Commit cc1f12d
committed
ci/test: un-escape ninja sequences in CDB args; harden e2e for Windows
First CI round revealed two layered issues exposed by the new e2e:
1. **The shipped CDB carries ninja-escape artefacts.** `flags.cppm`'s
`escape_path` ninja-escapes paths (`$ ` for space, `$:` for colon,
`$$` for literal `$`) so they survive embedding in ninja rule strings.
But the same escaped strings flow verbatim through `f.cxx` into
`compile_commands.json`, whose `arguments` array is exec'd by clangd
without any ninja involved. On Windows that makes `C:` appear as
`C$:` in CDB → clangd can't resolve the path. POSIX usually escaped
nothing in practice, hiding the bug; Windows drive letters always
trigger `$:`.
Fix in `compile_commands.cppm::split_flags`: same single pass now
splits tokens *and* unescapes the three ninja sequences. Splitting
was also broken for paths with a literal space (would've broken
`-isystem "/path with space/include"` mid-arg) — that's fixed
simultaneously since `$ ` is no longer a token separator.
2. **e2e test 47 needed Windows-friendly checks.** The original `[^"]+`
grep returned the raw JSON-escaped form (`\\Users\\...`) and the
`^[A-Za-z]:` regex didn't match `C$:`. Rewrote using `jq -r` (which
does JSON un-escape natively, preinstalled on all GHA runners) and:
- explicit ninja-escape sniff (`$:`, `$ `, `$$`)
- both POSIX and Windows-drive absolute-path checks
- basename check normalised against `\` / `/`
Net: CDB now contains plain paths in both runtimes, and the test fails
loudly if either layer regresses.1 parent e6de2b6 commit cc1f12d
2 files changed
Lines changed: 86 additions & 45 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
41 | 55 | | |
42 | 56 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
53 | 79 | | |
| 80 | + | |
54 | 81 | | |
55 | 82 | | |
56 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
| |||
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
28 | 43 | | |
29 | 44 | | |
30 | 45 | | |
31 | 46 | | |
32 | | - | |
33 | 47 | | |
34 | | - | |
35 | | - | |
| 48 | + | |
36 | 49 | | |
37 | 50 | | |
38 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
39 | 61 | | |
40 | 62 | | |
41 | 63 | | |
42 | | - | |
43 | | - | |
44 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
45 | 68 | | |
46 | 69 | | |
47 | 70 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
52 | 77 | | |
53 | 78 | | |
54 | | - | |
| 79 | + | |
55 | 80 | | |
56 | 81 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | 82 | | |
0 commit comments