-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make cpp assembly file extensions case sensitive again #14131
Make cpp assembly file extensions case sensitive again #14131
Conversation
src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java
Outdated
Show resolved
Hide resolved
bdb45e3
to
6fe58ee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@lberki, can we merge this so we don't need to maintain this patch locally when doing uplifts? |
@buildbreaker2021 will take over the review and import. |
6fe58ee
to
5e877f0
Compare
This fixes an issue introduced by PR bazelbuild#14005 where .s and .S extensions were handled case-insensitive on Windows so the action assemble was triggered instead of preprocess_assemble.
5e877f0
to
a6eea24
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR seems to negate the assumptions made in WindowsOsPathPolicy.endsWith, that Windows don't know about character case (upper/lower). https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/vfs/WindowsOsPathPolicy.java;l=213;drc=9cb59369a84d9328c2929eefcb58c1b972ab15f2
Having a special case for Windows in CppFileTypes introduces a tech debt in my opinion - there's lack of comments (in this PR) why there is a need for a special case here. Please add a comment with a link to an issue.
I think the right thing to do is to remove the assumption (of case insensitivity) in WindowsOsPathPolicy and then fix the locations where poorly behaved toolchains create either lower or upper cased suffices.
This would reintroduce the issues in #14005. The "right thing" question in there was never properly discussed but you could reason that a new windows user would have a hard time to "fix" third-party libraries for casing (Microsoft clibs package in my case) or make Windows-specific case-by-case additions to CppFileTypes. |
Sure, I agree. Would you mind just adding a comment to the code, that "FileType is extended to use case-sensitive comparison also on Windows". I don't want the next developer hitting their head on it. When this piece of code is rewritten to Starlark, we won't have the luxury of extending FileType, all file types will need to be listed case-sensitively. Perhaps special cased for linux/windows/macos one level higher. I'm not sure if it's a good or a bad news we only need to special case this one special operating system :) |
110be21
to
7094ec4
Compare
Ok for merge now? |
This fixes an issue introduced by PR bazelbuild#14005 where .s and .S extensions were handled case-insensitive on Windows so the action assemble was triggered instead of preprocess_assemble. Closes bazelbuild#14131. PiperOrigin-RevId: 412005097
@bazel-io flag |
This fixes an issue introduced by PR bazelbuild#14005 where .s and .S extensions were handled case-insensitive on Windows so the action assemble was triggered instead of preprocess_assemble. Closes bazelbuild#14131. PiperOrigin-RevId: 412005097
@bazel-io fork 5.3.0 |
This fixes an issue introduced by PR bazelbuild#14005 where .s and .S extensions were handled case-insensitive on Windows so the action assemble was triggered instead of preprocess_assemble. Closes bazelbuild#14131. PiperOrigin-RevId: 412005097
This fixes an issue introduced by PR #14005 where .s and .S extensions were handled case-insensitive on Windows so the action assemble was triggered instead of preprocess_assemble. Closes #14131. PiperOrigin-RevId: 412005097 Co-authored-by: Simon Bjorklen <[email protected]>
This fixes an issue introduced by PR #14005 where .s and .S
extensions were handled case-insensitive on Windows so the action
assemble was triggered instead of preprocess_assemble.