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.
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.

1 participant