[PR #3477] [CLOSED] fix(rust): retain compiler paths in unnamed ELF sections #5767

Closed
opened 2026-10-31 01:09:17 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3477
Author: @chqcjq
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: fix/rust-unnamed-elf-sections


📝 Commits (4)

  • b4e022a fix(rust): retain compiler paths in unnamed ELF sections
  • 3c1703c Merge remote-tracking branch 'origin/main' into fix/rust-unnamed-elf-sections
  • b6a8a94 fix(ci): cover GitHub action sources in lint cache inputs
  • d27f40b fix(ci): normalize Windows paths in duplication reports

📊 Changes

4 files changed (+149 additions, -71 deletions)

View changed files

📝 scripts/ci/static-check-report.mjs (+7 -2)
📝 src/go/GoElfImage.ts (+73 -69)
➕ tests/acceptance/rustUnnamedSectionsCli.test.ts (+67 -0)
📝 turbo.json (+2 -0)

📄 Description

Summary

Fixes #3397. Rust compiler-path inference now retains file-backed read-only ELF sections when their names are empty or the optional section-name table is absent.

Problem and expected behavior

An authored ELF with a complete /rustc/<40-hex>/ path returns the inferred hash when the section is named, but returns rustc_commit: null after only its name index is cleared or its optional name table is removed. Names do not determine whether the section's declared bytes are read-only data.

Change and scope

Record section facts independently of the optional name table. Empty/unavailable names reuse the existing truncated-name path, retaining only sections that already satisfy the read-only/file-backed predicate. Named .dep-v0 and Go build-info matching still require an available exact name. This fixes the shared ELF producer rather than adding a Rust-specific scan of arbitrary bytes.

The section loop moves outside the name-table branch; most of the production diff is its necessary reindentation. No CLI/MCP schema, package metadata, authority, or target-execution capability changes. Maintainer scope decision: not applicable to this ordinary static inspection fix.

Evidence and validation

  • Before the fix: four public CLI/stdio MCP regressions fail for unnamed/no-name-table inputs; two named controls pass.
  • After the fix: all six public regressions pass. They preserve each selected file's SHA-256, the inferred hash's exact offset (2048), and auditable_metadata: null. Changing the same section to writable still yields rustc_commit: null in all three naming modes.
  • Focused Rust/Go run: eight files, 160 tests pass and two existing Windows-conditional cases skip. Includes image/mapping/provider checks and compiled Rust/Go CLI plus Rust MCP workflows.
  • npm run check and npm run check:ci — pass.
  • npm run docs:check — pass.
  • npm run verify:test-discovery — all 1,275 test files discovered exactly once.

Source/diff review traced section-name availability, the existing read-only predicate, Rust's merged range scanner, and Go's named build-info/fallback paths. Executed on Windows with pinned Node 24.18.0. Inputs are authored synthetic ELF images; no real compiler-built binaries, Linux/macOS runtime, optional deep provider, or full repository suite was exercised. Targets are never executed.

Latest CI integration validation

Synced this branch with main eab789aed. Both lint task cache inputs now include checker-consumed code under .github, correcting the CI inventory failure caused by the publishing-action files.

Commit d27f40b67 addresses the valid review finding that the previous test-side path conversion could hide incorrect saved report paths. The test again asserts the raw report names. The report writer now normalizes both absolute paths to the same Windows namespace before computing relative paths; clone locations and threshold handling are preserved. Restoring the strict assertion reproduced absolute //?/C:/... names before the writer fix, and the unchanged assertion passes after it.

Executed for this correction: 4 files / 124 tests pass on the current head (public Rust controls, Rust/Go image tests and static-check reports); npm run check:ci and normal pre-push checks pass. New-head remote CI is pending. Earlier validation above applies to its stated revisions; native runtime checks were not repeated for this CI/reporting correction.

Author readiness

Human owner: @chqcjq

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

The human owner's readiness declarations are recorded above.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/3477 **Author:** [@chqcjq](https://github.com/chqcjq) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/rust-unnamed-elf-sections` --- ### 📝 Commits (4) - [`b4e022a`](https://github.com/morluto/rea/commit/b4e022af4c69a5a51637273a4bf9bb836a19f2a4) fix(rust): retain compiler paths in unnamed ELF sections - [`3c1703c`](https://github.com/morluto/rea/commit/3c1703c3aa365c346d1ac8ed6e41477e640131dc) Merge remote-tracking branch 'origin/main' into fix/rust-unnamed-elf-sections - [`b6a8a94`](https://github.com/morluto/rea/commit/b6a8a940a105832d3ff79d2bbb93be304c7c0ebd) fix(ci): cover GitHub action sources in lint cache inputs - [`d27f40b`](https://github.com/morluto/rea/commit/d27f40b6759bf2d596c36d86e338aee02f682336) fix(ci): normalize Windows paths in duplication reports ### 📊 Changes **4 files changed** (+149 additions, -71 deletions) <details> <summary>View changed files</summary> 📝 `scripts/ci/static-check-report.mjs` (+7 -2) 📝 `src/go/GoElfImage.ts` (+73 -69) ➕ `tests/acceptance/rustUnnamedSectionsCli.test.ts` (+67 -0) 📝 `turbo.json` (+2 -0) </details> ### 📄 Description ## Summary Fixes #3397. Rust compiler-path inference now retains file-backed read-only ELF sections when their names are empty or the optional section-name table is absent. ## Problem and expected behavior An authored ELF with a complete `/rustc/<40-hex>/` path returns the inferred hash when the section is named, but returns `rustc_commit: null` after only its name index is cleared or its optional name table is removed. Names do not determine whether the section's declared bytes are read-only data. ## Change and scope Record section facts independently of the optional name table. Empty/unavailable names reuse the existing truncated-name path, retaining only sections that already satisfy the read-only/file-backed predicate. Named `.dep-v0` and Go build-info matching still require an available exact name. This fixes the shared ELF producer rather than adding a Rust-specific scan of arbitrary bytes. The section loop moves outside the name-table branch; most of the production diff is its necessary reindentation. No CLI/MCP schema, package metadata, authority, or target-execution capability changes. Maintainer scope decision: not applicable to this ordinary static inspection fix. ## Evidence and validation - Before the fix: four public CLI/stdio MCP regressions fail for unnamed/no-name-table inputs; two named controls pass. - After the fix: all six public regressions pass. They preserve each selected file's SHA-256, the inferred hash's exact offset (2048), and `auditable_metadata: null`. Changing the same section to writable still yields `rustc_commit: null` in all three naming modes. - Focused Rust/Go run: eight files, **160 tests pass and two existing Windows-conditional cases skip**. Includes image/mapping/provider checks and compiled Rust/Go CLI plus Rust MCP workflows. - `npm run check` and `npm run check:ci` — pass. - `npm run docs:check` — pass. - `npm run verify:test-discovery` — all 1,275 test files discovered exactly once. Source/diff review traced section-name availability, the existing read-only predicate, Rust's merged range scanner, and Go's named build-info/fallback paths. Executed on Windows with pinned Node 24.18.0. Inputs are authored synthetic ELF images; no real compiler-built binaries, Linux/macOS runtime, optional deep provider, or full repository suite was exercised. Targets are never executed. ## Latest CI integration validation Synced this branch with main `eab789aed`. Both lint task cache inputs now include checker-consumed code under `.github`, correcting the CI inventory failure caused by the publishing-action files. Commit `d27f40b67` addresses the valid review finding that the previous test-side path conversion could hide incorrect saved report paths. The test again asserts the raw report names. The report writer now normalizes both absolute paths to the same Windows namespace before computing relative paths; clone locations and threshold handling are preserved. Restoring the strict assertion reproduced absolute `//?/C:/...` names before the writer fix, and the unchanged assertion passes after it. Executed for this correction: 4 files / 124 tests pass on the current head (public Rust controls, Rust/Go image tests and static-check reports); `npm run check:ci` and normal pre-push checks pass. New-head remote CI is pending. Earlier validation above applies to its stated revisions; native runtime checks were not repeated for this CI/reporting correction. ## Author readiness Human owner: @chqcjq - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. The human owner's readiness declarations are recorded above. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:09:17 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5767
No description provided.