bazelbuild / bazelbuild/bazelisk

Support for --distdir with multiple versions

Open
#211 0 comments 0 reactions 0 assignees View on GitHub
P2 type: feature request
Dominant language
Go
Stars
2.7k
Forks
424
PR merge metrics
No merged PRs in 30d

Description

## Use-Case:
Using [--distdir](https://docs.bazel.build/versions/master/command-line-reference.html#flag--distdir) to achieve an [airgapped build](https://docs.bazel.build/versions/master/guide.html#running-bazel-in-an-airgapped-environment).

Building different bazel versions but with the requirement to use a distdir.

If bazel/bazelisk is cached inside a container for an offline build and used with different versions.
The distdir can be cached in that container alongside the different bazel-versions.

## The idea:
To have something that tells bazelisk to pass a different `--distdir` to bazel depending on the detected version.
e.g. Appending the version to the path passed and forwarding that to bazel
```bash
export BAZELISK_APPEND_DISTDIR_VERSION=
export USE_BAZEL_VERSION=4.0.0
bazelisk build ... --distdir=/var/bazel/distfiles
# would yield the actual call
bazel build ... --distdir=/var/bazel/distfiles/4.0.0
```

Contributor guide

Open the contributing guide

Research direction

Start by reading Bazelisk's handling of USE_BAZEL_VERSION and forwarded --distdir arguments, then compare the requested example for versions 4.0.0 and multiple cached Bazel versions. Done means a configured distdir is version-specific when requested, while the resulting Bazel invocation preserves the expected flag behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.