From 14d715d10896051c42359923f5e0d930e112dbce Mon Sep 17 00:00:00 2001 From: Dmitry Ivankov Date: Thu, 14 Nov 2024 01:56:35 +0100 Subject: [PATCH] bazel_7: remove nix hack of removing .marker files --- .../build-bazel-package/default.nix | 3 -- pkgs/by-name/fc/fcitx5-mozc/package.nix | 2 +- .../bazel/bazel_7/nix-hacks.patch | 43 ------------------- 3 files changed, 1 insertion(+), 47 deletions(-) diff --git a/pkgs/build-support/build-bazel-package/default.nix b/pkgs/build-support/build-bazel-package/default.nix index 1131f73a1836a..ad1f1322b13a7 100644 --- a/pkgs/build-support/build-bazel-package/default.nix +++ b/pkgs/build-support/build-bazel-package/default.nix @@ -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) diff --git a/pkgs/by-name/fc/fcitx5-mozc/package.nix b/pkgs/by-name/fc/fcitx5-mozc/package.nix index 43535fd935455..71b3110a9d043 100644 --- a/pkgs/by-name/fc/fcitx5-mozc/package.nix +++ b/pkgs/by-name/fc/fcitx5-mozc/package.nix @@ -62,7 +62,7 @@ buildBazelPackage { rm -rf $bazelOut/external/fcitx5 ''; - sha256 = "sha256-wz2lJckr7Pu4jtoejjFv8LdjVO2+ferrS473M4jc86I="; + sha256 = "sha256-pTSuR4OAAlr4lAL7yrijtM3YTxI4HKIBYItp3XqWL/M="; }; preConfigure = '' 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 07fd098b80434..d458b8da71173 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,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