How do bazel registries compose?

61 views
Skip to first unread message

Filip Filmar

unread,
Aug 2, 2025, 7:06:36 PMAug 2
to bazel-discuss
Hi folks.

What is the expected way that

bazel

registries compose with each other if you must use more than a single one:

I had a `.bazelrc` setting:

```
build --registry=https://my.site/my-registry \
```

I noticed that if I want to keep `my-registry` minimal and remove the modules available in BCR, bazel complains that it can not find the modules that are known to be in BCR.

Is this expected? 

Thanks,
F

Filip Filmar

unread,
Aug 2, 2025, 7:14:30 PMAug 2
to Jiawen Chen, bazel-discuss
On Sat, Aug 2, 2025 at 4:10 PM Jiawen Chen <jia...@gmail.com> wrote:
The docs, while brief, say that if you pass multiple —registry flags, earlier ones have precedence. And if you do so, the central registry is disabled unless explicitly added.

Yes, and the docs also say you can add the BCR back in, which you may see my `.bazelrc` does.

But the end effect is not what I'd have expected. I'd have thought that bazel would try all registries in turn, but it seems that it stops after the first.

F
 

Filip Filmar

unread,
Aug 2, 2025, 7:17:22 PMAug 2
to Jiawen Chen, bazel-discuss
For some background, the reason I'd like the registries to compose is that (as everyone) I must eventually migrate everything I did to use bazel modules. But also, some of the resulting modules really aren't appropriate for BCR, because they use some ... unconventional things that (1) not everyone would want to have; (2) don't really fit in the universal usability of BCR. So my approach would be to maintain my own registry, with things too unsavory for BCR, and not pollute BCR with my ideas.

F

Filip Filmar

unread,
Aug 2, 2025, 11:58:11 PMAug 2
to Jiawen Chen, bazel-discuss
Hm, yes. But it seems that my question stemmed from one too many all-nighter. I retried this - with a pared down registry containing just my modules, and bcr, and things worked as expected.

PEBKAC, disregard.

F


On Sat, Aug 2, 2025 at 8:34 PM Jiawen Chen <jia...@gmail.com> wrote:
Ugh, right. A reasonable behavior would be to look for X in the first (highest priority) registry. If it doesn't exist (or fails due to timeout, etc), it tries the second, etc.

On Sat, Aug 2, 2025 at 4:14 PM Filip Filmar <fil...@gmail.com> wrote:

Jiawen Chen

unread,
Aug 4, 2025, 9:24:21 AMAug 4
to Filip Filmar, bazel-discuss
Ugh, right. A reasonable behavior would be to look for X in the first (highest priority) registry. If it doesn't exist (or fails due to timeout, etc), it tries the second, etc.

On Sat, Aug 2, 2025 at 4:14 PM Filip Filmar <fil...@gmail.com> wrote:

Jiawen Chen

unread,
Aug 4, 2025, 9:24:21 AMAug 4
to Filip Filmar, bazel-discuss
The docs, while brief, say that if you pass multiple —registry flags, earlier ones have precedence. And if you do so, the central registry is disabled unless explicitly added.

But I guess your question is whether if an entry is missing in one registry, does it attempt to fetch from the later ones. That I’m not sure…


--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bazel-discuss/CAKaOXihLJVNMJZQHVn2hu3DnVO0ndLOZF54bnqW60kN7jXrOLQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages