bazel icon indicating copy to clipboard operation
bazel copied to clipboard

bzlmod registry: support git_repository

Open nachumg opened this issue 2 years ago • 4 comments

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.

nachumg avatar Feb 12 '23 10:02 nachumg

It's been almost a year.

  1. Is there a plan to add this functionality?
  2. Is it something I could do?

nachumg avatar Jan 08 '24 22:01 nachumg

Is it something I could do?

Yes, certainly. PRs welcome!

Wyverald avatar Jan 09 '24 01:01 Wyverald

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?

btalb avatar Feb 17 '24 06:02 btalb

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.

fmeum avatar Feb 17 '24 07:02 fmeum