Skip to content

Commit

Permalink
bazel_7: remove nix hack of removing .marker files
Browse files Browse the repository at this point in the history
  • Loading branch information
boltzmannrain committed Nov 14, 2024
1 parent 82c4c76 commit 14d715d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 47 deletions.
3 changes: 0 additions & 3 deletions pkgs/build-support/build-bazel-package/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ stdenv.mkDerivation (fBuildAttrs // {
${lib.optionalString removeLocalConfigCc "rm -rf $bazelOut/external/{local_config_cc,\\@local_config_cc.marker}"}
${lib.optionalString removeLocal "rm -rf $bazelOut/external/{local_*,\\@local_*.marker}"}
# Clear markers
find $bazelOut/external -name '@*\.marker' -exec sh -c 'echo > {}' \;
# Remove all vcs files
rm -rf $(find $bazelOut/external -type d -name .git)
rm -rf $(find $bazelOut/external -type d -name .svn)
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/fc/fcitx5-mozc/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ buildBazelPackage {
rm -rf $bazelOut/external/fcitx5
'';

sha256 = "sha256-wz2lJckr7Pu4jtoejjFv8LdjVO2+ferrS473M4jc86I=";
sha256 = "sha256-pTSuR4OAAlr4lAL7yrijtM3YTxI4HKIBYItp3XqWL/M=";
};

preConfigure = ''
Expand Down
Original file line number Diff line number Diff line change
@@ -1,46 +1,3 @@
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
--- 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
@@ -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
@@ -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
index 649647c5f2..64d05b530c 100644
--- a/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java
Expand Down

0 comments on commit 14d715d

Please sign in to comment.