Skip to content

Add BAZELISK_BASE_URLS to allow layering bazel caches#780

Draft
aiuto wants to merge 5 commits intobazelbuild:masterfrom
aiuto:multi_url
Draft

Add BAZELISK_BASE_URLS to allow layering bazel caches#780
aiuto wants to merge 5 commits intobazelbuild:masterfrom
aiuto:multi_url

Conversation

@aiuto
Copy link
Copy Markdown

@aiuto aiuto commented Mar 26, 2026

Adds the .rc file variable BAZELISK_BASE_URLS.

This is a comma separated URLs, each of which has the behavior of BAZELISK_BASE_URL.
Bazelisk will iterate through the base URLs in that list, trying to pull a copy of bazel from each. Once it finds one, it stops. If you specify BAZELISK_BASE_URLS, it has precedence over BAZELISK_BASE_URL.

The expected use case is:

  • create a small local cache of bazel versions you use in your build/test infrastructure
  • bake that into your build containers
  • in .bazeliskrc, add
    BAZELISK_BASE_URLS=file:///cache/local/bazels;https://github.com/bazelbuild/bazel/releases/download

If you are in a muli-platform organization, you may want to tune each local cache to only include bazel versions that match the platform of the build machine. When the .bazelversion specified in the repo of a CI job is found in that local cache, bazelisk will not have to go off machine to find the right bazel. If the specified Bazel version is not found, bazelisk will fall back to the next URL in the list. This offers graceful degradation as various projects move to different bazel versions, without having to update a fleet of build machines in advance.

#779

@aiuto aiuto marked this pull request as draft March 26, 2026 02:10
@aiuto aiuto changed the title Allow multiple BASE_URLs Add BAZELISK_BASE_URLS to allow layering bazel caches Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant