From 57909125148692d055362e8340b05f4ab6df372e Mon Sep 17 00:00:00 2001 From: Dmitry Ivankov Date: Fri, 28 Jul 2023 13:43:29 +0200 Subject: [PATCH] bazel_6: installCheckPhase .bazelversion override In case bazel dist archive includes .bazelversion (like in 5.4.1 https://github.com/bazelbuild/bazel/issues/18189 or 6.3.1rc1) running bazel commands in dist worktree will require using version specified in .bazelversion. If .bazelversion is absent there any available version will be used. Let's make sure we don't fail installCheckPhase for dist archives that do include .bazelversion (note: bazel bootstrapping from sources not via bazel works regardless of that file, so that's only about test/check phases) --- .../tools/build-managers/bazel/bazel_6/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix index 1424817edc90..91f0a71c3603 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix +++ b/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix @@ -625,6 +625,12 @@ stdenv.mkDerivation rec { cd ./bazel_src + # If .bazelversion file is present in dist files and doesn't match `bazel` version + # running `bazel` command within bazel_src will fail. + # Let's remove .bazelversion within the test, if present it is meant to indicate bazel version + # to compile bazel with, not version of bazel to be built and tested. + rm -f .bazelversion + # test whether $WORKSPACE_ROOT/tools/bazel works mkdir -p tools