Skip to content

Fix case-insensitive header discovery and validation.#9

Draft
yuzhy8701 wants to merge 1 commit intofmeum:28803-inclusion-checkfrom
yuzhy8701:28803-extra-2
Draft

Fix case-insensitive header discovery and validation.#9
yuzhy8701 wants to merge 1 commit intofmeum:28803-inclusion-checkfrom
yuzhy8701:28803-extra-2

Conversation

@yuzhy8701
Copy link
Copy Markdown

This change refines how discovered includes are resolved and validated on case-insensitive file systems. Particularly, paths returned by the compiler cannot be trusted to have the correct case. We need to scan action inputs to retrieve the correct artifact. This is important when bazel is running from case-sensitive FS while the the actions run on a case-insensitive FS.

Major changes:

  • ArtifactFactory: The resolveSourceArtifactsAsciiCaseInsensitively method no longer creates new source artifacts if not found in the cache, as the exact casing is unknown at that point.
  • CppCompileAction: The validateInclusions method is refactored to use a map for unvalidated inputs for better efficiency.
  • HeaderDiscovery: The resolution process is rewritten to a multi-stage approach: first checking derived artifacts and the source cache, then action inputs, and finally handling special cases like cppmap and tree artifacts. To reduce the memory impact of input scanning, We avoid building map / set from all the inputs - but building from discovered deps instead.

This change refines how discovered includes are resolved and validated on case-insensitive file systems. Particularly, paths returned by the compiler cannot be trusted to have the correct case. We need to scan action inputs to retrieve the correct artifact. This is important when bazel is running from case-sensitive FS while the the actions run on a case-insensitive FS.

Major changes:

*   `ArtifactFactory`: The `resolveSourceArtifactsAsciiCaseInsensitively` method no longer creates new source artifacts if not found in the cache, as the exact casing is unknown at that point.
*   `CppCompileAction`: The `validateInclusions` method is refactored to use a map for unvalidated inputs for better efficiency.
*   `HeaderDiscovery`: The resolution process is rewritten to a multi-stage approach: first checking derived artifacts and the source cache, then action inputs, and finally handling special cases like `cppmap` and tree artifacts. To reduce the memory impact of input scanning, We avoid building map / set from all the inputs - but building from discovered deps instead.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

Thank you for contributing to the Bazel repository! This pull request has been marked as stale since it has not had any activity in the last 30 days. It will be closed in the next 30 days unless any other activity occurs. If you think this PR is still relevant and should stay open, please post any comment here and the PR will no longer be marked as stale.

@github-actions github-actions Bot added the stale label May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant