Files
codex/patches/rules_rs_rust_debug_modes.patch
T
zbarsky-openai 1099fe0694 Use hermetic LLVM for Windows MSVC Bazel builds (#60507)
## Why

Windows MSVC builds relied on installed C++ toolchains, and V8 snapshot generation required native Windows execution. Cross-compiling V8 also needs a Windows snapshot generator to preserve Windows unwind metadata.

## What changed

- Use the registered hermetic LLVM toolchain and declared Microsoft SDK for Windows MSVC builds, with static CRT linkage and the toolchain's declared `lld-link` for Rust.
- Run Windows V8 snapshot generators natively or through `rules_wine` on Linux, preserving target CPU, OS, and sandbox settings. Keep separate archive and binding pairs for the workspace's ISO stdio ABI and the distributed MSVC stdio ABI.
- Update build dependencies and bindgen, scope V8's Chromium libc++ settings to its own targets, and adapt native voice dependencies for clang-cl and Windows ARM64.
- Build SQLite directly with Bazel and give `openssl-sys` an explicit build using Bazel's OpenSSL.
- Remove build-worker source-directory dependencies from Bazel resource lookup, schema output discovery, and snapshot paths; embed assets in debug builds as well.

GitOrigin-RevId: fd224d9d28d73a67baf90f6d73c6079d60f20351
2026-11-10 03:02:25 +00:00

42 lines
1.8 KiB
Diff

diff --git a/rs/toolchains/declare_rustc_toolchains.bzl b/rs/toolchains/declare_rustc_toolchains.bzl
--- a/rs/toolchains/declare_rustc_toolchains.bzl
+++ b/rs/toolchains/declare_rustc_toolchains.bzl
@@ -132,5 +132,13 @@
"//conditions:default": rust_std_label,
})
+
+ # Apple targets default to packed dSYMs and invoke dsymutil at link time.
+ # The Linux remote Rust action has no dsymutil. Match Cargo release's
+ # split-debuginfo policy so line/full info remains available before packaging.
+ darwin_debug_flags = select({
+ "@platforms//os:macos": ["-Csplit-debuginfo=off"],
+ "//conditions:default": [],
+ })
-
+
for triple in exec_triples:
exec_triple = _parse_triple(triple)
@@ -152,8 +160,20 @@
"//conditions:default": [],
}),
default_edition = edition,
- extra_exec_rustc_flags = _rustc_flags_to_select(extra_exec_rustc_flags),
- extra_rustc_flags = _rustc_flags_to_select(extra_rustc_flags),
+ extra_exec_rustc_flags = _rustc_flags_to_select(extra_exec_rustc_flags) + darwin_debug_flags,
+ extra_rustc_flags = _rustc_flags_to_select(extra_rustc_flags) + darwin_debug_flags,
+ # Retain source locations through linking; release packaging owns
+ # extracting and stripping symbols. Keep -c dbg for full debugging.
+ debug_info = {
+ "dbg": "full",
+ "fastbuild": "line-tables-only",
+ "opt": "line-tables-only",
+ },
+ strip_level = {
+ "dbg": "none",
+ "fastbuild": "none",
+ "opt": "none",
+ },
exec_triple = triple,
target_triple = select(target_triple_select),
visibility = ["//visibility:public"],