You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
consumer-setup: rules_rust patches go upstream or into rules_dx code, consumers get none (part of #11387) #11399
Part of #11387. After the #11387 first slice, rules_dx depends on BCR rules_rust 0.75.0 and its 9 patches are a root-only single_version_override again. A consumer gets unpatched rules_rust. Each patch needs an upstream release or a fix in rules_dx code.
Where
MODULE.bazel:8-24rules_rustsingle_version_override, patches under patches/rules_rust/
patches/README.mdrules_rust row (the why of each patch)
Consumer tests that run Rust: tools/testing/hermetic/consumers/{cpp_rust,rust_wasi,adopt_android}
Root-only, no action: crate_universe_root_lookup (the README root BUILD.bazel covers consumers).
A consumer-visible patch whose upstream is not released within a release cycle moves into rules_dx code (toolchain attrs, env or linker flags set by rules_dx's own rust toolchain or extension); file a separate issue for each.
PR #11423 classifies the patches in the README and posts the table on #11387. Remaining: #11411 (rust_lld_msvc_libpath), #11412 (exec_cc_toolchain_env), #11414 (pdb/lazy host tools/cargo_toml_env_vars measurement and fix); upstream PRs to draft for six patches (list on #11387). Pre-existing: //core/modules:lang_json_test fails on generated languages.json/langs.bzl.
#11414 static reading of unpatched rules_rust 0.75.0 (source only; no consumer or Windows run, those need CI):
msvc_pdb_output: default strip_level is dbg/fastbuild none, opt debuginfo (rust/private/toolchain.bzl:902). Unpatched, only -c opt MSVC bin/cdylib lose the declared .pdb; rustc still writes it as an undeclared file. Expected effect: no build failure, .pdb missing from opt outputs and remote results. rules_dx cannot fix it from its own MODULE.bazel: rust.toolchain tags are honoured only in the root module (rust/extensions.bzl:55), so a rules_dx-side fix has to go through the consumer root setup (MSVC-only strip_levelopt = none, output-equivalent since MSVC ignores -Cstrip).
crate_universe_lazy_host_tools: for a non-root module repin is always False, yet _get_host_cargo_rustc runs unconditionally, so every consumer fetches rust_host_tools (cargo + rustc) for rules_dx's dx_crates, dx_quality_crates, dx_thrift_crates hubs. Fetch only, no failure. No rules_dx-side switch exists; upstream only.
cargo_toml_env_vars_flag: crate.from_cargo has generate_cargo_toml_env_vars (default True, crate_universe/extensions.bzl:1645), which rules_dx could set to False on its hubs (cargo-bazel-lock.json checksum then changes). That does not remove the extractor fetch for every consumer: the vendored BUILD files of rules_rust_wasm_bindgen (rrwbd, 175), rules_rust_prost (rrprd, 105) and rules_rustrrra (34) also declare cargo_toml_env_vars, so rust_wasi-style consumers still fetch it unpatched. Upstream flag remains the only full fix.
Unpatched rules_rust measurement, round 2 (branch issue-11414-unpatched-rules-rustd245c6d, without msvc_pdb_output and crate_universe_lazy_host_tools):
43999855772 linux: //tools/testing/hermetic:rust_wasi PASSED. :cpp_rust TIMEOUT at 600.6s (consumer_qualifies_without_installs_or_network), no rust_host_tools error in the log, so not yet attributable.
43999860391 windows --config=dx_build_release build of //cli/cli:dx and :dx_pdb: success. Unpatched opt build does not fail.
43999864821 windows //cli/cli:dx_opt_pdb_test: analysis error 'OutputGroupInfo' value has no field or method 'pdb_file'. Unpatched opt build drops the .pdb output group.
Round 3 (cpp_rust only, test_timeout=1800): 44004546195 control on main, 44004555664 on the branch. Equal outcome means the timeout is the 600s budget, not lazy_host_tools.
Remaining:
Read 44004546195 / 44004555664 and record the lazy_host_tools verdict here.
msvc_pdb_output: set MSVC opt strip_level to none on the rules_dx Rust toolchain, or mark the row root-only in patches/README.md.
#11414 results: lazy_host_tools and cargo_toml_env_vars_flag do not change the consumer fetch set (44004546195 vs 44004555664 green); msvc_pdb_output absence only drops the pdb_file output group (43999860391, 43999864821). All three marked root-only in #12949.
Status 2026-11-17: BCR rules_rust latest is still 0.75.0; every patch is root-only or has a rules_dx consumer fix. Remaining needs action outside devhusdk/rules_dx: file upstream issues/PRs for cargo_toml_env_vars_flag, crate_universe_lazy_host_tools, cargo_build_script_no_coverage, windows_exec_foreign_target_cc_linker, crate_universe_module_labels, and land bazelbuild/rules_rust#4390, #3993, #4421, #4422, #4388, #4386 (#4380 merged). Then bump to the first BCR release containing them and drop those patches.
Upstream status for the patches still without an upstream issue or PR (checked against #4390, #3993, #4421, #4422, #4388, #4386: none of them covers these):
windows_exec_foreign_target_cc_linker: not opened. Review found the pin to cc breaks Windows hosts without a cc toolchain for the target (UEFI, no cc toolchain) and removes a working lld-link setup for the rust pin. It could not be reproduced on Windows from Linux. The draft is in ~/code/upstream/drafts/rules_rust-windows-linker.*.md; it needs a Windows run before it goes upstream.
Activity
TrapsterDK commentedon Nov 10, 2026
PR #11423 classifies the patches in the README and posts the table on #11387. Remaining: #11411 (rust_lld_msvc_libpath), #11412 (exec_cc_toolchain_env), #11414 (pdb/lazy host tools/cargo_toml_env_vars measurement and fix); upstream PRs to draft for six patches (list on #11387). Pre-existing: //core/modules:lang_json_test fails on generated languages.json/langs.bzl.
patches: one README row per rules_rust patch with its class (part of #…
patches: one README row per rules_rust patch with its class (part of #…
TrapsterDK commentedon Nov 12, 2026
Upstream status of
patches/rules_rust/:clippy_metadata_inputspipelined_rmeta_pathstatic_archive_link_argmsvc_pdb_outputexec_scope_universalextra_exec_rustc_env)cargo_toml_env_vars_flagcrate_universe_lazy_host_toolscargo_build_script_no_coverageAlready merged upstream:
rust_lld_msvc_libpath(bazelbuild/rules_rust#4396) and the MSVC stdlib link flags (bazelbuild/rules_rust#4376). Still open: bazelbuild/rules_rust#4388 (exec cc toolchain env) and bazelbuild/rules_rust#4386 (crate_universe root lookup).🤖 Generated with Claude Code
https://claude.ai/code/session_01Xut2i1LBYg969L4ZJRMURT
TrapsterDK commentedon Nov 13, 2026
#11414 static reading of unpatched rules_rust 0.75.0 (source only; no consumer or Windows run, those need CI):
msvc_pdb_output: defaultstrip_levelis dbg/fastbuildnone, optdebuginfo(rust/private/toolchain.bzl:902). Unpatched, only-c optMSVCbin/cdyliblose the declared.pdb; rustc still writes it as an undeclared file. Expected effect: no build failure,.pdbmissing from opt outputs and remote results. rules_dx cannot fix it from its ownMODULE.bazel:rust.toolchaintags are honoured only in the root module (rust/extensions.bzl:55), so a rules_dx-side fix has to go through the consumer root setup (MSVC-onlystrip_levelopt = none, output-equivalent since MSVC ignores-Cstrip).crate_universe_lazy_host_tools: for a non-root modulerepinis always False, yet_get_host_cargo_rustcruns unconditionally, so every consumer fetchesrust_host_tools(cargo + rustc) for rules_dx'sdx_crates,dx_quality_crates,dx_thrift_crateshubs. Fetch only, no failure. No rules_dx-side switch exists; upstream only.cargo_toml_env_vars_flag:crate.from_cargohasgenerate_cargo_toml_env_vars(default True,crate_universe/extensions.bzl:1645), which rules_dx could set to False on its hubs (cargo-bazel-lock.json checksum then changes). That does not remove the extractor fetch for every consumer: the vendored BUILD files ofrules_rust_wasm_bindgen(rrwbd, 175),rules_rust_prost(rrprd, 105) andrules_rustrrra(34) also declarecargo_toml_env_vars, so rust_wasi-style consumers still fetch it unpatched. Upstream flag remains the only full fix.TrapsterDK commentedon Nov 17, 2026
Unpatched rules_rust measurement, round 2 (branch
issue-11414-unpatched-rules-rustd245c6d, withoutmsvc_pdb_outputandcrate_universe_lazy_host_tools)://tools/testing/hermetic:rust_wasiPASSED.:cpp_rustTIMEOUT at 600.6s (consumer_qualifies_without_installs_or_network), norust_host_toolserror in the log, so not yet attributable.--config=dx_build_releasebuild of//cli/cli:dxand:dx_pdb: success. Unpatched opt build does not fail.//cli/cli:dx_opt_pdb_test: analysis error'OutputGroupInfo' value has no field or method 'pdb_file'. Unpatched opt build drops the .pdb output group.Round 3 (cpp_rust only,
test_timeout=1800): 44004546195 control on main, 44004555664 on the branch. Equal outcome means the timeout is the 600s budget, not lazy_host_tools.Remaining:
strip_levelto none on the rules_dx Rust toolchain, or mark the row root-only in patches/README.md.issue-11414-unpatched-rules-rust.TrapsterDK commentedon Nov 17, 2026
#11414 results: lazy_host_tools and cargo_toml_env_vars_flag do not change the consumer fetch set (44004546195 vs 44004555664 green); msvc_pdb_output absence only drops the pdb_file output group (43999860391, 43999864821). All three marked root-only in #12949.
TrapsterDK commentedon Nov 17, 2026
Status 2026-11-17: BCR rules_rust latest is still 0.75.0; every patch is root-only or has a rules_dx consumer fix. Remaining needs action outside devhusdk/rules_dx: file upstream issues/PRs for cargo_toml_env_vars_flag, crate_universe_lazy_host_tools, cargo_build_script_no_coverage, windows_exec_foreign_target_cc_linker, crate_universe_module_labels, and land bazelbuild/rules_rust#4390, #3993, #4421, #4422, #4388, #4386 (#4380 merged). Then bump to the first BCR release containing them and drop those patches.
TrapsterDK commentedon Nov 18, 2026
Upstream status for the patches still without an upstream issue or PR (checked against #4390, #3993, #4421, #4422, #4388, #4386: none of them covers these):
cargo_build_script_no_coverage: issue cargo_build_script picks up cc coverage features when coverage is enabled bazelbuild/rules_rust#4432, PR cargo_build_script: don't configure cc coverage features for build scripts bazelbuild/rules_rust#4433.crate_universe_module_labels: issue crate_universe: labels to a module's own targets point at the root module when it is used as a dependency bazelbuild/rules_rust#4435, PR crate_universe: resolve a non-root module's own labels to its repo bazelbuild/rules_rust#4436. The PR rewrites@@//for non-root modules only, so existing lockfiles stay valid. It differs from the local patch, which changes the lockfile.crate_universe_lazy_host_tools: existing issue crate_universe:crate.from_cargomaterializes the wholerust_host_toolsrepo in every fresh output base just to run--versionbazelbuild/rules_rust#4331, PR crate_universe: don't fetch host tools for non-root modules bazelbuild/rules_rust#4438. The PR covers non-root modules only; the root-module case in feat(license): emit NOTICE manifest from dx license #4331 needs a larger change, so the local patch stays for that.cargo_toml_env_vars_flag: issue Proposal: a global flag to turn off the Cargo.toml env var extractor bazelbuild/rules_rust#4437 (a new build setting, so CONTRIBUTING asks for a design discussion first). The PR is ready locally and waits for a maintainer reply.windows_exec_foreign_target_cc_linker: not opened. Review found the pin toccbreaks Windows hosts without a cc toolchain for the target (UEFI, no cc toolchain) and removes a workinglld-linksetup for therustpin. It could not be reproduced on Windows from Linux. The draft is in ~/code/upstream/drafts/rules_rust-windows-linker.*.md; it needs a Windows run before it goes upstream.Assisted by Claude.
TrapsterDK commentedon Nov 18, 2026
#13481 points the Upstream headers at bazelbuild/rules_rust#4433, #4436, #4438/#4331, #4437. Remaining (upstream only): land #4390, #3993, #4421, #4422, #4388, #4386, #4433, #4434, #4436, #4438; maintainer reply on #4437; Windows run before filing windows_exec_foreign_target_cc_linker; then bump rules_rust to the first BCR release with them and drop the patches.
patches: link the upstream rules_rust PRs and issues (part of #11399) (…