Skip to content

bb CLI emits spurious ".bazelrc no longer being read" warning in bzlmod-only workspaces #11863

Description

@rdark

Description:

When using bb in a bzlmod-only workspace (has MODULE.bazel but no WORKSPACE file), the CLI warns that the workspace .bazelrc is "no longer being read", even though vanilla bazel reads it correctly from the same directory.

Environment:

  • bb version: 5.0.339
  • Bazel version: 8.5.1
  • OS: macOS (arm64)
  • Workspace: bzlmod-only (MODULE.bazel present, no WORKSPACE or WORKSPACE.bazel)

Steps to reproduce:

  1. Have a bzlmod-only workspace with a .bazelrc at the project root
  2. Have a user ~/.bazelrc
  3. Run any bb command, e.g.: bb build //some:target

### Expected behavior:

No warning. .bazelrc is at the workspace root and should be read as a standard rc file (same as bazel does).

Actual behavior:

WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files:
/path/to/workspace/.bazelrc

Diagnosis with --client_debug:

With vanilla bazel:

Looking for the following rc files: /etc/bazel.bazelrc, /path/to/workspace/.bazelrc, ~/.bazelrc
Parsing the RcFile /path/to/workspace/.bazelrc

With bb:

Looking for the following rc files:
(empty — finds none)

bb appears to fail to resolve the workspace root in bzlmod-only projects, so it finds zero standard rc file locations and treats the workspace .bazelrc as a legacy/non-standard path.

### Workaround:

Adding try-import %workspace%/.bazelrc to ~/.bazelrc causes the config to be loaded, but the spurious warning still appears.

#11846 is possibly related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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