mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
[Backport staging-24.11] bazel_7: 7.4.0 -> 7.4.1 (#356802)
This commit is contained in:
commit
ab131d43ac
@ -44,10 +44,11 @@
|
|||||||
# Allow to independently override the jdks used to build and run respectively
|
# Allow to independently override the jdks used to build and run respectively
|
||||||
buildJdk,
|
buildJdk,
|
||||||
runJdk,
|
runJdk,
|
||||||
|
# Toggle for hacks for running bazel under buildBazelPackage:
|
||||||
# Always assume all markers valid (this is needed because we remove markers; they are non-deterministic).
|
# Always assume all markers valid (this is needed because we remove markers; they are non-deterministic).
|
||||||
# Also, don't clean up environment variables (so that NIX_ environment variables are passed to compilers).
|
# Also, don't clean up environment variables (so that NIX_ environment variables are passed to compilers).
|
||||||
enableNixHacks ? false,
|
enableNixHacks ? false,
|
||||||
version ? "7.4.0",
|
version ? "7.4.1",
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
@ -55,7 +56,7 @@ let
|
|||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://github.com/bazelbuild/bazel/releases/download/${version}/bazel-${version}-dist.zip";
|
url = "https://github.com/bazelbuild/bazel/releases/download/${version}/bazel-${version}-dist.zip";
|
||||||
hash = "sha256-GY1wu3O5O7K2MMJv6wjE+DLnUgwjkHdmcqhT1o9G9Cg=";
|
hash = "sha256-gzhmGLxIn02jYmbvJiDsZKUmxobPBwQTMsr/fJU6+vU=";
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultShellUtils =
|
defaultShellUtils =
|
||||||
@ -112,23 +113,23 @@ let
|
|||||||
if stdenv.hostPlatform.system == "x86_64-linux" then
|
if stdenv.hostPlatform.system == "x86_64-linux" then
|
||||||
fetchurl {
|
fetchurl {
|
||||||
url = "https://github.com/bazelbuild/bazel/releases/download/${version}/bazel_nojdk-${version}-linux-x86_64";
|
url = "https://github.com/bazelbuild/bazel/releases/download/${version}/bazel_nojdk-${version}-linux-x86_64";
|
||||||
hash = "sha256-0glQLNAU0aT7+3Hzv0+IzgvJlfs7y8wflEwFssIvnkk=";
|
hash = "sha256-CYL1paAtzTbfl7TfsqwJry/dkoTO/yZdHrX0NSA1+Ig=";
|
||||||
}
|
}
|
||||||
else if stdenv.hostPlatform.system == "aarch64-linux" then
|
else if stdenv.hostPlatform.system == "aarch64-linux" then
|
||||||
fetchurl {
|
fetchurl {
|
||||||
url = "https://github.com/bazelbuild/bazel/releases/download/${version}/bazel_nojdk-${version}-linux-arm64";
|
url = "https://github.com/bazelbuild/bazel/releases/download/${version}/bazel_nojdk-${version}-linux-arm64";
|
||||||
hash = "sha256-736PrTFckHyChRh0Uv8zNtCppQYhfZWECl9+44cs6Qo=";
|
hash = "sha256-6DzTEx218/Qq38eMWvXOX/t9VJDyPczz6Edh4eHdOfg=";
|
||||||
}
|
}
|
||||||
else if stdenv.hostPlatform.system == "x86_64-darwin" then
|
else if stdenv.hostPlatform.system == "x86_64-darwin" then
|
||||||
fetchurl {
|
fetchurl {
|
||||||
url = "https://github.com/bazelbuild/bazel/releases/download/${version}/bazel-${version}-darwin-x86_64";
|
url = "https://github.com/bazelbuild/bazel/releases/download/${version}/bazel-${version}-darwin-x86_64";
|
||||||
hash = "sha256-FX7ZKKG7uoteEvx0fBqpsoB3Gj0aJNaC2IXgJ2ffgz4=";
|
hash = "sha256-Ut00wXzJezqlvf49RcTjk4Im8j3Qv7R77t1iWpU/HwU=";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fetchurl {
|
fetchurl {
|
||||||
# stdenv.hostPlatform.system == "aarch64-darwin"
|
# stdenv.hostPlatform.system == "aarch64-darwin"
|
||||||
url = "https://github.com/bazelbuild/bazel/releases/download/${version}/bazel-${version}-darwin-arm64";
|
url = "https://github.com/bazelbuild/bazel/releases/download/${version}/bazel-${version}-darwin-arm64";
|
||||||
hash = "sha256-+EP+HssT4aISUZwLKkSuuXjGQm9lheNJDr7WZw1v0pU=";
|
hash = "sha256-ArEXuX0JIa5NT04R0n4sCTA4HfQW43NDXV0EGcaibyQ=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = defaultShellUtils;
|
nativeBuildInputs = defaultShellUtils;
|
||||||
@ -392,7 +393,7 @@ stdenv.mkDerivation rec {
|
|||||||
})
|
})
|
||||||
]
|
]
|
||||||
# See enableNixHacks argument above.
|
# See enableNixHacks argument above.
|
||||||
++ lib.optional enableNixHacks ./nix-hacks.patch;
|
++ lib.optional enableNixHacks ./nix-build-bazel-package-hacks.patch;
|
||||||
|
|
||||||
postPatch =
|
postPatch =
|
||||||
let
|
let
|
||||||
|
@ -1,10 +1,18 @@
|
|||||||
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
|
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 4d8c46f8d5..ed311226f0 100644
|
index 53e6494656..22261cd268 100644
|
||||||
--- a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java
|
--- 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
|
+++ b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java
|
||||||
@@ -178,18 +178,8 @@ public final class RepositoryDelegatorFunction implements SkyFunction {
|
@@ -55,6 +55,7 @@ import com.google.devtools.build.skyframe.SkyFunctionException.Transience;
|
||||||
}
|
import com.google.devtools.build.skyframe.SkyKey;
|
||||||
|
import com.google.devtools.build.skyframe.SkyValue;
|
||||||
|
import java.io.IOException;
|
||||||
|
+import java.util.Collections;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.TreeMap;
|
||||||
|
@@ -193,16 +194,11 @@ public final class RepositoryDelegatorFunction implements SkyFunction {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldUseCachedRepos(env, handler, repoRoot, rule)) {
|
if (shouldUseCachedRepos(env, handler, repoRoot, rule)) {
|
||||||
- // Make sure marker file is up-to-date; correctly describes the current repository state
|
- // Make sure marker file is up-to-date; correctly describes the current repository state
|
||||||
- byte[] markerHash = digestWriter.areRepositoryAndMarkerFileConsistent(handler, env);
|
- byte[] markerHash = digestWriter.areRepositoryAndMarkerFileConsistent(handler, env);
|
||||||
@ -12,34 +20,17 @@ index 4d8c46f8d5..ed311226f0 100644
|
|||||||
- return null;
|
- return null;
|
||||||
- }
|
- }
|
||||||
- if (markerHash != null) { // repo exist & up-to-date
|
- 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
|
+ // Nix hack: Always consider cached dirs as up-to-date
|
||||||
+ return RepositoryDirectoryValue.builder().setPath(repoRoot).setDigest(digestWriter.writeMarkerFile()).build();
|
return RepositoryDirectoryValue.builder()
|
||||||
|
.setPath(repoRoot)
|
||||||
|
- .setDigest(markerHash)
|
||||||
|
- .setExcludeFromVendoring(excludeRepoFromVendoring)
|
||||||
|
+ .setDigest(digestWriter.writeMarkerFile(Collections.emptyMap()))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 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();
|
|
||||||
- try {
|
|
||||||
- FileSystemUtils.writeContent(markerPath, UTF_8, content);
|
|
||||||
- } catch (IOException e) {
|
|
||||||
- throw new RepositoryFunctionException(e, Transience.TRANSIENT);
|
|
||||||
- }
|
|
||||||
+ // Nix hack: Do not write these pesky marker files
|
|
||||||
+ //try {
|
|
||||||
+ // FileSystemUtils.writeContent(markerPath, UTF_8, content);
|
|
||||||
+ //} catch (IOException e) {
|
|
||||||
+ // throw new RepositoryFunctionException(e, Transience.TRANSIENT);
|
|
||||||
+ //}
|
|
||||||
return new Fingerprint().addString(content).digestAndReset();
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
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 649647c5f2..64d05b530c 100644
|
Loading…
Reference in New Issue
Block a user