Repository navigation
Pin contract-view and UAT expectations to LF (fix Windows contract-view-tests red) - #1887
Conversation
…ew-tests red) contract-view-tests compares each test/contract/*.w's contract view with its .expected file byte for byte, and uat-tests compares the UAT runner's report and listing with test/uat/expected*.txt the same way. Under core.autocrlf=true (Git for Windows' default, and GitHub's Windows runners') a native checkout rewrites those files to CRLF, while the outputs are LF, so every line differs. On main 9ee1234, windows-x86_64: contract-view-tests fails on all six .expected files, and uat-tests fails on both comparisons, CR on every line. Pin them to LF, as withlang-dev#801 and withlang-dev#942 did for the embed_file fixtures and the .w sources. With this change contract-view-tests is green. uat-tests is still red on Windows for two reasons of its own (the verbs scenario's `run: ./out/bin/tmp` exits -2, and skip_platform prints `windows` where the listing expects `<host>`), but its report and listing no longer differ on line endings.
ehartford
left a comment
There was a problem hiding this comment.
Reviewed on a worktree at the PR head, driven by the pinned seed.
Root cause confirmed: the checkout, not the compiler. The compared outputs are raw WriteFile on Windows (rt/windows_x86_64.w:507, rt/windows_aarch64.w:388) — LF on every host; the committed goldens are LF (git ls-files --eol: i/lf); only a core.autocrlf=true checkout turns them CRLF because they carried no attribute. Same mechanism and same fix as the existing pins for test/behavior/*.txt (#801). The byte-for-byte comparison in build.w stays strict; no program or golden blob changes.
Reproduced the red on the Mac by checking test/contract and test/uat out as CRLF (w/crlf confirmed): :contract-view-tests red on all 6 ok_*.expected, :uat-tests red on report and listing; every differing byte is a \r. With the PR's pin, re-checked out (w/lf): both green. test/uat/**/*.txt matches test/uat/expected.txt directly (git check-attr: eol lf).
Leaving *.uat unpinned is right — src/Uat.w:78-81,162-163 strip CR per line by design.
Gate on the PR tree: red only on unit-return-review for lib/std/c_algorithms/defs.w:272 (extern fn … -> Unit) — that line is in the PR's base (9ee1234) and is gone on main; the PR touches only .gitattributes. Everything else on the fixed list passed. Needs a rebase onto main (34 behind) before the stack's battery.
The two remaining Windows-only uat-tests diffs you describe (tmp.exe, the <host> listing line) are outside this PR and look like real defects — worth their own issues.
contract-view-testscompares eachtest/contract/*.w's contract view with its.expectedfile byte for byte, anduat-testscompares the UAT runner's report and listing withtest/uat/expected*.txtthe same way. Undercore.autocrlf=true(Git for Windows' default, and GitHub's Windows runners') a native checkout rewrites those filesto CRLF, while the outputs are LF, so every line differs. The committed blobs are LF (
git ls-files --eolshowsi/lf w/crlf attr/).This pins them to LF, as #801 and #942 did for the
embed_filefixtures and the.wsources. The change is 10 linesof
.gitattributes, and no committed file changes.Evidence (native windows-x86_64, Git for Windows with
core.autocrlf=true, the pinned seednightly-20260926-local-1-2e8defaa18ef, main9ee1234f):contract-view-tests.expectedfiles differ (CR on every line)uat-testssrc/main build :gateNot in this PR, for your information. Both of these are still red on windows-x86_64 after this change:
uat-tests, two Windows-specific differences:verbsscenario's steprun: ./out/bin/tmpexits -2: the program istmp.exe;skip_platformprints(platforms: windows not listed)whereexpected-list.txthas<host>.native-spec-tests:test/spec/spec_ss14_11_await_combinator_cancel_joins.wcarriesknown-issue: #916, but itpasses on windows-x86_64, so the known-issue gate reports "expected this test to stay red, but it passed". It's
already skipped on linux-aarch64 for the same reason.
A full battery wasn't run, because the change only affects how two test groups' fixtures are checked out. Both groups
were run before and after, and the gate was run.