Skip to content

fix(ci): check out Rust sources as LF on Windows too - #582

Merged
doublegate merged 2 commits into
mainfrom
release/v2.9.8-windows-lf
Oct 3, 2026
Merged

doublegate merged 2 commits into
mainfrom
release/v2.9.8-windows-lf

Conversation

@doublegate

@doublegate doublegate commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Fix the Windows test failure that blocked the v2.9.8 release

After #579 merged, main's CI failed on test (windows-latest) only, so Auto Release skipped v2.9.8.

The cause is the checkout, not the code. The frontend's source-shape tests read app.rs with include_str! and split off the test module at "\n#[cfg(test)]\nmod tests {". The Windows runner checks out CRLF, so the split never matches, and every_load_path_installs_a_dual_system_cabinet counts its own assertion strings (3 against 1).

The fix is *.rs text eol=lf in .gitattributes, beside the existing WGSL/GLSL rule that exists for the same reason. All 523 .rs files are already LF in the index, so no committed byte changes.

Verified: converting app.rs to CRLF locally reproduces the failure exactly, and restoring LF passes it. This branch is named release/* so that its CI runs the Windows leg, which PRs otherwise skip.

Also in this PR (b31047a): the release notes and CHANGELOG now say that v2.9.8 ships the bitstream pair compiled on 2026-10-01. On release day the on-die compile missed timing by 0.162 ns, and the maintainer chose to ship the 261001 pair, which is timing-clean, byte-identical across two compiles, and built from the same hardware sources. Both md5s are now in the notes. The MiSTer repository carries the matching change.

Once this merges and main goes green, Auto Release publishes v2.9.8 from that commit.

🤖 Generated with Claude Code

main's CI failed after the v2.9.8 merge (0bd814d), on `test
(windows-latest)` only, so Auto Release skipped and v2.9.8 has no tag yet.
The failure:

  app::tests::every_load_path_installs_a_dual_system_cabinet
  `build_dual_cabinet` is called from `cabinet_for_image` only
  left: 3, right: 1

The cause is the checkout, not the code. The frontend's source-shape
tests read app.rs with include_str! and cut off the test module at
"\n#[cfg(test)]\nmod tests {". The windows-latest runner checks out
with core.autocrlf, so the file is CRLF and that pattern never matches.
The "production" text is then the whole file, and the test counts its
own assertion strings: three occurrences of `self.build_dual_cabinet(`
where production has one. Splits on the bare "\n#[cfg(test)]" survive
CRLF, because the "\n" is still inside "\r\n"; only the two
"...\nmod tests {" splits break, which is why one test failed and not
six.

Pull requests never saw it: the matrix gives non-release PRs Linux
only, and Windows tests run on main and on release/* branches. This
branch is named release/* so its PR runs Windows.

Fix: `*.rs text eol=lf` in .gitattributes, next to the existing
WGSL/GLSL rule that exists for the same reason (a byte-compared shader
generator). Every .rs file is already LF in the index (`git ls-files
--eol`: 523 of 523 i/lf), so no committed byte changes; only what a
Windows checkout writes. Rust compiles LF sources on every platform.

Not done: making each test split CRLF-tolerant. The attribute fixes the
cause for every test that reads source, including future ones, which a
per-test patch would not.

Verified: converting app.rs to CRLF locally reproduces the failure
exactly (left 3, right 1); restoring LF passes it. `git check-attr`
reports eol=lf for app.rs. The Windows leg of this PR's CI is the real
check.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 3, 2026 13:48
@doublegate

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: doublegate/RustyNES/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: e4c0b291-91ad-4d7e-82de-25724f6253bd
📥 Commits

Reviewing files that changed from the base of the PR and between 0bd814d and 829a885.

📒 Files selected for processing (1)
  • .gitattributes

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The .gitattributes file now includes an explanation and a rule that forces LF line endings for all Rust files.

Changes

Rust line endings

Layer / File(s) Summary
Rust line-ending rule
.gitattributes
Adds an explanation and the *.rs text eol=lf rule.

Priority: ⬆️ High

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 829a8

The change addresses the reported Windows line-ending issue, with no concrete merge-blocking risk evident.

Architecture Summary

Architecture risk: 🔵 Low · up to 829a8

The changed surface does not map to a changed system, dependency edge, entrypoint, or external dependency.

Changed systems: None identified.

Architecture concerns
No architecture-level concerns identified.

Review details

Before / after behavior

  • observed — Modified behavior in .gitattributes: Adds an explanation and *.rs text eol=lf rule, forcing LF checkouts for Rust files.
🚥 Pre-merge checks | ✅ 9
✅ Passed checks (9 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Docs-As-Spec Sync ✅ Passed The pull request changes only .gitattributes. It adds *.rs text eol=lf and changes no files in the CPU, PPU, APU, or mappers crates. Therefore, it does not change observable chip behavior, and the…
Changelog Entry For User-Visible Changes ✅ Passed The pull request changes only .gitattributes, adding *.rs text eol=lf to control Rust source checkout line endings. This fixes a Windows CI test failure and does not change user-visible behavior. …
No Unwrap/Expect/Panic On Untrusted Input ✅ Passed The pull-request range changes only .gitattributes. It adds *.rs text eol=lf and does not modify Rust source or add any .unwrap(), .expect(), or panic!() call. The custom check's failure con…
Safety Comment On New Unsafe Blocks ✅ Passed The PR changes only .gitattributes. Its additions set LF line endings for Rust files and add explanatory comments. The diff introduces no unsafe { ... } blocks or unsafe fn declarations.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: ensuring Rust sources use LF line endings on Windows.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Antigravity review (Gemini via Ultra)

This PR enforces LF line endings for all Rust source files during checkout and updates the v2.9.8 release notes and changelog with bitstream build details.

Blocking issues

None found.

Suggestions

  • Scope mismatch: The PR title and the .gitattributes change are scoped to fixing Windows CI, but the diff includes unrelated modifications to the v2.9.8 release notes and CHANGELOG.md regarding bitstream dates and hashes. Consider splitting these into two separate PRs to keep changes atomic and histories clear.
  • .gitattributes (lines 8-13): The comment explaining the specific CI failure is very detailed. This historical context is usually better placed in the commit message rather than the configuration file itself.

Nitpicks

None.

Automated first-pass review by agy on a self-hosted runner -- not a human review.

Earlier review rounds (newest first)
Round reviewed at 2026-10-03 14:02 UTC

Antigravity review (Gemini via Ultra)

This PR enforces LF line endings for all Rust source files in .gitattributes to resolve a Windows-specific CI test failure caused by include_str! string splitting.

Blocking issues

None found.

Suggestions

None.

Nitpicks

  • .gitattributes lines 8-16: The explanatory comment is unusually long and detailed for this configuration file; consider shortening it to just mention the include_str! test requirement.

Automated first-pass review by agy on a self-hosted runner -- not a human review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The attribute directly addresses the verified CRLF-sensitive test behavior without changing source bytes.

Review effort: Balanced
Findings: None

What changed in this PR

Enforces LF endings for Rust sources so source-shape tests behave consistently on Windows.

Changes:

  • Adds *.rs text eol=lf to .gitattributes.
  • Documents the Windows-only CI failure and fix.
File Description
.gitattributes Forces LF endings for checked-out Rust files.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

The release notes promised bitstreams "compiled from the release commit
at fitter seed 2, on the day of the release". That is no longer true.
The release-day compile of the merged sibling (65d86a6, BUILD_DATE
261003) missed on-die setup by 0.162 ns on the pll_hdmi output counter
(Slow 1100mV -40C), and release-rbf.sh refused it. The off-die build
closed (+0.033 / +0.116 ns).

At the maintainer's direction (2026-10-03, the v2.9.3 precedent),
v2.9.8 ships the pair compiled at 261001. That compile came from
hardware sources identical to the release commit: the diff of rtl/,
sys/, *.qip and *.sdc between its tree (e2f88bd) and the merge is
empty. Timing: on-die +0.656 / +0.105 ns, off-die +0.033 / +0.116 ns.
Two clean compiles of each were byte-identical: on-die 132ec5c0...,
off-die 995f8259....

The notes now say exactly that, carry both md5s (the old text promised
to add them on attach), and name the datecoded on-die file,
RustyNES_20261001.rbf. The sibling's releases/ change is its PR #50.
CHANGELOG's Verification bullet records the same fact. The release
audits (notes render, anchors, state prose) pass, and markdownlint is
clean.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@doublegate

Copy link
Copy Markdown
Owner Author

Answering Antigravity (no blocking items):

  • Scope: kept together on purpose. Both commits are what stands between the merged v2.9.8 and its published release. Auto Release publishes from the notes on main once main is green, so the corrected bitstream paragraph has to land in the same merge as the CI fix, or the release goes out with the old text. The two commits stay separate in history.
  • The long .gitattributes comment: kept. The file already explains its existing rule the same way, and the reason (source-reading tests that silently stop working on a CRLF checkout) is what stops someone removing the line later.

@doublegate
doublegate merged commit d243130 into main Oct 3, 2026
34 checks passed
@doublegate
doublegate deleted the release/v2.9.8-windows-lf branch October 3, 2026 14:29
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.

2 participants