diff options
Diffstat (limited to 'pkgs/development/tools/build-managers/bazel/bazel_7/nix-hacks.patch')
-rw-r--r-- | pkgs/development/tools/build-managers/bazel/bazel_7/nix-hacks.patch | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/pkgs/development/tools/build-managers/bazel/bazel_7/nix-hacks.patch b/pkgs/development/tools/build-managers/bazel/bazel_7/nix-hacks.patch index 3c3fc57e0fc00..07fd098b80434 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_7/nix-hacks.patch +++ b/pkgs/development/tools/build-managers/bazel/bazel_7/nix-hacks.patch @@ -1,25 +1,29 @@ 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..6f07298bd0 100644 +index 4d8c46f8d5..ed311226f0 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 as up-to-date -+ return RepositoryDirectoryValue.builder().setPath(repoRoot).setDigest(digestWriter.writeMarkerFile()).build(); - } +@@ -178,18 +178,8 @@ public final class RepositoryDelegatorFunction implements SkyFunction { + } + } + 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) { // repo exist & up-to-date +- return RepositoryDirectoryValue.builder() +- .setPath(repoRoot) +- .setDigest(markerHash) +- .setExcludeFromVendoring(shouldExcludeRepoFromVendoring(handler, rule)) +- .build(); +- } ++ // Nix hack: Always consider cached dirs as 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 -@@ -512,11 +506,12 @@ public final class RepositoryDelegatorFunction implements SkyFunction { + /* At this point: This is a force fetch, a local repository, OR The repository cache is old or +@@ -610,11 +600,12 @@ public final class RepositoryDelegatorFunction implements SkyFunction { builder.append(escape(key)).append(" ").append(escape(value)).append("\n"); } String content = builder.toString(); |