- Notifications
You must be signed in to change notification settings - Fork4.3k
Description
Description of the bug:
Bazel does not seem to be re-fetching / re-evaluating repositories if aBUILD.bazel for a label denoting the package boundary is removed while still being referenced by the repository.
See the repro code below for an example.
I expected to see an error like
BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.but instead the build passes no problem. I am only able to force the error after runningbazel clean --expunge --async.
Which category does this issue belong to?
Core
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
https://github.com/lamcw/bazel-repo-invalidate-repro
Run the following in the above Git repository:
$bazel build @gtest//:readme# builds ok$rm -f third_party/gtest/BUILD.bazel$bazel build @gtest//:readme# should fail, but builds ok
Which operating system are you running Bazel on?
MacOS
What is the output ofbazel info release?
release 8.4.2
Ifbazel info release returnsdevelopment version or(@non-git), tell us how you built Bazel.
No response
What's the output ofgit 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.
I have yet to run a bisect, but this is reproducible on Bazel 7.7.0 and 7.6.2
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
Inspecting$(bazel info output_base)/java.log, I can see that the Bazel server detects changes in the relevant BUILD.bazel file, but somehow decided not to re-evaluate the repository.
$grep'BUILD.bazel'$(bazel info output_base)/java.log251105 08:39:40.285:I 172 [com.google.devtools.build.lib.skyframe.SkyframeExecutor.logDiffInfo] DiffAwareness found 1 modified source files and directory listings for /Users/thomaslam/work/bazel-repo-invalidate-repro: [/Users/thomaslam/work/bazel-repo-invalidate-repro]/[third_party/gtest/BUILD.bazel]