From 2e5beb8aade993b0ed8efbe50b5fc4573e40f43c Mon Sep 17 00:00:00 2001 From: Michael Bolin Date: Thu, 2 Apr 2026 10:13:41 -0700 Subject: [PATCH] testing https://github.com/tyler-french/codex/pull/2 --- MODULE.bazel | 1 + patches/BUILD.bazel | 1 + ...rules_rs_delete_git_worktree_pointer.patch | 23 +++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 patches/rules_rs_delete_git_worktree_pointer.patch diff --git a/MODULE.bazel b/MODULE.bazel index d1a32df5f3..43f133db64 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -71,6 +71,7 @@ single_version_override( patch_strip = 1, patches = [ "//patches:rules_rs_windows_gnullvm_exec.patch", + "//patches:rules_rs_delete_git_worktree_pointer.patch", ], version = "0.0.43", ) diff --git a/patches/BUILD.bazel b/patches/BUILD.bazel index b6e96df523..ee72eac5ba 100644 --- a/patches/BUILD.bazel +++ b/patches/BUILD.bazel @@ -10,6 +10,7 @@ exports_files([ "rules_rust_repository_set_exec_constraints.patch", "rules_rust_windows_msvc_direct_link_args.patch", "rules_rust_windows_gnullvm_build_script.patch", + "rules_rs_delete_git_worktree_pointer.patch", "rules_rs_windows_gnullvm_exec.patch", "rusty_v8_prebuilt_out_dir.patch", "v8_bazel_rules.patch", diff --git a/patches/rules_rs_delete_git_worktree_pointer.patch b/patches/rules_rs_delete_git_worktree_pointer.patch new file mode 100644 index 0000000000..a47b6c7c8f --- /dev/null +++ b/patches/rules_rs_delete_git_worktree_pointer.patch @@ -0,0 +1,23 @@ +# What: delete .git worktree pointer from crate git checkouts. +# Why: the .git file contains an absolute path to the bazel output base, +# which differs across machines. This pollutes compile_data and causes +# action cache misses when builds run on different CI runners. + +diff --git a/rs/private/crate_git_repository.bzl b/rs/private/crate_git_repository.bzl +index 1234567..abcdefg 100644 +--- a/rs/private/crate_git_repository.bzl ++++ b/rs/private/crate_git_repository.bzl +@@ -35,6 +35,11 @@ def _crate_git_repository_implementation(rctx): + "HEAD" + ]) + if result.return_code != 0: + fail(result.stderr) + ++ # Remove .git worktree pointer file. It contains an absolute path to ++ # the bazel output base which is machine-specific and non-deterministic. ++ # Leaving it in pollutes compile_data globs and causes AC misses. ++ rctx.delete(root.get_child(".git")) ++ + if strip_prefix: + dest_link = dest_dir.get_child(strip_prefix) + if not dest_link.exists: