diff options
| author | Guillaume Maudoux <guillaume.maudoux@tweag.io> | 2023-10-30 09:41:11 +0100 |
|---|---|---|
| committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2024-01-02 08:19:48 +0000 |
| commit | a88b2d0d2b492309ec4672a53bce8c4853bf9c9f (patch) | |
| tree | 2768c800e1b6207b8284dd49e2c5d84eb0ff9148 | |
| parent | bazel_7: cleanup changes made to common tests (diff) | |
| download | nixpkgs-a88b2d0d2b492309ec4672a53bce8c4853bf9c9f.tar.gz | |
bazel_7: cleanup changes made to common patches
(cherry picked from commit 90bfff13965d4577c43672ad04e1f96ce6bb3c60)
| -rw-r--r-- | pkgs/development/tools/build-managers/bazel/nix-hacks.patch | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/pkgs/development/tools/build-managers/bazel/nix-hacks.patch b/pkgs/development/tools/build-managers/bazel/nix-hacks.patch index 44c0fe053340..95f07646802e 100644 --- a/pkgs/development/tools/build-managers/bazel/nix-hacks.patch +++ b/pkgs/development/tools/build-managers/bazel/nix-hacks.patch @@ -1,41 +1,41 @@ 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 845c8b6aa3..3a46235fcd 100644 +index 8e772005cd..6ffa1c919c 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 -@@ -171,14 +171,8 @@ public final class RepositoryDelegatorFunction implements SkyFunction { - - DigestWriter digestWriter = new DigestWriter(directories, repositoryName, rule); - if (shouldUseCachedRepos(env, handler, repoRoot, rule)) { -- // Make sure marker file is up-to-date; correctly describes the current repository state -- byte[] markerHash = digestWriter.areRepositoryAndMarkerFileConsistent(handler, env); -- if (env.valuesMissing()) { -- return null; -- } -- if (markerHash != null) { -- return RepositoryDirectoryValue.builder().setPath(repoRoot).setDigest(markerHash).build(); -- } -+ // Nix hack: Always consider cached dirs up-to-date -+ return RepositoryDirectoryValue.builder().setPath(repoRoot).setDigest(digestWriter.writeMarkerFile()).build(); - } - - /* At this point: This is a force fetch, a local repository, OR The repository cache is old or -@@ -513,7 +507,8 @@ public final class RepositoryDelegatorFunction implements SkyFunction { - } - String content = builder.toString(); +@@ -432,25 +432,7 @@ public final class RepositoryDelegatorFunction implements SkyFunction { + String content; try { -- FileSystemUtils.writeContent(markerPath, UTF_8, content); -+ // Nix hack: Do not write these pesky marker files -+ // FileSystemUtils.writeContent(markerPath, UTF_8, content); + content = FileSystemUtils.readContent(markerPath, StandardCharsets.UTF_8); +- String markerRuleKey = readMarkerFile(content, markerData); +- boolean verified = false; +- if (Preconditions.checkNotNull(ruleKey).equals(markerRuleKey) +- && Objects.equals( +- markerData.get(MANAGED_DIRECTORIES_MARKER), +- this.markerData.get(MANAGED_DIRECTORIES_MARKER))) { +- verified = handler.verifyMarkerData(rule, markerData, env); +- if (env.valuesMissing()) { +- return null; +- } +- } +- +- if (verified) { +- 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 649647c5f2..64d05b530c 100644 +index c282d57ab6..f9b0c08627 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 -@@ -165,7 +165,6 @@ public class JavaSubprocessFactory implements SubprocessFactory { - } - builder.command(argv); +@@ -146,7 +146,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()); |
