Loading top-level targets in local_path_override modules in child directory breaks the build #22208
Labels
area-Bzlmod
Bzlmod-specific PRs, issues, and feature requests
P2
We'll consider working on this in future. (Assignee optional)
team-ExternalDeps
External dependency handling, remote repositiories, WORKSPACE file.
type: bug
Description of the bug:
Using a Bazel module within a child directory (i.e., in the same repository, via
local_path_override()
) that callsload()
on a top-level target breaks the build. The equivalent build usinglocal_repository()
in aWORKSPACE
file succeeds.In my mbland/bzlmod-local-module-bug example repo:
local_path_override()
and the bzmlod mechanism seem to assume the module will not reside within the same repo. The WORKSPACE or MODULE.bazel repository boundary marker files don't appear to have an effect.Please see the README.md in my example repo for more information.
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.
Which operating system are you running Bazel on?
macOS 14.4.1 (23E224)
What is the output of
bazel info release
?release 8.0.0-pre.20240415.1
If
bazel info release
returnsdevelopment 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
?Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No. This happens in the current 7.1.1 release, as well as 7.0.0, 6.5.0, and 6.0.0.
Have you found anything relevant by searching the web?
No. All
local_path_override()
examples and issues I found presume the local module is outside the current directory.Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: