Skip to content

Fix compiling assembly on OSX#801

Open
AustinSchuh wants to merge 3 commits into
bazel-contrib:masterfrom
AustinSchuh:assembly_fix_mac
Open

Fix compiling assembly on OSX#801
AustinSchuh wants to merge 3 commits into
bazel-contrib:masterfrom
AustinSchuh:assembly_fix_mac

Conversation

@AustinSchuh

Copy link
Copy Markdown
Contributor

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

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>
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>
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
@AustinSchuh AustinSchuh changed the title Add redacted_dates.h to assembler-files filegroup Fix compiling assembly on OSX Jul 9, 2026
@fmeum

fmeum commented Jul 10, 2026

Copy link
Copy Markdown
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.

@helly25

helly25 commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

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

Right. It's the reason there is no new release

@AustinSchuh

Copy link
Copy Markdown
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.

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.

3 participants