bazelbuild/bazel

local_repository() pointing into workspace is not invalidated when external repo file checking is disabled.

Open

#27365 opened on Oct 20, 2025

View on GitHub
 (4 comments) (0 reactions) (0 assignees)Java (25,384 stars) (4,465 forks)batch import
P2help wantedteam-ExternalDepstype: bug

Description

Description of the bug:

Hi!

I noticed that our warm Bazel implementation started complaining about inconsistent file sizes in @@+local_repository+blah//, when someone edited //third_party/blah/BUILD. It turns out that this repo was configured as

local_repository(
    name = "blah",
    path = "third_party/blah",
)

We are running with --watchfs --experimental_check_external_repository_files=false.

I am 99% sure that this problem is caused by --noexperimental_check_output_files not specially treating external repositories that point back into the source tree.

My gut feeling is that making this work will be hard, and I wonder if we could instead forbid this?

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.

No response

Which operating system are you running Bazel on?

No response

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

Contributor guide