Raise loudly when ``compile_commands.json`` still has strict-path offenders. The normalizer above is meant to leave no offenders behind; this is the fail-fast guard for issue #2378's "validation step that checks generated compile commands before CI compiles". Any violation here is a bug
(build_dir: Path)
| 250 | |
| 251 | |
| 252 | def _enforce_strict_path_violations(build_dir: Path) -> None: |
| 253 | """Raise loudly when ``compile_commands.json`` still has strict-path offenders. |
| 254 | |
| 255 | The normalizer above is meant to leave no offenders behind; this is the |
| 256 | fail-fast guard for issue #2378's "validation step that checks generated |
| 257 | compile commands before CI compiles". Any violation here is a bug in the |
| 258 | normalizer or a new Meson code-path that emits unnormalized flags. |
| 259 | """ |
| 260 | violations = find_strict_path_violations(build_dir) |
| 261 | if not violations: |
| 262 | return |
| 263 | |
| 264 | sample = violations[:10] |
| 265 | extra = len(violations) - len(sample) |
| 266 | lines = [ |
| 267 | f"[MESON] ZCCACHE_STRICT_PATHS=absolute would reject {len(violations)}" |
| 268 | " compile flag(s) in compile_commands.json (issue #2378):", |
| 269 | ] |
| 270 | lines.extend(f" {flag}" for flag in sample) |
| 271 | if extra > 0: |
| 272 | lines.append(f" ... {extra} more") |
| 273 | message = "\n".join(lines) |
| 274 | _ts_print(message, file=sys.stderr) |
| 275 | raise RuntimeError(message) |
no test coverage detected