bazelisk icon indicating copy to clipboard operation
bazelisk copied to clipboard

Support for --distdir with multiple versions

Open FaBrand opened this issue 4 years ago • 0 comments

Use-Case:

Using --distdir to achieve an airgapped build.

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

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

FaBrand avatar Jan 27 '21 15:01 FaBrand