Skip to content

Fix MODULE.bazel: remove use_repo entries for repos pub extension does not generate#2

Merged
SpencerC merged 1 commit into
SpencerC:mainfrom
zanderteller:fix-use-repo-validation
May 4, 2026
Merged

Fix MODULE.bazel: remove use_repo entries for repos pub extension does not generate#2
SpencerC merged 1 commit into
SpencerC:mainfrom
zanderteller:fix-use-repo-validation

Conversation

@zanderteller
Copy link
Copy Markdown
Contributor

Fixes the strict use_repo validation error on Bazel 8 when any operation
walks the full module graph (bazel mod graph, IntelliJ Bazel sync, etc.):

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

The pub extension only generates pub_fixnum, pub_protobuf, and
pub_protoc_plugin (matching the three pub.package(...) calls earlier in
the file). The other 22 names listed in use_repo reference repos that
don't exist, which Bazel 8's stricter validation rejects.

This patch removes those 22 dead entries. It does not change the set of
repos actually generated by the extension, so it cannot break any code
path that previously worked.

Note: the dart_proto_library rule's _path_pkg attribute defaults to
@pub_path//:path_files, which is one of the 22 dangling references. That
rule is therefore unusable as-shipped — but addressing that requires either
adding the missing pub.package(...) declarations or restructuring how
consumers contribute packages, which is out of scope for this minimal fix.

Reproduced on Bazel 8.4.2.

The pub extension only generates pub_fixnum, pub_protobuf, and pub_protoc_plugin
(matching the three pub.package(...) calls earlier in MODULE.bazel). The other
22 names in use_repo reference repos that don't exist, which Bazel 8's strict
use_repo validation rejects whenever any operation walks the full module graph
(e.g. bazel mod graph, IntelliJ Bazel sync).

This patch removes the 22 dead entries. It does not change the set of repos
actually generated by the extension, so it cannot break any code path that
previously worked.
@SpencerC SpencerC merged commit ca70cb7 into SpencerC:main May 4, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants