@@ -275,6 +275,31 @@ if proc.returncode != 0 or got != ["internal/cbm/grammar_go.c",
275275 "vendored/sqlite3/sqlite3.c"]:
276276 failures.append(f"codeql (c): the retrace helper must list the translation units for "
277277 f"changed vendored code and wrappers, got {got} (exit {proc.returncode})")
278+ # Native Windows Python emits CRLF even when the change list uses LF. Pin
279+ # that producer/consumer boundary on every platform, including direct wrapper
280+ # paths that must survive verbatim rather than being mapped to a family name.
281+ crlf_root = work / "crlf-selector"
282+ crlf_scripts = crlf_root / "scripts" / "ci"
283+ crlf_scripts.mkdir(parents=True)
284+ (crlf_scripts / retrace.name).write_bytes(retrace.read_bytes())
285+ expected_retrace = ["internal/cbm/grammar_go.c", "internal/cbm/grammar_json.c",
286+ "internal/cbm/ts_runtime.c", "vendored/sqlite3/sqlite3.c"]
287+ for path in expected_retrace:
288+ fixture = crlf_root / path
289+ fixture.parent.mkdir(parents=True, exist_ok=True)
290+ fixture.touch()
291+ (crlf_scripts / "select-lanes.sh").write_bytes(
292+ b"#!/usr/bin/env bash\nprintf '%s\\r\\n' "
293+ b"internal/cbm/vendored/grammars/go/parser.c internal/cbm/grammar_json.c "
294+ b"internal/cbm/ts_runtime.c vendored/sqlite3/sqlite3.c\n")
295+ proc = subprocess.run([bash, str(crlf_scripts / retrace.name),
296+ "--changed", str(changed), str(listed)],
297+ capture_output=True, text=True, env=env)
298+ got = listed.read_bytes() if listed.exists() else None
299+ if proc.returncode != 0 or got != ("\n".join(expected_retrace) + "\n").encode("utf-8"):
300+ failures.append(f"codeql CRLF: the retrace helper must preserve every changed "
301+ f"wrapper and write LF entrypoints, got {got!r} (exit {proc.returncode})")
302+
278303for label, args in (("an unreadable change list", ["--changed", str(work / "missing.txt")]),
279304 ("no pull request", [])):
280305 listed.write_text("stale\n", encoding="utf-8")
0 commit comments