Make filetypes case insensitive on Windows#14005
Make filetypes case insensitive on Windows#14005torgil wants to merge 2 commits intobazelbuild:masterfrom
Conversation
|
This is aimed to solve issues like #13879 (comment) Is it better to add the case insensitivity case-by-case (or even casing case-by-case) rather than going for a general approach? |
4bfa043 to
a7f9d6c
Compare
Filetypes are based on checking file-extensions which are case insensitive on Windows. For example, A lib file could be named .lib, Lib, etc which is currently not allowed in for example cc_import. This patch allows file extensions to vary in case on Windows.
a7f9d6c to
d1f92e4
Compare
| @Override | ||
| public boolean apply(String path) { | ||
| return (path.endsWith(ext) && !PIC_ASSEMBLER.matches(path)) || path.endsWith(".asm"); | ||
| return (OS.endsWith(path, ext) && !PIC_ASSEMBLER.matches(path)) || OS.endsWith(path, ".asm"); |
There was a problem hiding this comment.
This could make .S files end up with ASSEMBLE action instead of PREPROCESS_ASSEMBLE on Windows?
src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java:
} else if (CppFileTypes.ASSEMBLER.matches(sourcePath)) {
return CppActionNames.ASSEMBLE;
} else if (CppFileTypes.ASSEMBLER_WITH_C_PREPROCESSOR.matches(sourcePath)) {
return CppActionNames.PREPROCESS_ASSEMBLE;
There was a problem hiding this comment.
Indeed, is this a serious problem? Do you know how to distinguish assemble and preprocess assemble actions on Windows?
There was a problem hiding this comment.
@meteorcloudy we just saw that this is a problem also with .c and .C files, on one side Bazel considers .c as C and .C as C++, once you are case insensitive on Windows there is the problem that the .c files end up as C++ files.
There was a problem hiding this comment.
Yeah, looks like Make filetypes case insensitive is going to be an incompatible change, which may not have much gains for us. I think maybe the correctly way to is to make filetype configuration first? Just like the artifcat extension for binary/static library/dynamic library /cc @oquenchil
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.
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.
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.
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 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 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 bazelbuild#14005 where .c and .C extensions were handled case-insensitive on Windows so the cxxopt will be passed to C source files. Closes bazelbuild#15073 .
This fixes an issue introduced by PR bazelbuild#14005 where .c and .C extensions were handled case-insensitive on Windows so the cxxopt will be passed to C source files. Closes bazelbuild#15073 . Closes bazelbuild#18119. PiperOrigin-RevId: 526001251 Change-Id: I464e5feae397bdac443ddd159309f77071629e01
This fixes an issue introduced by PR bazelbuild#14005 where .c and .C extensions were handled case-insensitive on Windows so the cxxopt will be passed to C source files. Closes bazelbuild#15073 . Closes bazelbuild#18119. PiperOrigin-RevId: 526001251 Change-Id: I464e5feae397bdac443ddd159309f77071629e01
This fixes an issue introduced by PR #14005 where .c and .C extensions were handled case-insensitive on Windows so the cxxopt will be passed to C source files. Closes #15073 . Closes #18119. PiperOrigin-RevId: 526001251 Change-Id: I464e5feae397bdac443ddd159309f77071629e01 Co-authored-by: Kai Zhang <kylerzhang11@gmail.com>
Filetypes are based on checking file-extensions which are case insensitive on Windows.
For example, A lib file could be named .lib, Lib, etc which is currently not allowed
in for example cc_import.
This patch allows file extensions to vary in case on Windows.