summary refs log tree commit diff
path: root/pkgs/build-support/build-bazel-package
diff options
context:
space:
mode:
authorTimo Kaufmann <timokau@zoho.com>2019-06-20 20:01:22 +0200
committerTimo Kaufmann <timokau@zoho.com>2019-06-20 20:02:51 +0200
commit883725b22fc8e22048e315b743b03192565b1a1a (patch)
treea75bec145d1b40b59437e49e93c8657fbc14254f /pkgs/build-support/build-bazel-package
parent0cfd90a1091888a49e08b3acf8df8045ff528db7 (diff)
downloadnixpkgs-883725b22fc8e22048e315b743b03192565b1a1a.tar
nixpkgs-883725b22fc8e22048e315b743b03192565b1a1a.tar.gz
nixpkgs-883725b22fc8e22048e315b743b03192565b1a1a.tar.bz2
nixpkgs-883725b22fc8e22048e315b743b03192565b1a1a.tar.lz
nixpkgs-883725b22fc8e22048e315b743b03192565b1a1a.tar.xz
nixpkgs-883725b22fc8e22048e315b743b03192565b1a1a.tar.zst
nixpkgs-883725b22fc8e22048e315b743b03192565b1a1a.zip
buildBazelPackage: disable multithreaded fetching
To work around https://github.com/bazelbuild/bazel/issues/6502.
Diffstat (limited to 'pkgs/build-support/build-bazel-package')
-rw-r--r--pkgs/build-support/build-bazel-package/default.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/build-support/build-bazel-package/default.nix b/pkgs/build-support/build-bazel-package/default.nix
index 37cee98a316..1004a7ce3f9 100644
--- a/pkgs/build-support/build-bazel-package/default.nix
+++ b/pkgs/build-support/build-bazel-package/default.nix
@@ -34,8 +34,10 @@ in stdenv.mkDerivation (fBuildAttrs // {
       # https://github.com/bazelbuild/bazel/blob/9323c57607d37f9c949b60e293b573584906da46/src/main/cpp/startup_options.cc#L123-L124
       #
       # On macOS Bazel will use the system installed Xcode or CLT toolchain instead of the one in the PATH unless we pass BAZEL_USE_CPP_ONLY_TOOLCHAIN
-      #
-      BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 USER=homeless-shelter bazel --output_base="$bazelOut" --output_user_root="$bazelUserRoot" fetch $bazelFlags $bazelTarget
+
+      # We disable multithreading for the fetching phase since it can lead to timeouts with many dependencies/threads:
+      # https://github.com/bazelbuild/bazel/issues/6502
+      BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 USER=homeless-shelter bazel --output_base="$bazelOut" --output_user_root="$bazelUserRoot" fetch --loading_phase_threads=1 $bazelFlags $bazelTarget
 
       runHook postBuild
     '';