Skip to content

[Bug]: aspect_rules_lint_rules_rust submodule is not consumable by downstream repos in 2.6.0 #879

Description

@vadikmironov

What happened?

Summary

Thanks a lot for all the work on clippy aspect under #865. However, the new aspect_rules_lint_rules_rust module is currently impossible to bring in without patching upstream sources, which makes the documented migration path (load("@aspect_rules_lint_rules_rust//:clippy.bzl", ...)) unusable in practice.

The three blockers, in order:

  1. Not published to BCR. https://github.com/bazelbuild/bazel-central-registry/tree/main/modules/aspect_rules_lint_rules_rust does not exist, so a plain bazel_dep(name = "aspect_rules_lint_rules_rust", version = "...") fails to resolve.
  2. Excluded from every git archive output. .gitattributes at v2.6.0 contains: lint/rules_rust export-ignore and lint/rules_rust/** export-ignore . This strips the directory from the official release tarball (rules_lint-v2.6.0.tar.gz) and from GitHub's auto-generated refs/tags/v2.6.0.tar.gz. So archive_override cannot reach it via any URL on github.com.
  3. git_override works, but the submodule's MODULE.bazel is only valid in-tree. Once cloned, it contains:
    bazel_dep(name = "aspect_rules_lint") # no version
    ...
    local_path_override(
    module_name = "aspect_rules_lint",
    path = "../..",
    )
    Since Bazel only honors *_override declarations in the root module, the local_path_override is silently dropped, leaving the versionless bazel_dep to fail.

Version

Development (host) and target OS/architectures:
lsb_release -d
Description: Debian GNU/Linux 13 (trixie)

Output of bazel --version:
bazel --version
bazel 8.7.0

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:
current: 2.5.2
proposed: 2.6.0

Language(s) and/or frameworks involved:
Bazel, C++, Rust, Python

How to reproduce

### Repro

Any downstream MODULE.bazel that follows the new docs:
  bazel_dep(name = "aspect_rules_lint", version = "2.6.0")
  bazel_dep(name = "aspect_rules_lint_rules_rust", version = "0.0.0")
  git_override(
      module_name = "aspect_rules_lint_rules_rust",
      remote = "https://github.com/aspect-build/rules_lint.git",
      commit = "3f0c79fa75cc37e7dafbdb7e6005ad62b0b0775b",  # v2.6.0
      strip_prefix = "lint/rules_rust",
  )
  fails at main-repo-mapping with the error above.

Any other information?

Workarounds available to downstream users

  • single_version_override(module_name = "aspect_rules_lint", version = "2.6.0") at the root, to satisfy the versionless bazel_dep from the submodule.
  • git_override(... patches = [...]) to pin the version inside the submodule's MODULE.bazel.
  • Vendor lint/rules_rust/ into the downstream repo.

All three force consumers to know upstream internals, which I suppose was not the goal of the split.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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