Skip to content

[Feature Request] Bazel diff should honor external repos loaded in MODULE.bazel #255

Open
@tgeng

Description

Currently, if one loads an http_archive from MODULE.bazel and reference things from the loaded in a target, the generated hash does not capture parameters of this http_archive. Using --fineGrainedHashExternalRepos flag can work around this issue. But it can get costly.

Under the hood this is because bazel query //external:all-targets at here does not return any repos loaded from MODULE.bazel. One way to get the modules from MODULE.bazel is to use bazel mod dump_repo_mapping followed by bazel mod show_repo @repo1 @repo2. However, currently show_repo does not support outputting machine parsable output (tracked by bazelbuild/bazel#21617).

This issue is just to track this feature. For now I can workaround the problem by feeding all the repos returned by bazel mod dump_repo_mapping to --fineGrainedHashExternalRepos to make this work.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions