bazelbuild / bazelbuild/bazel

references a path outside of the execution root

Open
#23,325 1 comment 0 reactions 0 assignees View on GitHub
more data needed team-Rules-CPP type: bug untriaged
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

package(default_visibility = ["//visibility:public"])

load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")

cc_library(
name = "libbpf",
srcs = glob([
"libbpf/src/*.c",
"libbpf/src/*.h",
]),
hdrs = glob([
"libbpf/src/*.h",
]),
includes = ["libbpf/src"],
copts = [
"-Ilibbpf/src",
"-Ilibbpf/include",
"-DPACKAGE=\"bpftool\"",
"-I/usr/src/linux-headers-6.8.0-40-generic/include",
"-D__EXPORTED_HEADERS__"
],
linkopts = ["-lelf", "-lz"]
)

Contributor guide

Open the contributing guide

Research direction

Start with the reported cc_library rule and reproduce the error using the shown /usr/src/linux-headers-6.8.0-40-generic/include path. Trace how Bazel handles this include path relative to the execution root; done means the rule no longer reports an outside-root reference while retaining the shown libbpf build inputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.