diff options
Diffstat (limited to 'patches/bazel-recreate-markers.patch')
| -rw-r--r-- | patches/bazel-recreate-markers.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/patches/bazel-recreate-markers.patch b/patches/bazel-recreate-markers.patch new file mode 100644 index 0000000..8c64d8f --- /dev/null +++ b/patches/bazel-recreate-markers.patch | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | This patch was taken from Nixpkgs. It forces Bazel to recreate a | ||
| 2 | repository marker's hash instead of aborting. This allows us to | ||
| 3 | bundle all inputs in advance and modify them as needed without having | ||
| 4 | to worry about Bazel rejecting the bundled repositories. | ||
| 5 | |||
| 6 | 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 | ||
| 7 | index 25fbdcac9d..49616d37df 100644 | ||
| 8 | --- a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java | ||
| 9 | +++ b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java | ||
| 10 | @@ -568,22 +568,7 @@ public final class RepositoryDelegatorFunction implements SkyFunction { | ||
| 11 | String content; | ||
| 12 | try { | ||
| 13 | content = FileSystemUtils.readContent(markerPath, StandardCharsets.UTF_8); | ||
| 14 | - String markerRuleKey = readMarkerFile(content, markerData); | ||
| 15 | - boolean verified = false; | ||
| 16 | - if (Preconditions.checkNotNull(ruleKey).equals(markerRuleKey)) { | ||
| 17 | - verified = handler.verifyMarkerData(rule, markerData, env); | ||
| 18 | - if (env.valuesMissing()) { | ||
| 19 | - return null; | ||
| 20 | - } | ||
| 21 | - } | ||
| 22 | - | ||
| 23 | - if (verified) { | ||
| 24 | - return new Fingerprint().addString(content).digestAndReset(); | ||
| 25 | - } else { | ||
| 26 | - // So that we are in a consistent state if something happens while fetching the repository | ||
| 27 | - markerPath.delete(); | ||
| 28 | - return null; | ||
| 29 | - } | ||
| 30 | + return new Fingerprint().addString(content).digestAndReset(); | ||
| 31 | } catch (IOException e) { | ||
| 32 | throw new RepositoryFunctionException(e, Transience.TRANSIENT); | ||
| 33 | } | ||
| 34 | 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 | ||
| 35 | index 1a45b8a3a2..a6b73213f6 100644 | ||
| 36 | --- a/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java | ||
| 37 | +++ b/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java | ||
| 38 | @@ -152,7 +152,6 @@ public class JavaSubprocessFactory implements SubprocessFactory { | ||
| 39 | ProcessBuilder builder = new ProcessBuilder(); | ||
| 40 | builder.command(params.getArgv()); | ||
| 41 | if (params.getEnv() != null) { | ||
| 42 | - builder.environment().clear(); | ||
| 43 | builder.environment().putAll(params.getEnv()); | ||
| 44 | } | ||
| 45 | |||
