Repository navigation
Commit 8ebbbc8
committed
fix(scanner): prune .mcpp from glob walks; never throw on unnarrowable names (#230)
Root cause of the windows-latest 'exit 127' (really 0xC0000409): 0.0.95's
scanner walks globs with follow_directory_symlink, and the project-local
`.mcpp/.xlings/data/<index>` entry is a symlink back to the index root —
so the walk escapes into the entire index checkout. In mcpp-index CI that
tree contains a vendored xim-pkgindex whose issue template has a CJK
filename; path_matches_glob spelled it narrow via generic_string(), which
on MSVC under a non-CJK ANSI codepage throws std::system_error. The
exception escaped main uncaught -> std::terminate -> __fastfail
(0xC0000409), which git-bash reports as a bare exit 127.
Three layers, all fixed:
- expand_glob/expand_dir_glob prune directories named .mcpp — mcpp's own
metadata dir is never a source dir, and pruning it severs the symlink
escape at its origin (also stops walking the whole index per member).
- path_matches_glob treats a name with no narrow spelling as 'no match'
instead of letting the conversion tear down the build.
- main() gains a last-resort catch: an escaped exception now names itself
and exits 70 instead of a silent fastfail.
Evidence: full-memory WER dump from the CI runner shows the throw chain
scan_one_into -> expand_glob -> path_matches_glob -> _Convert_wide_to_narrow
with the wide string
'.mcpp\.xlings\data\compat\mcpp-0.0.95-windows-x86_64\registry\data\
xim-pkgindex\.github\ISSUE_TEMPLATE\bug-report---<CJK>.md'.
Behavioral control on linux: release 0.0.95 compiles an out-of-tree
extra.cpp through the .mcpp symlink (duplicate main at link); the fixed
binary prunes it and builds clean. e2e 113 encodes both assertions.
35/35 unit tests pass.1 parent c77aca1 commit 8ebbbc8
3 files changed
Lines changed: 89 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
9 | 22 | | |
10 | 23 | | |
11 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
114 | 125 | | |
115 | 126 | | |
116 | 127 | | |
| |||
242 | 253 | | |
243 | 254 | | |
244 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
245 | 265 | | |
246 | 266 | | |
247 | 267 | | |
| |||
294 | 314 | | |
295 | 315 | | |
296 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
297 | 322 | | |
298 | 323 | | |
299 | 324 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
0 commit comments