bazelbuild / bazelbuild/bazelisk
Ability to stack BAZELISK_BASE_URL to support local cache with fallback to upstream.
- Dominant language
- Go
- Stars
- 2.7k
- Forks
- 424
- PR merge metrics
- No merged PRs in 30d
Description
# Motivation
- O(10) different kinds of CI machines
- Each has a mostly minimal OS, + bazelisk, + a few critical tools
- The base images evolve slowly
- 100s of instances running at a time
- 10Ks of clean. machine starts each day
=> 10Ks of bazel downloads each day. That's a waste for everyone.
The need is for us to be able to push bazel releases to our build images in a way that bazelisk can pick up versions off the image, but fall back to the upstream repo if it is not there.
# Strawman idea
- Allow the base url to be a list
- file:// urls fail fast if the version is not found, going to the next element.
- check urls in order until we get one. So we can put our own corporate wide cache in front of Google's
So, we can
- bake bazel 8.1.0 into our build images.
- experiment with 8.6.0 in a few development branches without committing
- when we want, flip .bazelversion
- update the cache on the build machines at a later date.
The important part is that we can do the last two in either order.
The win for everyone is that our builds on clean machines start faster and there is less network traffic to the upstream.
Contributor guide
Research direction
Start by tracing how BAZELISK_BASE_URL and .bazelversion currently select and download Bazel releases. Check how file:// URLs report a missing version, then define ordered fallback across the proposed URLs and verify behavior for local-cache hits, misses, and upstream fallback.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100