Skip to content

Commit 01368e6

Browse files
committed
Merge shared CI baseline fixes into external import shadow fix
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2 parents 884bf99 + 72c3604 commit 01368e6

3 files changed

Lines changed: 30 additions & 5 deletions

File tree

‎scripts/ci/codeql-retrace-vendored.sh‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ fi
8080
printf '%s\n' "$changed" |
8181
bash "$ROOT/scripts/ci/select-lanes.sh" --codeql-scope c-cpp |
8282
while IFS= read -r path; do
83+
# Native Windows Python writes CRLF; read removes only the LF.
84+
path="${path%$'\r'}"
8385
entrypoints=()
8486
case "$path" in
8587
internal/cbm/grammar_*.c | internal/cbm/ts_runtime.c)

‎tests/test_language_count_contract.sh‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,12 @@ if [[ "$manifest_count" != "$expected" ]]; then
4646
fi
4747

4848
# --- 3. Every published surface must claim exactly that number. ---
49+
# The #2729 messaging refresh dropped the count from docs/index.html,
50+
# docs/llms.txt, pkg/npm/README.md, scripts/package-release.sh and server.json;
51+
# section 4 below still fails if any of them states a count again unregistered.
4952
SURFACES=(
5053
README.md
51-
docs/index.html
52-
docs/llms.txt
53-
pkg/npm/README.md
5454
pkg/chocolatey/codebase-memory-mcp.nuspec
55-
scripts/package-release.sh
56-
server.json
5755
)
5856

5957
# Files that legitimately say "<N> languages" about something OTHER than the

‎tests/test_select_lanes.sh‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
278303
for 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

Comments
 (0)