From 7ddd80603136eb33948cb24d32f9a0f32e45e011 Mon Sep 17 00:00:00 2001 From: Martin Kuntz Jacobsen Date: Mon, 16 Nov 2026 10:38:11 +0100 Subject: [PATCH 1/2] patches: README lists every applied patch and unpatched dep rows resolve (part of #12277) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Xut2hzwNN9Q3DFZx18pNic --- patches/README.md | 7 ++++++- patches/render.py | 3 +++ patches/render_test.py | 9 ++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/patches/README.md b/patches/README.md index a25276e971..423eb7d6b4 100644 --- a/patches/README.md +++ b/patches/README.md @@ -15,16 +15,20 @@ The Version column is generated from `MODULE.bazel`, and every patch it applies | `rules_rust` | 0.75.0 | `static_archive_link_arg.patch` | The trailing link flag of a native static library is its archive path, not `-l`, so a `lib.so` next to the archive is never linked when Rustc runs unsandboxed (bazelbuild/rules_rust#3993; drop when a rules_rust release has it). Consumer fix: #12010 | | `rules_rust` | 0.75.0 | `cargo_build_script_no_coverage.patch` | Build scripts configure cc features without `coverage`, `gcc_coverage_map_format` and `llvm_coverage_map_format`, so apple_support's unconditional `GCOV_GCNO_FILE=%{gcov_gcno_file}` env entry does not fail analysis on macOS under coverage (drop when a rules_rust release has it). Consumer fix: #12155 | | `rules_rust` | 0.75.0 | `crate_universe_module_labels.patch` | Root only. Crate hub lockfiles pin the root module's own labels as `@@+//`, so the pinned lockfile resolves when rules_dx is a dependency; the root build reads them back as `@@//` | +| `rules_rust` | 0.75.0 | `windows_exec_foreign_target_cc_linker.patch` | Root only. A generated `rust_toolchain` with a Windows exec triple and a non-Windows target triple sets `linker_preference = "cc"`, so those targets link through the cc toolchain | | `rules_android` | 0.8.1 | `bundle_keystore_properties.patch` | App Bundles with key rotation: write the oldest-signer properties file instead of reading the removed `_bundle_keystore_properties` attribute. Consumer fix: #11417 | | `rules_android` | 0.8.1 | `java8_dex_runfiles.patch` | `build_java8_legacy_dex.sh` sets `JAVA_RUNFILES` to its own runfiles tree, as `d8_desugar.sh` does, so the `d8`, `r8` and `tracereferences` launchers it resolves through the runfiles manifest find their jars when the genrule runs unsandboxed. Consumer fix: #11387 | | `rules_scala` | 7.4.1 | `manifest_only_wrapper.patch` | The `scala_binary` launcher finds its java wrapper through `RUNFILES_MANIFEST_FILE` when the runfiles directory does not have it, and sets `TEST_SRCDIR` from `JAVA_RUNFILES` when only that is set. Consumer fix: #11417 | | `rules_perl` | 2.1.0 | `macos_pod.patch` | The macOS perl repos also extract `lib//Pod` from the `x86_64-linux-gnu` archive, which the portable-perl 20260929 macOS archives lack, so Perl::Critic and Pod::Usage load on macOS. Consumer fix: #12728 | | `rules_cuda` | 0.4.0 | `msvc_dlink_crt.patch` | `nvcc -dlink` on Windows gets the same `/MD` or `/MT` and `-ccbin` host compiler as the compile action, so rdc links do not mix LIBCMT with the dynamic CRT. Consumer fix: #11418 | +| `rules_cuda` | 0.4.0 | `toolchains_gate.patch` | Root only. The CUDA toolchains have `target_settings = ["@@//config:toolchains_on"]` | | `grpc` | 1.85.1 | `pip_parse_no_310.patch` | Root only. grpc's pip hub skips python 3.10, which has no aarch64-pc-windows-msvc runtime, so windows_arm64 lock refresh evaluates | | `grpc` | 1.85.1 | `upb_reflection_cc.patch` | Root only. Targets that depend on `@com_google_protobuf//upb/reflection` also depend on `upb/reflection:reflection_cc`, which has `def.hpp` and `message.hpp` from protobuf 37.0 on | | `protoc-gen-validate` | 1.2.1.bcr.2 | `pip_parse_no_39_310.patch` | Root only. pgv's pip hub skips python 3.9 and 3.10, which have no aarch64-pc-windows-msvc runtime | | `rules_dart` | 0.8.1 | `coverage.patch` | `dart_test` writes LCOV under `bazel coverage`: the test launcher passes `--coverage` to `package:test` and converts the report. Consumer fix: #11417 | | `rules_dart` | 0.8.1 | `external_pkgsrcs.patch` | Sources of packages from an external repository are staged into `.pkgsrcs`, which `copy_to_directory` otherwise drops. Consumer fix: #11417 | +| `rules_dart` | 0.8.1 | `windows_long_dill.patch` | Root only. On Windows `test_runner.dart` resolves the symlinked kernel snapshot before starting the test | +| `rules_java` | 9.9.0 | `toolchains_gate.patch` | Root only. The default Java toolchain definitions have `target_settings = ["@@//config:toolchains_on", ...]` | | `rules_flutter` | 0.0.8 | `lock_extension.patch` | Root only. The `flutter` extension is not reproducible, so a lockfile written on one host does not pin another | | `rules_flutter` | 0.0.8 | `registrant_javacopts.patch` | The Android plugin registrant compiles without `-Xlint:all` warnings about source 8. Consumer fix: #11417 | | `rules_flutter` | 0.0.8 | `required_checksums.patch` | A Flutter engine download without a sha256 fails the fetch, including the Dart SDK of the web SDK repo. Consumer fix: #11417 | @@ -69,6 +73,7 @@ The Version column is generated from `MODULE.bazel`, and every patch it applies | `windows_support` | 0.4.1 | `source_directory_headers.patch` | The Windows SDK `ucrt`, `shared`, `um` and `winrt` include targets give compiles one source directory each instead of about 4,000 loose headers, so Bazel caches their Merkle trees (upstream: hermeticbuild/windows_support#22 and PR #23; drop when a windows_support release has it). Consumer fix: #11416 | | `windows_support` | 0.4.1 | `hostarm64_packages.patch` | `@msvc_runtime` selects the `Hostarm64` MSVC packages and their dependencies when `host_tools` is set. Consumer fix: #11416 | | `windows_support` | 0.4.1 | `reproducible_extensions.patch` | Root only. `msvc_runtime` and `windows_sdk` are reproducible when their payloads are pinned by integrity, so `MODULE.bazel.lock` does not record them | +| `windows_support` | 0.4.1 | `pins.patch` | Root only. `msvc_runtime` reads the Visual Studio installer manifest URL and integrity from the `pins` file when it is set | | `apple_support` | 2.12.0 | `gcov_gcno_file.patch` | `GCOV_GCNO_FILE` is set only when `gcov_gcno_file` is available, so `cc_common.get_environment_variables` without it (rules_go `cgo_context_data`, rules_rust build scripts) does not fail analysis on macOS under coverage (drop when an apple_support release has it). Consumer fix: #12155 | | `apple_support` | 2.12.0 | `toolchains_gate.patch` | Root only. The Apple C++ toolchains have `target_settings = ["@@//config:toolchains_on"]` | | `rules_go` | 0.65.0 | `lazy_nogo.patch` | Toolchain registration does not load the Go rules, so builds without Go targets never fetch `@io_bazel_rules_nogo`. Consumer fix: #11418 | @@ -88,7 +93,7 @@ Swift package on BCR `rules_swift` on Linux x86_64. ## elvis, rules_d, rules_dart, rules_dotnet, rules_elixir, rules_erlang, rules_flutter, rules_fortran, rules_haskell, rules_julia, rules_ocaml, rules_ruby -No action. `rules_dx` applies these patches in its own repository rules: `pic_link.patch`, `disabled_features.patch` (rules_d); `hermetic_tar.patch` (rules_dart); `engine_labels.patch`, `hermetic_pub.patch` (rules_flutter); `reproducible.patch`, `fsharp_signature.patch`, `nuget_group_prefix.patch`, `sdk_versions.patch`, `canonical_labels.patch` (rules_dotnet); `coverage_wrapper_no_report.patch`, `hermetic_haskell.patch`, `cabal_rules.patch`, `cabal_mingw_transition.patch`, `cc_wrapper_relpath_mount.patch`, `ghc_wrapper_runfiles_env.patch`, `cc_toolchain_config_info.patch`, `cabal_llvm_ar.patch`, `cc_wrapper_darwin_ffi.patch`, `cabal_binary_dep_data.patch` (rules_haskell); `package_annotation_version.patch`, `package_name.patch`, `portable_cpu_target.patch`, `template_action_input.patch` (rules_julia); `reproducible.patch`, `coverage.patch`, `rubyinstaller_archive.patch` (rules_ruby). +No action. `rules_dx` applies these patches in its own repository rules: `pic_link.patch`, `disabled_features.patch` (rules_d); `hermetic_tar.patch` (rules_dart); `engine_labels.patch`, `hermetic_pub.patch` (rules_flutter); `reproducible.patch`, `fsharp_signature.patch`, `nuget_group_prefix.patch`, `sdk_versions.patch`, `canonical_labels.patch`, `toolchains_gate.patch` (rules_dotnet); `coverage_wrapper_no_report.patch`, `hermetic_haskell.patch`, `cabal_rules.patch`, `cabal_mingw_transition.patch`, `cc_wrapper_relpath_mount.patch`, `ghc_wrapper_runfiles_env.patch`, `cc_toolchain_config_info.patch`, `cabal_llvm_ar.patch`, `cc_wrapper_darwin_ffi.patch`, `cabal_binary_dep_data.patch` (rules_haskell); `elixir_app_deps.patch`, `elixir_app_name.patch`, `relocatable_tree.patch`, `warnings_as_errors.patch`, `windows_ex_unit_test.patch` (rules_elixir); `01_xrl_yrl.patch`, `02_tcw_tags.patch`, `03_auto_sname.patch`, `04_otp_tree.patch`, `05_windows_eunit_cover.patch` (rules_erlang); `package_annotation_version.patch`, `package_name.patch`, `portable_cpu_target.patch`, `template_action_input.patch` (rules_julia); `reproducible.patch`, `coverage.patch`, `rubyinstaller_archive.patch`, `toolchains_gate.patch` (rules_ruby). ## kcov diff --git a/patches/render.py b/patches/render.py index ab26ee820a..8ddb94316f 100644 --- a/patches/render.py +++ b/patches/render.py @@ -28,12 +28,15 @@ def overrides(module_text): def render(module_text, readme_text): """Returns the README with each table row's Version set from MODULE.bazel.""" known = overrides(module_text) + deps = dict(_DEP.findall(module_text)) listed = {} out = [] for line in readme_text.split("\n"): cells = line.split(" | ", 3) if len(cells) == 4 and cells[0].startswith("| `") and not cells[0].startswith("| `---"): module = cells[0][3:].split("`", 1)[0] + if module not in known and cells[2].strip() == "none" and module in deps: + known[module] = (deps[module], []) if module not in known: raise SystemExit("patches/README.md: %s has no override in MODULE.bazel" % module) if not (cells[3].startswith("Root only.") or re.search(r"Consumer fix: #\d+ \|?$", cells[3])): diff --git a/patches/render_test.py b/patches/render_test.py index 260bd09006..6c2308c1bb 100644 --- a/patches/render_test.py +++ b/patches/render_test.py @@ -13,7 +13,6 @@ README = "text\n\n| Module | Version | Patches | Why |\n| --- | --- | --- | --- |\n| `foo` | 1.0 | `a.patch` | Root only. Because |\n" - class RenderTest(unittest.TestCase): def test_sets_version(self): self.assertIn("| `foo` | 2.0 | `a.patch` | Root only. Because |", render.render(MODULE, README)) @@ -67,6 +66,14 @@ def test_repo_rule_patch_in_other_section(self): with self.assertRaises(SystemExit): render.render(module, readme) + def test_unpatched_dep_row(self): + module = MODULE + 'bazel_dep(name = "bar", version = "3.1")\n' + readme = README + "| `bar` | 1.0 | none | Root only. Newer |\n" + self.assertIn("| `bar` | 3.1 | none | Root only. Newer |", render.render(module, readme)) + + def test_unpatched_row_without_dep(self): + with self.assertRaises(SystemExit): + render.render(MODULE, README + "| `bar` | 1.0 | none | Root only. Newer |\n") if __name__ == "__main__": unittest.main() From 245fbe00d6288d7860fa0bbb00c1c2a003eb7684 Mon Sep 17 00:00:00 2001 From: Martin Kuntz Jacobsen Date: Mon, 16 Nov 2026 10:38:19 +0100 Subject: [PATCH 2/2] patches: restore blank lines in render_test (part of #12277) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Xut2hzwNN9Q3DFZx18pNic --- patches/render_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/patches/render_test.py b/patches/render_test.py index 6c2308c1bb..e830ba088c 100644 --- a/patches/render_test.py +++ b/patches/render_test.py @@ -13,6 +13,7 @@ README = "text\n\n| Module | Version | Patches | Why |\n| --- | --- | --- | --- |\n| `foo` | 1.0 | `a.patch` | Root only. Because |\n" + class RenderTest(unittest.TestCase): def test_sets_version(self): self.assertIn("| `foo` | 2.0 | `a.patch` | Root only. Because |", render.render(MODULE, README)) @@ -75,5 +76,6 @@ def test_unpatched_row_without_dep(self): with self.assertRaises(SystemExit): render.render(MODULE, README + "| `bar` | 1.0 | none | Root only. Newer |\n") + if __name__ == "__main__": unittest.main()