Fix compiling assembly on OSX#801
Open
AustinSchuh wants to merge 3 commits into
Open
Conversation
e0b46f9 to
ef903fc
Compare
PR bazel-contrib#756 introduced date macro redaction by force-including a generated redacted_dates.h header via the `-imacros` flag in unfiltered compile flags. Since unfiltered compile flags are passed to all driver invocations (including assembly compilations), clang tries to load this header when compiling assembler (`.s` / `.S`) files. However, redacted_dates.h was only declared as an input file in the C/C++ compiler-components filegroup, and was missing from the assembler-files filegroup. This caused assembly compiles to fail with a fatal error: "external/toolchains_llvm++llvm+llvm_toolchain/redacted_dates.h file not found" as the header was absent from the assembler action's sandbox. Fix this by adding redacted_dates.h to the assembler-files filegroup definitions (both absolute-path and relative-path configurations) in toolchain/internal/configure.bzl. Also add a regression test compiling an empty assembly file to ensure the assembler can successfully resolve redacted_dates.h. Signed-off-by: Austin Schuh <austin.linux@gmail.com>
ef903fc to
ae7df5a
Compare
The old version 6.3-2ubuntu0.1 was removed from the Ubuntu mirrors, causing curl to fail with a 404 in CI. Update to 6.3-2ubuntu0.2. Signed-off-by: Austin Schuh <austin.linux@gmail.com>
1d19bf5 to
97a170c
Compare
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
Member
|
@AustinSchuh We may have to roll back the original fix since it broke some other ways in which foreign build systems were run in a Bazel build. |
Collaborator
Right. It's the reason there is no new release |
Contributor
Author
|
Sounds good. I think the compile test should get merged anyways since I confirmed it caught the problem. But happy to wait until the dust settles. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #756 introduced date macro redaction by force-including a generated redacted_dates.h header via the
-imacrosflag in unfiltered compile flags. Since unfiltered compile flags are passed to all driver invocations (including assembly compilations), clang tries to load this header when compiling assembler (.s/.S) files.However, redacted_dates.h was only declared as an input file in the C/C++ compiler-components filegroup, and was missing from the assembler-files filegroup. This caused assembly compiles to fail with a fatal error:
"external/toolchains_llvm++llvm+llvm_toolchain/redacted_dates.h file not found"
as the header was absent from the assembler action's sandbox.
Fix this by adding redacted_dates.h to the assembler-files filegroup definitions (both absolute-path and relative-path configurations) in toolchain/internal/configure.bzl.
Also add a regression test compiling an empty assembly file to ensure the assembler can successfully resolve redacted_dates.h.