From 03f458b351e77aa57ec2478dfff2e091ede0acd6 Mon Sep 17 00:00:00 2001 From: Guillaume Maudoux Date: Fri, 20 Oct 2023 02:58:58 +0200 Subject: [PATCH] bazel_7: restrict USER hack to darwin --- .../tools/build-managers/bazel/bazel_7/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix index 450c00239c14..06f70bea5d39 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix +++ b/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix @@ -307,12 +307,13 @@ stdenv.mkDerivation rec { '' # Bazel needs a real home for self-extraction and internal cache export HOME=$(mktemp -d) - export USER=$(basename $HOME) ${# Concurrent bazel invocations have the same workspace path. - # On darwin, for some reason, it means they accessing and corrupting the same execroot. + # On darwin, for some reason, it means they access and corrupt the same execroot. # Having a different workspace path ensures we use different execroots. + # A different user seems to be enough for a different bazel cache root. lib.optionalString isDarwin '' + export USER=$(basename $HOME) # cd $(mktemp --tmpdir=. -d) '' }