-
Notifications
You must be signed in to change notification settings - Fork 147
Open
Description
With this BUILD file in the root of the repo:
load("@rules_cc//cc:defs.bzl", "cc_library")
cc_library(
name = "lib",
srcs = ["lib.cc"],
additional_compiler_inputs = [
"foo.txt",
],
copts = [
"-std=c++23",
"-Wno-c23-extensions",
],
local_defines = [
"THING=\\\"$(execpath foo.txt)\\\"",
],
)If you build this target with 9.0.0rc3 + 943f3b0 you get:
% CC=clang USE_BAZEL_VERSION=last_rc bazel build :lib
INFO: Analyzed target //:lib (1 packages loaded, 3 targets configured).
ERROR: /tmp/repro/BUILD.bazel:3:11: Compiling lib.cc failed: absolute path inclusion(s) found in rule '//:lib':
the source file 'lib.cc' includes the following non-builtin files with absolute paths (if these are builtin files, make sure these paths are in your toolchain):
'/tmp/repro/foo.txt'
Target //:lib failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.741s, Critical Path: 0.43s
INFO: 3 processes: 3 internal.
ERROR: Build did NOT complete successfully
If you use the exact same structure in a nested directory it works as expected:
% CC=clang USE_BAZEL_VERSION=last_rc bazel build nested:lib
INFO: Analyzed target //nested:lib (1 packages loaded, 3 targets configured).
INFO: Found 1 target...
Target //nested:lib up-to-date:
bazel-bin/nested/liblib.a
bazel-bin/nested/liblib.so
INFO: Elapsed time: 0.141s, Critical Path: 0.00s
INFO: 1 process: 4 action cache hit, 1 internal.
INFO: Build completed successfully, 1 total action
Metadata
Metadata
Assignees
Labels
No labels