Skip to content

[Bug]: //tools:add_module should default to MODULE.bazel in the source tree #2781

Open
@davidben

Description

@davidben

What happened?

When using the //tools:add_module tool in the bazel-central-registry, it asks if I would like to supply a MODULE.bazel file. Since the project I work on is trying to be bzlmod-aware, I would not need to supply one, since the repository has the correct one.

However, leaving that blank seems to cause the tool to synthesize one, rather than picking up the one that already exists. It then complains the synthesized one does not match the one in the archive, so the tool seems able to extract it. It just does not use it for some reason.

Writing our tooling around this (unfortunately necessary because the recommended automation doesn't meet security requirements; see bazel-contrib/publish-to-bcr#157) would be simpler if the script could just use the existing one when available.

Version

n/a, issue is in BCR tooling, not Bazel

How to reproduce

Run `//tools:add_module` and do not supply a `MODULE.bazel` file, when the archive already has one.

Any other information?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions