bazel_7: cleanup changes made to common patches

+28 -28
+28 -28
pkgs/development/tools/build-managers/bazel/nix-hacks.patch
··· 1 1 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 2 - index 845c8b6aa3..3a46235fcd 100644 2 + index 8e772005cd..6ffa1c919c 100644 3 3 --- a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java 4 4 +++ b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java 5 - @@ -171,14 +171,8 @@ public final class RepositoryDelegatorFunction implements SkyFunction { 6 - 7 - DigestWriter digestWriter = new DigestWriter(directories, repositoryName, rule); 8 - if (shouldUseCachedRepos(env, handler, repoRoot, rule)) { 9 - - // Make sure marker file is up-to-date; correctly describes the current repository state 10 - - byte[] markerHash = digestWriter.areRepositoryAndMarkerFileConsistent(handler, env); 11 - - if (env.valuesMissing()) { 12 - - return null; 13 - - } 14 - - if (markerHash != null) { 15 - - return RepositoryDirectoryValue.builder().setPath(repoRoot).setDigest(markerHash).build(); 16 - - } 17 - + // Nix hack: Always consider cached dirs up-to-date 18 - + return RepositoryDirectoryValue.builder().setPath(repoRoot).setDigest(digestWriter.writeMarkerFile()).build(); 19 - } 20 - 21 - /* At this point: This is a force fetch, a local repository, OR The repository cache is old or 22 - @@ -513,7 +507,8 @@ public final class RepositoryDelegatorFunction implements SkyFunction { 23 - } 24 - String content = builder.toString(); 5 + @@ -432,25 +432,7 @@ public final class RepositoryDelegatorFunction implements SkyFunction { 6 + String content; 25 7 try { 26 - - FileSystemUtils.writeContent(markerPath, UTF_8, content); 27 - + // Nix hack: Do not write these pesky marker files 28 - + // FileSystemUtils.writeContent(markerPath, UTF_8, content); 8 + content = FileSystemUtils.readContent(markerPath, StandardCharsets.UTF_8); 9 + - String markerRuleKey = readMarkerFile(content, markerData); 10 + - boolean verified = false; 11 + - if (Preconditions.checkNotNull(ruleKey).equals(markerRuleKey) 12 + - && Objects.equals( 13 + - markerData.get(MANAGED_DIRECTORIES_MARKER), 14 + - this.markerData.get(MANAGED_DIRECTORIES_MARKER))) { 15 + - verified = handler.verifyMarkerData(rule, markerData, env); 16 + - if (env.valuesMissing()) { 17 + - return null; 18 + - } 19 + - } 20 + - 21 + - if (verified) { 22 + - return new Fingerprint().addString(content).digestAndReset(); 23 + - } else { 24 + - // So that we are in a consistent state if something happens while fetching the repository 25 + - markerPath.delete(); 26 + - return null; 27 + - } 28 + + return new Fingerprint().addString(content).digestAndReset(); 29 29 } catch (IOException e) { 30 30 throw new RepositoryFunctionException(e, Transience.TRANSIENT); 31 31 } 32 32 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 33 - index 649647c5f2..64d05b530c 100644 33 + index c282d57ab6..f9b0c08627 100644 34 34 --- a/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java 35 35 +++ b/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java 36 - @@ -165,7 +165,6 @@ public class JavaSubprocessFactory implements SubprocessFactory { 37 - } 38 - builder.command(argv); 36 + @@ -146,7 +146,6 @@ public class JavaSubprocessFactory implements SubprocessFactory { 37 + ProcessBuilder builder = new ProcessBuilder(); 38 + builder.command(params.getArgv()); 39 39 if (params.getEnv() != null) { 40 40 - builder.environment().clear(); 41 41 builder.environment().putAll(params.getEnv());