Skip to content

Source directories experience confusion between external repo and main repo #29688

Description

@dzbarsky

Description of the bug:

When an external repo defines a filegroup that includes a source directory (such as tools) and the main repo has a tools/docker/BUILD.bazel, Bazel seems to be confused between the repos and raises an error.

Which category does this issue belong to?

No response

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Checkout hermeticbuild/actiond#11

➜  bazel build --config=remote //vm:linux_kernel_zst
INFO: Invocation ID: 46483c19-14c0-40a3-8345-997ca430427b
INFO: Streaming build results to: https://app.buildbuddy.io/invocation/46483c19-14c0-40a3-8345-997ca430427b
INFO: Checking for file changes...
INFO: Analyzed target //vm:linux_kernel_zst (2 packages loaded, 1187 targets configured).
ERROR: /Users/dzbarsky/Library/Caches/bazel/_bazel_dzbarsky/d26df6d582dafee93a7454dde7d5692f/external/linux.bzl++linux_kernel+actiond_vm_compact/BUILD.bazel:6790:13: Compiling Linux object @@linux.bzl++linux_kernel+actiond_vm_compact//:init_initramfs__9d77b2a4745b235a failed: error traversing directory '@@linux.bzl++linux_kernel+linux_6_18_2//:tools': Directory artifact tools crosses package boundary into package rooted at tools/docker
ERROR: /Users/dzbarsky/Library/Caches/bazel/_bazel_dzbarsky/d26df6d582dafee93a7454dde7d5692f/external/linux.bzl++linux_kernel+actiond_vm_compact/BUILD.bazel:6790:13: Compiling Linux object @@linux.bzl++linux_kernel+actiond_vm_compact//:init_initramfs__9d77b2a4745b235a failed: 1 input file(s) are in error
Target //vm:linux_kernel_zst failed to build

Which operating system are you running Bazel on?

Mac

What is the output of bazel info release?

No response

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?


If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

Metadata

Metadata

Assignees

Labels

P1I'll work on this now. (Assignee required)team-CoreSkyframe, bazel query, BEP, options parsing, bazelrctype: bug

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions