From f040f64636551a059b3201aec892d7fa4daa121e Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Thu, 18 Jan 2018 10:25:47 -0500 Subject: [PATCH] bazel: Bump nix-hacks.patch for 0.9. --- .../tools/build-managers/bazel/0.4.nix | 2 +- .../build-managers/bazel/nix-hacks-0.4.patch | 51 +++++++++++++++++++ .../build-managers/bazel/nix-hacks.patch | 30 +++-------- pkgs/top-level/all-packages.nix | 4 +- 4 files changed, 62 insertions(+), 25 deletions(-) create mode 100644 pkgs/development/tools/build-managers/bazel/nix-hacks-0.4.patch diff --git a/pkgs/development/tools/build-managers/bazel/0.4.nix b/pkgs/development/tools/build-managers/bazel/0.4.nix index f8c1f01d4464..d131232e96d9 100644 --- a/pkgs/development/tools/build-managers/bazel/0.4.nix +++ b/pkgs/development/tools/build-managers/bazel/0.4.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { ''; sourceRoot = "."; - patches = lib.optional enableNixHacks ./nix-hacks.patch; + patches = lib.optional enableNixHacks ./nix-hacks-0.4.patch; postPatch = '' for f in $(grep -l -r '/bin/bash'); do diff --git a/pkgs/development/tools/build-managers/bazel/nix-hacks-0.4.patch b/pkgs/development/tools/build-managers/bazel/nix-hacks-0.4.patch new file mode 100644 index 000000000000..563fe635e6b0 --- /dev/null +++ b/pkgs/development/tools/build-managers/bazel/nix-hacks-0.4.patch @@ -0,0 +1,51 @@ +diff --git a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java +index eafa09fb5..d2d5e40e8 100644 +--- a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java ++++ b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java +@@ -287,21 +287,8 @@ public final class RepositoryDelegatorFunction implements SkyFunction { + markerData.put(key, value); + } + } +- boolean result = false; +- if (markerRuleKey.equals(ruleKey)) { +- result = handler.verifyMarkerData(rule, markerData, env); +- if (env.valuesMissing()) { +- return null; +- } +- } + +- if (result) { +- return new Fingerprint().addString(content).digestAndReset(); +- } else { +- // So that we are in a consistent state if something happens while fetching the repository +- markerPath.delete(); +- return null; +- } ++ return new Fingerprint().addString(content).digestAndReset(); + + } catch (IOException e) { + throw new RepositoryFunctionException(e, Transience.TRANSIENT); +diff --git a/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java b/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java +index a7ebc8f7a..40f2049fa 100644 +--- a/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java ++++ b/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java +@@ -129,7 +129,6 @@ public class JavaSubprocessFactory implements SubprocessFactory { + ProcessBuilder builder = new ProcessBuilder(); + builder.command(params.getArgv()); + if (params.getEnv() != null) { +- builder.environment().clear(); + builder.environment().putAll(params.getEnv()); + } + +diff --git a/src/main/java/com/google/devtools/build/lib/worker/Worker.java b/src/main/java/com/google/devtools/build/lib/worker/Worker.java +index 0268d1b2b..637364657 100644 +--- a/src/main/java/com/google/devtools/build/lib/worker/Worker.java ++++ b/src/main/java/com/google/devtools/build/lib/worker/Worker.java +@@ -77,7 +77,6 @@ class Worker { + new ProcessBuilder(command) + .directory(workDir.getPathFile()) + .redirectError(Redirect.appendTo(logFile.getPathFile())); +- processBuilder.environment().clear(); + processBuilder.environment().putAll(workerKey.getEnv()); + + this.process = processBuilder.start(); diff --git a/pkgs/development/tools/build-managers/bazel/nix-hacks.patch b/pkgs/development/tools/build-managers/bazel/nix-hacks.patch index 563fe635e6b0..da3f6248f220 100644 --- a/pkgs/development/tools/build-managers/bazel/nix-hacks.patch +++ b/pkgs/development/tools/build-managers/bazel/nix-hacks.patch @@ -1,8 +1,7 @@ -diff --git a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java -index eafa09fb5..d2d5e40e8 100644 ---- a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java -+++ b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java -@@ -287,21 +287,8 @@ public final class RepositoryDelegatorFunction implements SkyFunction { +diff -Naur a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java +--- a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java 1980-01-01 00:00:00.000000000 -0500 ++++ b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java 2018-01-18 08:17:22.420459162 -0500 +@@ -287,21 +287,8 @@ markerData.put(key, value); } } @@ -25,11 +24,10 @@ index eafa09fb5..d2d5e40e8 100644 } catch (IOException e) { throw new RepositoryFunctionException(e, Transience.TRANSIENT); -diff --git a/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java b/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java -index a7ebc8f7a..40f2049fa 100644 ---- a/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java -+++ b/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java -@@ -129,7 +129,6 @@ public class JavaSubprocessFactory implements SubprocessFactory { +diff -Naur a/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java b/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java +--- a/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java 1980-01-01 00:00:00.000000000 -0500 ++++ b/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java 2018-01-18 08:17:53.274877980 -0500 +@@ -129,7 +129,6 @@ ProcessBuilder builder = new ProcessBuilder(); builder.command(params.getArgv()); if (params.getEnv() != null) { @@ -37,15 +35,3 @@ index a7ebc8f7a..40f2049fa 100644 builder.environment().putAll(params.getEnv()); } -diff --git a/src/main/java/com/google/devtools/build/lib/worker/Worker.java b/src/main/java/com/google/devtools/build/lib/worker/Worker.java -index 0268d1b2b..637364657 100644 ---- a/src/main/java/com/google/devtools/build/lib/worker/Worker.java -+++ b/src/main/java/com/google/devtools/build/lib/worker/Worker.java -@@ -77,7 +77,6 @@ class Worker { - new ProcessBuilder(command) - .directory(workDir.getPathFile()) - .redirectError(Redirect.appendTo(logFile.getPathFile())); -- processBuilder.environment().clear(); - processBuilder.environment().putAll(workerKey.getEnv()); - - this.process = processBuilder.start(); diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 46053804c571..03003605e7d3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7205,8 +7205,8 @@ with pkgs; bam = callPackage ../development/tools/build-managers/bam {}; bazel_0_4 = callPackage ../development/tools/build-managers/bazel/0.4.nix { }; - bazel_0_5 = callPackage ../development/tools/build-managers/bazel { }; - bazel = bazel_0_5; + bazel_0_9 = callPackage ../development/tools/build-managers/bazel { }; + bazel = bazel_0_9; bear = callPackage ../development/tools/build-managers/bear { };