nixpkgs/pkgs/development/tools/build-managers/bazel/nix-hacks.patch
Nikolay Amiantov ba9cde1dd5 bazel_0_4: add optional Nix-specific hacks
* Skip verifying checksums for already fetched packages.
  Needed for two-staged building in Nix:
    1. Build a fixed derivation with `bazel fetch` (filtered out of non-reproducable bits).
    2. Build an actual derivation which uses fetched dependencies (skipping
       checksums needed here because they depend on the build directory).
* Don't clean environment variables for children processes.
  Needed for Nix compiler wrappers.
2017-10-19 13:19:11 +03:00

51 lines
2.5 KiB
Diff

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();