Skip to content

Commit

Permalink
Bump to 7.0.0rc2
Browse files Browse the repository at this point in the history
  • Loading branch information
layus committed Dec 13, 2023
1 parent 622804a commit 05ecc09
Show file tree
Hide file tree
Showing 6 changed files with 360 additions and 347 deletions.
20 changes: 10 additions & 10 deletions pkgs/development/tools/build-managers/bazel/bazel_7/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,23 @@
}@args:

let
version = "7.0.0-pre.20231011.2";
#version = "7.0.0rc2";
#version = "7.0.0-pre.20231011.2";
version = "7.0.0rc2";
sourceRoot = ".";

src = fetchurl {
url = "https://github.com/bazelbuild/bazel/releases/download/${version}/bazel-${version}-dist.zip";
hash = "sha256-3kwNnFPGyRLBKSSzsa+pTNAHowH+fLjtwxiSY8RkbQc=";
#url = "https://releases.bazel.build/7.0.0/rc2/bazel-${version}-dist.zip";
#hash = "sha256-vUKMJ7jrcB5bupGHMDxEBE8U8kghq+RQ0+mYNYbYQws=";
#url = "https://github.com/bazelbuild/bazel/releases/download/${version}/bazel-${version}-dist.zip";
#hash = "sha256-3kwNnFPGyRLBKSSzsa+pTNAHowH+fLjtwxiSY8RkbQc=";
url = "https://releases.bazel.build/7.0.0/rc2/bazel-${version}-dist.zip";
hash = "sha256-vUKMJ7jrcB5bupGHMDxEBE8U8kghq+RQ0+mYNYbYQws=";
};

# Use builtins.fetchurl to avoid IFD, in particular on hydra
lockfile = builtins.fetchurl {
url = "https://raw.githubusercontent.com/bazelbuild/bazel/${version}/MODULE.bazel.lock";
sha256 = "sha256:0wdwkfq3mrg4dxvmq2prdsj1i5jyql8jc2wf3wx948cnc10pbfy7";
#url = "https://raw.githubusercontent.com/bazelbuild/bazel/release-${version}/MODULE.bazel.lock";
#sha256 = "sha256:1cp5dp3q8ck2w6x2lddij0pk9kikfh17sb1msxia4nsqjk2yj24j";
#url = "https://raw.githubusercontent.com/bazelbuild/bazel/${version}/MODULE.bazel.lock";
#sha256 = "sha256:0wdwkfq3mrg4dxvmq2prdsj1i5jyql8jc2wf3wx948cnc10pbfy7";
url = "https://raw.githubusercontent.com/bazelbuild/bazel/release-${version}/MODULE.bazel.lock";
sha256 = "sha256:1cp5dp3q8ck2w6x2lddij0pk9kikfh17sb1msxia4nsqjk2yj24j";
};

# Two-in-one format
Expand Down
67 changes: 39 additions & 28 deletions pkgs/development/tools/build-managers/bazel/bazel_7/nix-hacks.patch
Original file line number Diff line number Diff line change
@@ -1,38 +1,49 @@
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 25fbdcac9d..49616d37df 100644
index 845c8b6aa3..6f07298bd0 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
@@ -568,22 +568,7 @@ public final class RepositoryDelegatorFunction implements SkyFunction {
String content;
try {
content = FileSystemUtils.readContent(markerPath, StandardCharsets.UTF_8);
- String markerRuleKey = readMarkerFile(content, markerData);
- boolean verified = false;
- if (Preconditions.checkNotNull(ruleKey).equals(markerRuleKey)) {
- 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);
@@ -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();
}

/* 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 {
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
index 1a45b8a3a2..a6b73213f6 100644
index 649647c5f2..64d05b530c 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
@@ -152,7 +152,6 @@ public class JavaSubprocessFactory implements SubprocessFactory {
ProcessBuilder builder = new ProcessBuilder();
builder.command(params.getArgv());
@@ -165,7 +165,6 @@ public class JavaSubprocessFactory implements SubprocessFactory {
}
builder.command(argv);
if (params.getEnv() != null) {
- builder.environment().clear();
builder.environment().putAll(params.getEnv());
Expand Down
Loading

0 comments on commit 05ecc09

Please sign in to comment.