about summary refs log tree commit diff
path: root/pkgs/development/tools/build-managers
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2020-02-05 10:28:52 +0100
committerFrederik Rietdijk <fridh@fridh.nl>2020-02-05 10:28:52 +0100
commit76a439239eb310d9ad76d998b34d5d3bc0e37acb (patch)
tree69e2f87d4a1ec8f8962d35e330188afcf8f88dcb /pkgs/development/tools/build-managers
parent080f1e7f5c94a171d070d1990104e06880589ca0 (diff)
parent2b3d2dbaf9f76519082126074b3aae26d2ced67f (diff)
downloadnixlib-76a439239eb310d9ad76d998b34d5d3bc0e37acb.tar
nixlib-76a439239eb310d9ad76d998b34d5d3bc0e37acb.tar.gz
nixlib-76a439239eb310d9ad76d998b34d5d3bc0e37acb.tar.bz2
nixlib-76a439239eb310d9ad76d998b34d5d3bc0e37acb.tar.lz
nixlib-76a439239eb310d9ad76d998b34d5d3bc0e37acb.tar.xz
nixlib-76a439239eb310d9ad76d998b34d5d3bc0e37acb.tar.zst
nixlib-76a439239eb310d9ad76d998b34d5d3bc0e37acb.zip
Merge master into staging-next
Diffstat (limited to 'pkgs/development/tools/build-managers')
-rw-r--r--pkgs/development/tools/build-managers/bazel/bazel-deps/default.nix40
-rw-r--r--pkgs/development/tools/build-managers/bazel/bazel-remote/default.nix29
-rw-r--r--pkgs/development/tools/build-managers/bazel/bazel-remote/disable_build_file_generation.patch24
3 files changed, 43 insertions, 50 deletions
diff --git a/pkgs/development/tools/build-managers/bazel/bazel-deps/default.nix b/pkgs/development/tools/build-managers/bazel/bazel-deps/default.nix
deleted file mode 100644
index 62a1329eca6a..000000000000
--- a/pkgs/development/tools/build-managers/bazel/bazel-deps/default.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ stdenv, buildBazelPackage, lib, fetchFromGitHub, git, jre, makeWrapper }:
-
-buildBazelPackage rec {
-  name = "bazel-deps-${version}";
-  version = "2019-07-11";
-
-  meta = with stdenv.lib; {
-    homepage = "https://github.com/johnynek/bazel-deps";
-    description = "Generate bazel dependencies for maven artifacts";
-    license = licenses.mit;
-    maintainers = [ maintainers.uri-canva ];
-    platforms = platforms.all;
-    broken = true; # global variable '_common_attrs_for_plugin_bootstrapping' is referenced before assignment.
-  };
-
-  src = fetchFromGitHub {
-    owner = "johnynek";
-    repo = "bazel-deps";
-    rev = "48fdf7f8bcf3aadfa07f9f7e6f0c9f4247cb0f58";
-    sha256 = "0wpn5anfgq5wfljfhpn8gbgdmgcp0claffjgqcnv5dh70ch7i0gi";
-  };
-
-  bazelTarget = "//src/scala/com/github/johnynek/bazel_deps:parseproject_deploy.jar";
-
-  buildInputs = [ git makeWrapper ];
-
-  fetchAttrs = {
-    sha256 = "1r5qxsbw2cgww7vcg5psh7404l3jcxpvc0ndgl3k8vj1x8y93nkf";
-  };
-
-  buildAttrs = {
-    installPhase = ''
-      mkdir -p $out/bin/bazel-bin/src/scala/com/github/johnynek/bazel_deps
-
-      cp gen_maven_deps.sh $out/bin
-      wrapProgram "$out/bin/gen_maven_deps.sh" --set JAVA_HOME "${jre}" --prefix PATH : ${lib.makeBinPath [ jre ]}
-      cp bazel-bin/src/scala/com/github/johnynek/bazel_deps/parseproject_deploy.jar $out/bin/bazel-bin/src/scala/com/github/johnynek/bazel_deps
-    '';
-  };
-}
diff --git a/pkgs/development/tools/build-managers/bazel/bazel-remote/default.nix b/pkgs/development/tools/build-managers/bazel/bazel-remote/default.nix
index 2eb5f772f890..f2f3588ba29c 100644
--- a/pkgs/development/tools/build-managers/bazel/bazel-remote/default.nix
+++ b/pkgs/development/tools/build-managers/bazel/bazel-remote/default.nix
@@ -8,19 +8,25 @@
 
 buildBazelPackage rec {
   name = "bazel-remote-${version}";
-  version = "2019-01-12";
+  version = "2020-01-29";
 
   src = fetchFromGitHub {
     owner = "buchgr";
     repo = "bazel-remote";
-    rev = "3f65b6ccf69e223950c77275a743d0d3a04a8583";
-    sha256 = "0fklrlylmc55yzhm3m1f211x5gmk7hpqjb7k5kml7n3gw3npbjda";
+    rev = "ae9378321552dd14066332f8fa55076040228cb7";
+    sha256 = "1jbd319n255cmmncnjfdkdcpx0x62asp3dqwgl6vimx4dqqj8v1p";
   };
 
   nativeBuildInputs = [ go git ];
 
   bazelTarget = "//:bazel-remote";
 
+  removeRulesCC = false;
+
+  # this is to work around `test -f` failing when called by gazelle
+  # https://github.com/bazelbuild/bazel-gazelle/blob/v0.19.1/internal/go_repository.bzl#L135
+  patches = [ ./disable_build_file_generation.patch ];
+
   fetchAttrs = {
     preBuild = ''
       patchShebangs .
@@ -28,12 +34,11 @@ buildBazelPackage rec {
       # tell rules_go to use the Go binary found in the PATH
       sed -e 's:go_register_toolchains():go_register_toolchains(go_version = "host"):g' -i WORKSPACE
 
-      # update gazelle to work around https://github.com/golang/go/issues/29850
-      sed -e 's,https://github.com/bazelbuild/bazel-gazelle/releases/download/0.15.0/bazel-gazelle-0.15.0.tar.gz,https://github.com/bazelbuild/bazel-gazelle/releases/download/0.16.0/bazel-gazelle-0.16.0.tar.gz,g' -i WORKSPACE
-      sed -e 's,6e875ab4b6bf64a38c352887760f21203ab054676d9c1b274963907e0768740d,7949fc6cc17b5b191103e97481cf8889217263acf52e00b560683413af204fcb,g' -i WORKSPACE
-
       # tell rules_go to invoke GIT with custom CAINFO path
       export GIT_SSL_CAINFO="${cacert}/etc/ssl/certs/ca-bundle.crt"
+
+      # force gazelle to use the nix go cache rather than its own
+      # export GO_REPOSITORY_USE_HOST_CACHE=1
     '';
 
     preInstall = ''
@@ -47,6 +52,11 @@ buildBazelPackage rec {
       rm -rf $bazelOut/external/{go_sdk,\@go_sdk.marker}
       sed -e '/^FILE:@go_sdk.*/d' -i $bazelOut/external/\@*.marker
 
+      # Remove the gazelle repository cache as it contains built binaries
+      chmod -R u+w $bazelOut/external/bazel_gazelle_go_repository_cache
+      rm -rf $bazelOut/external/{bazel_gazelle_go_repository_cache,\@bazel_gazelle_go_repository_cache.marker}
+      sed -e '/^FILE:@bazel_gazelle_go_repository_cache.*/d' -i $bazelOut/external/\@*.marker
+
       # Remove the gazelle tools, they contain go binaries that are built
       # non-deterministically. As long as the gazelle version matches the tools
       # should be equivalent.
@@ -54,7 +64,7 @@ buildBazelPackage rec {
       sed -e '/^FILE:@bazel_gazelle_go_repository_tools.*/d' -i $bazelOut/external/\@*.marker
     '';
 
-    sha256 = "1wvyv3w5y6vj6qs6v5qyd356j1lxc3mf7n3j2pcib1bqmx3igw35";
+    sha256 = "1n66hg1w5jv2rc8q4sjlaf0agvxr713aa40mbkhgjv57x9j7bgn0";
   };
 
   buildAttrs = {
@@ -75,7 +85,6 @@ buildBazelPackage rec {
     description = "A remote HTTP/1.1 cache for Bazel.";
     license = licenses.asl20;
     maintainers = [ maintainers.uri-canva ];
-    platforms = platforms.darwin;
-    broken = true; # global variable '_layer' is referenced before assignment.
+    platforms = platforms.darwin ++ platforms.linux;
   };
 }
diff --git a/pkgs/development/tools/build-managers/bazel/bazel-remote/disable_build_file_generation.patch b/pkgs/development/tools/build-managers/bazel/bazel-remote/disable_build_file_generation.patch
new file mode 100644
index 000000000000..67df8f559a20
--- /dev/null
+++ b/pkgs/development/tools/build-managers/bazel/bazel-remote/disable_build_file_generation.patch
@@ -0,0 +1,24 @@
+From 3f5abd591b93ebdbc1ae82e5c29cf26024222f5f Mon Sep 17 00:00:00 2001
+From: Uri Baghin <uri@canva.com>
+Date: Thu, 30 Jan 2020 16:47:36 +1100
+Subject: [PATCH] Disable build file generation for remote apis.
+
+---
+ WORKSPACE | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/WORKSPACE b/WORKSPACE
+index f9ebafa..52e4e0b 100644
+--- a/WORKSPACE
++++ b/WORKSPACE
+@@ -208,6 +208,7 @@ http_archive(
+ 
+ go_repository(
+     name = "com_github_bazelbuild_remote_apis",
++    build_file_generation = "off",
+     importpath = "github.com/bazelbuild/remote-apis",
+     sum = "h1:OPH+hf+ICw8WEp2CV2ncfdyWPC30Cmw8b5NKun0n5IQ=",
+     version = "v0.0.0-20191119143007-b5123b1bb285",
+-- 
+2.25.0
+