bazel
bazel copied to clipboard
bzlmod registry: support git_repository
Description of the feature request:
https://bazel.build/external/registry
source.json currently supports:
- http_archive
- local_repository
It should also support:
- git_repository
What underlying problem are you trying to solve with this feature?
Define bzlmod module source via git_repository
Which operating system are you running Bazel on?
linux
What is the output of bazel info release
?
release 6.0.0
If bazel info release
returns development version
or (@non-git)
, tell us how you built Bazel.
No response
What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD
?
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
Google bazel dev suggested:
The source.json file in a Bazel registry currently only supports two types, archive and local_path, which are fetched by the http_archive and local_repository repository rule respectively. See https://bazel.build/external/registry
We haven't added support for git_repository yet, but it should be easy to do that following https://github.com/bazelbuild/bazel/commit/ec3d03c8f87696f67cbfc1ed968a2a0d099a15e9. Feel free to file a feature request against the Bazel repository or send a PR to add this functionality.
It's been almost a year.
- Is there a plan to add this functionality?
- Is it something I could do?
Is it something I could do?
Yes, certainly. PRs welcome!
Waaiittt.... so is the documentation here a lie: https://bazel.build/external/registry?
I've spent the last couple of hours trying to figure out why I get "Invalid source type for module ..."
. Is git_repository
not currently supported?
It's going to be supported in 7.1.0, which will be released soon. The docs reflect the state of master, not of the latest release. You could try USE_BAZEL_VERSION=last_green
with Bazelisk.