Skip to content

MODULE.bazel use_repo references 22 repos that the pub extension does not generate #3

@zanderteller

Description

@zanderteller

Summary

MODULE.bazel calls use_repo(pub, ...) for 25 names, but the pub extension
only generates 3 (pub_fixnum, pub_protobuf, pub_protoc_plugin). The
remaining 22 names reference nonexistent repos. Bazel 8's strict use_repo
validation fails any operation that walks the full module graph.

Reproduction

$ bazel mod graph
ERROR: module extension @@rules_flutter+//flutter:extensions.bzl%pub does not
generate repository "pub_async", yet it is imported as "pub_async" in the usage
at @@rules_flutter+//:MODULE.bazel:30:20
ERROR: Results may be incomplete as 1 extension failed.

Affected commands (anything that resolves all extensions):

  • bazel mod graph / bazel mod deps / bazel mod show_extension
  • IntelliJ Bazel sync (Hirschgarten) — confirmed reproducible from the
    2026.1.2 plugin onwards.

bazel build <specific-target> is unaffected because Bazel resolves
extensions lazily.

Cause

In MODULE.bazel, only three pub.package(...) calls exist (pub_fixnum,
pub_protobuf, pub_protoc_plugin), but the subsequent use_repo(pub, ...)
block lists 25 names. Bazel 8 enforces that every name in use_repo must be
generated by the corresponding extension, so the 22 unmatched names cause
the validation failure.

Fix

I've submitted PR #2 with the minimal fix: removing the 22 dead use_repo
entries.

A more comprehensive fix would also add pub.package(...) declarations for
all 22 packages so the extension actually generates them. That would fix
dart_proto_library (whose _path_pkg attribute defaults to
@pub_path//:path_files, currently dangling) — but it requires picking
specific package versions and restructuring how consumers contribute
packages, which felt out of scope for an unblocking fix.

Bazel version

Reproduced on Bazel 8.4.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions