diff --git a/pkgs/development/tools/build-managers/bazel/0.4.nix b/pkgs/development/tools/build-managers/bazel/0.4.nix index 7fa39ef21627..69f467f577c8 100644 --- a/pkgs/development/tools/build-managers/bazel/0.4.nix +++ b/pkgs/development/tools/build-managers/bazel/0.4.nix @@ -65,8 +65,9 @@ stdenv.mkDerivation rec { ]; buildPhase = '' + export TMPDIR=/tmp/.bazel-$UID ./compile.sh - ./output/bazel --output_user_root=/tmp/.bazel build //scripts:bash_completion \ + ./output/bazel --output_user_root=$TMPDIR/.bazel build //scripts:bash_completion \ --spawn_strategy=standalone \ --genrule_strategy=standalone cp bazel-bin/scripts/bazel-complete.bash output/ diff --git a/pkgs/development/tools/build-managers/bazel/default.nix b/pkgs/development/tools/build-managers/bazel/default.nix index 28214e94c7aa..0441ba0c665d 100644 --- a/pkgs/development/tools/build-managers/bazel/default.nix +++ b/pkgs/development/tools/build-managers/bazel/default.nix @@ -96,9 +96,9 @@ stdenv.mkDerivation rec { # Change this to $(mktemp -d) as soon as we figure out why. buildPhase = '' - export TMPDIR=/tmp + export TMPDIR=/tmp/.bazel-$UID ./compile.sh - ./output/bazel --output_user_root=/tmp/.bazel build //scripts:bash_completion \ + ./output/bazel --output_user_root=$TMPDIR/.bazel build //scripts:bash_completion \ --spawn_strategy=standalone \ --genrule_strategy=standalone cp bazel-bin/scripts/bazel-complete.bash output/