Skip to content

feat(render): detect case-insensitive filename collisions in rendered output#117

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/flag-source-files-case-collision
Draft

feat(render): detect case-insensitive filename collisions in rendered output#117
Copilot wants to merge 3 commits intomainfrom
copilot/flag-source-files-case-collision

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

Some packages (e.g. Fedora's chromium) ship source files whose names differ only in case — these collide on case-insensitive filesystems encountered during Windows git clones.

Changes

  • checkCaseCollisions — new helper in render.go that recursively walks the component staging directory after unreferenced files are removed, building a lowercase→original-path map and collecting any case-insensitive collisions.
  • Integrated into finishComponentRender — collision detection runs before the copy to output. When collisions are found, the files are still copied to the output directory (the tool runs on Linux where the files coexist without issue), and the component is marked status: error in the results table with a message listing the colliding pairs and suggesting an overlay fix. All other components continue rendering unaffected.
  • caseCollisionError sentinel type — allows finishOneComponent to distinguish a collision error (files copied successfully) from a hard failure, so the output directory is preserved and no RENDER_FAILED marker is written.

Example error output for a colliding component:

case-insensitive filename collision in "chromium":
files with names that differ only in case would collide on case-insensitive filesystems (e.g. Windows git clones):
"0001-Implement-support-for-PPC64-on-Linux.patch" collides with "0001-Implement-support-for-ppc64-on-Linux.patch"
to fix, create an overlay to rename one of the colliding files
  • Unit tests — cover: no collision, top-level collision, subdirectory collision, empty directory, multiple collision pairs.

Copilot AI requested review from Copilot and removed request for Copilot April 23, 2026 17:19
Copilot AI linked an issue Apr 23, 2026 that may be closed by this pull request
Copilot AI requested review from Copilot and removed request for Copilot April 23, 2026 17:23
Copilot AI changed the title [WIP] Add error reporting for source files that differ by case feat(render): detect case-insensitive filename collisions in rendered output Apr 23, 2026
Copilot AI requested a review from dmcilvaney April 23, 2026 17:39

// Check for files whose names differ only by case. Such files collide on
// case-insensitive filesystems (e.g. Windows git clones).
if collisionErr := checkCaseCollisions(env.FS(), componentDir); collisionErr != nil {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@copilot The intent is to do as much of the render as possible, this tool will be running in a linux environment so there is no reason not to copy the files AND return an error.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 877706f. The collision check now runs before the copy, but if collisions are found the copy still proceeds. A caseCollisionError sentinel type lets finishOneComponent distinguish this case and skip the RemoveAll/RENDER_FAILED marker — so the output directory contains the fully-rendered files while the component is still reported as error in the table.

Copilot AI requested review from Copilot and removed request for Copilot April 23, 2026 17:52
Copilot AI requested a review from dmcilvaney April 23, 2026 17:54
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.

[Copilot] Flag source files with names that only differ by case

2 participants