Repository navigation
fix(rust): read rustc commit paths written with a Windows separator - #9192
Plastic-time wants to merge 1 commit into
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The code appears safe to merge; no actionable defects were found. SummaryAccepts a backslash after an embedded rustc commit hash, so Windows-built binaries can report the hash and its file offset.
Reviews (1) · Last reviewed commit: "fix(rust): read rustc commit paths writt..." · Reviewed by Greptile |
Summary
inspect-rust-binaryfinds the rustc commit by scanning read-only data for/rustc/<40-hex>/. Windows builds join the rest of that path with a backslash:lightningcss.win32-x64-msvc.nodestores/rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234\library\core\src\.... REA required the byte after the hash to be/, so it reported no commit for these binaries. It now also accepts\after the hash. The prefix and the 40 lowercase hex digits are unchanged.No issue is linked. I found this by comparing REA with a byte scan of the Rust binaries on a Windows machine.
Problem and expected behavior
On main
a93eb3969, Windows 11:rea inspect-rust-binary <lightningcss-win32-x64-msvc 1.33.0>/lightningcss.win32-x64-msvc.node --jsonreturnsrustc_commit: nulland the limitation "No /rustc/<40-hex>/ path was found in read-only data". The file holds 16 copies of/rustc/ded5c06c…\library\…. That hash is a rust-lang/rust stable-branch merge commit (2025-12-08).C:\Windows\System32\sudo.exebehaves the same way.Expected: a backslash after the hash is read as the same path, and the hash is reported with its file offset.
Change and scope
src/rust/RustBinaryImage.ts:hashAtaccepts/or\after the 40 hex digits.docs/rust-binaries.md: one sentence on the Windows form.Scope decision: not applicable. This is an ordinary fix within the existing Rust inspection.
Contract and boundary impact
RustBinaryImagecompiler-path search. Nothing else changes.rustc_commitis now populated for Windows-built binaries that were reported as having none./are unchanged.evidence_kind: "inferred"with the same limitation text.docs/public/product-catalog.json), package, or installation impact: none committed.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
Tests added or updated: one
it.eachintests/boundary/rust/rustBinaryImage.test.ts, after the existing ELF/PE hash test. It rewrites the byte after the fixture hash.\: the hash is read at offset 2048.-: no hash, so the check stays limited to path separators.Base reproduction: with main's
RustBinaryImage.ts, the file gives 1 failed, 37 passed (the\row). With this change: 38 passed.Real binaries: I scanned 21,275 PE files on this machine (System32, SysWOW64, Program Files, node_modules) for
/rustc/<40-hex>followed by any byte. 37 contain such a path./after the hash. Main reports their one hash.\. Main reports no hash for all 19. Examples:sudo.exe, severalDWriteCore.dllcopies,rollup.win32-x64-msvc.node,jscpd.exe,tree-sitter.exe.User-visible CLI output for
lightningcss.win32-x64-msvc.node:Before:
"rustc_commit": null, with "No /rustc/<40-hex>/ path was found in read-only data, so a rustc commit hash is unknown."After:
Remaining proof gaps: Linux CI has not run yet. I did not check Windows-built ELF or Mach-O files; the change covers them through the same function.
Boundary regressions: artifact parsing of compiler-path strings. Lifecycle regressions: not applicable.
For evidence-bearing changes:
The hash stays inferred. Several distinct hashes still leave the commit unknown.
Validation performed
Windows 11, Node.js 24.22.1, base
a93eb3969.npm run test:focused -- tests/boundary/rust/rustBinaryImage.test.ts: 38 passed. With main'sRustBinaryImage.ts: 1 failed, 37 passed.npm run check:fast: passed.npx oxfmton the three changed files.lightningcss.win32-x64-msvc.nodeandC:\Windows\System32\sudo.exe, before and after, each afternpm run build:cached.git merge-treewith the open PRs that touch these files (feat(audit): report what a shipped app exposes to static analysis #8525, feat(rust): read cargo-auditable dependencies from WebAssembly modules #5069, feat(evidence): project Go and Rust dependencies as CycloneDX #8445, fix(artifacts): retain completed Rust, BEAM, and pyc facts through finalization #6942, fix(artifacts): name a refused symlink's resolved target #8721): no new conflicts.Compatibility, safety, and release
Author readiness
Human owner: @Plastic-time
Before merge
type(scope): outcome.