fix(build): preserve LF for shell entrypoints - #1272
Conversation
Signed-off-by: xumian520 <126989134+xumian520@users.noreply.github.com>
Signed-off-by: xumian520 <126989134+xumian520@users.noreply.github.com>
Signed-off-by: xumian520 <126989134+xumian520@users.noreply.github.com>
|
Thank you for the contribution and for adding a regression contract around LF shell entrypoints on Windows checkouts. This is now triaged as a high-priority Windows build bug for |
|
Thank you — this is a good fit and I would like to merge it. Three small things first, and one of them is our fault rather than yours. What I verified: the 1. Needs a rebase (ours). 2. Assert the loop saw something. If 3. Optional, your call: the test asserts the attribute, not the bytes. A CRLF blob committed before renormalisation would still pass. Grepping the blobs for a literal CR would close that, but the attribute check is the important half and I would not block on it. On cost, since this touches every test leg: it adds one cheap deterministic check to step 0 — negligible runtime, no flake surface, no change to trigger scope. That is the right kind of contract to add. |
|
Reviewed alongside #1314, which fixes the same class of bug — and yours is the one we want to take. It needs a rebase first. Why yours. Both PRs carry the identical core line (
The implementation is clean: pure git plumbing, no dependencies, and the NUL-delimited What is needed: a rebase.
Three smaller things while you are in there, none blocking:
Rebase and ping me; I would like to land this. For the record, I have told @mlandolfi90 on #1314 that yours is the superset we intend to take, and credited them properly — their bug report is what made this concrete, with the exact failure signature from a real fresh Windows clone. |
What does this PR do?
Preserve LF checkout semantics for shell entrypoints so Windows clones with
core.autocrlf=truecan run repository scripts directly from WSL or MSYS. Without this rule, the shebang can be checked out as CRLF and fail withenv: $'bash\r': No such file or directory.This adds a shell line-ending contract test and runs it before the compiler-heavy suite. The test checks all tracked
*.shfiles and shell hook entrypoints withgit check-attr.Validation
bash tests/test_shell_line_endings.sh: 60/60 entrypoints passedbash scripts/build.sh: passedcodebase-memory-mcp devgit diff --check: passedChecklist
git commit -s) — required, CI rejects unsigned commits (DCO, see CONTRIBUTING.md)make -f Makefile.cbm test)make -f Makefile.cbm lint-ci)