Skip to content

Check text out with LF everywhere, so the include_str! tests pass on a Windows checkout (Fixes #158) - #217

Closed
kvnloo wants to merge 1 commit into
meshy-dev:mainfrom
kvnloo:swarm/a04-crlf-158
Closed

kvnloo wants to merge 1 commit into
meshy-dev:mainfrom
kvnloo:swarm/a04-crlf-158

Conversation

@kvnloo

@kvnloo kvnloo commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Fixes #158

What changed

  • A .gitattributes: * text=auto eol=lf, with the binary types in the repo (glb jpg mp4 spv tpg webp) marked binary. Every text file is checked out with LF, whatever core.autocrlf says.
  • A test in renderer/src/gpu.rs, the_shaders_are_lf: no file in renderer/shaders/ has a CR in it. If a clone made before this change still has CRLF shaders, this test names the file and says how to check it out again. Without it you just get a contains failure somewhere else, like the ray_aabb one in bvh::tests::the_walk_is_the_kernels_loop.

Why
The repo had no .gitattributes. Git for Windows defaults to core.autocrlf=true, so pathtrace.wgsl and the other files the tests read with include_str! were checked out with CRLF. The tests match multi-line spans joined with \n, so they failed. Fixing this at checkout covers every include_str! source (the shaders, tests/render/lib.ts, the presets). Changing each test one by one wouldn't.

Checks

  • git add --renormalize . changes nothing. Every text file in the index is already LF, so this PR rewrites no file contents.
  • git check-attr shows eol: lf on pathtrace.wgsl and binary on the images. Checking pathtrace.wgsl out with -c core.autocrlf=true gives 0 CRs.
  • the_shaders_are_lf, run on its own with rustc against the shader files: it passes on the LF files and fails with its message once a CRLF line is appended to one of them. I couldn't run the full cargo test here because the environment can't fetch the dlss_wgpu git dependency.
  • npm run typecheck and npm test pass (199 passed, 1 skipped).

No rendering change.

Drafted with AI assistance.

🤖 Generated with Claude Code

…ows (Fixes meshy-dev#158)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kvnloo

kvnloo commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #244 so these review together; closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests fail on a Windows checkout: include_str! sources get CRLF (bvh::tests::the_walk_is_the_kernels_loop)

1 participant