rust/compiler
bors 96fe3c31c2 Auto merge of #147022 - Zalathar:no-args, r=wesleywiser
Remove current code for embedding command-line args in PDB

The compiler currently has code that will obtain a list of quoted command-line arguments, and pass it through to TargetMachine creation, so that the command-line args can be embedded in PDB output.

This PR removes that code, due to subtle concerns that might not have been apparent when it was originally added.

---

Those concerns include:
- The entire command-line quoting process is repeated every time a target-machine-factory is created. In incremental builds this typically occurs 500+ times, instead of happening only once. The repeated quoting constitutes a large chunk of instructions executed in the `large-workspace` benchmark.
  - See https://github.com/rust-lang/rust/pull/146804#issuecomment-3317322958 for an example of the perf consequences of skipping all that work.
  - This overhead occurs even when building for targets or configurations that don't emit PDB output.
- Command-line arguments are obtained in a way that completely bypasses the query system, which is a problem for the integrity of incremental compilation.
  - Fixing this alone is likely to inhibit incremental rebuilds for most or all CGUs, even in builds that don't emit PDB output.
- Command-line arguments and the executable path are obtained in a way that completely bypasses the compiler's path-remapping system, which is a reproducibility hazard.
  - https://github.com/rust-lang/rust/issues/128842

---

Relevant PRs:
- https://github.com/rust-lang/rust/pull/113492
- https://github.com/rust-lang/rust/pull/130446
- https://github.com/rust-lang/rust/pull/131805
- https://github.com/rust-lang/rust/pull/146700
- https://github.com/rust-lang/rust/pull/146973

Zulip thread:
- https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Some.20PDB.20info.20bypasses.20the.20query.20system.20and.20path.20remapping/with/541432211

---

According to rust-lang/rust#96475, one of the big motivations for embedding the command-line arguments was to enable tools like Live++. [It appears that Live++ doesn't actually support Rust yet](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/embeded.20compiler.20args.20and.20--remap-path-prefix/near/523800010), so it's possible that there aren't any existing workflows for this removal to break.

In the future, there could be a case for reintroducing some or all of this functionality, guarded behind an opt-in flag so that it doesn't cause problems for other users. But as it stands, the current implementation puts a disproportionate burden on other users and on compiler maintainers.
2025-10-22 00:21:08 +00:00
..
rustc Make llvm_enzyme a regular cargo feature 2025-09-15 15:31:56 +00:00
rustc_abi Rollup merge of #147134 - workingjubilee:remove-explicit-abialign-deref, r=Zalathar 2025-09-29 15:44:55 +10:00
rustc_arena some cleanups in compiler 2025-10-12 08:08:30 +00:00
rustc_ast Auto merge of #146221 - camsteffen:ast-boxes, r=cjgillot 2025-10-16 02:31:44 +00:00
rustc_ast_ir turn pointer width into an integer in target.json 2025-08-27 23:44:49 +02:00
rustc_ast_lowering Rollup merge of #147734 - fmease:tighten-relaxed, r=lcnr 2025-10-20 22:30:53 +11:00
rustc_ast_passes Extract common logic for iterating over features 2025-10-02 21:43:14 +00:00
rustc_ast_pretty Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_attr_parsing Rollup merge of #147532 - JonathanBrouwer:cfg_attr2, r=jdonszelmann 2025-10-18 15:09:03 +02:00
rustc_baked_icu_data Use default locale fallback data 2025-08-28 09:48:54 +00:00
rustc_borrowck Auto merge of #144607 - camsteffen:impl-trait-header-option, r=lcnr 2025-10-18 00:08:18 +00:00
rustc_builtin_macros Rollup merge of #144438 - dawidl022:contracts/guarded-lowering, r=oli-obk 2025-10-16 19:35:22 +02:00
rustc_codegen_cranelift Rollup merge of #145724 - folkertdev:track-caller-drop-no-mangle, r=fee1-dead 2025-10-18 08:08:36 +02:00
rustc_codegen_gcc remove broken link 2025-10-20 20:50:44 +00:00
rustc_codegen_llvm Auto merge of #147022 - Zalathar:no-args, r=wesleywiser 2025-10-22 00:21:08 +00:00
rustc_codegen_ssa Auto merge of #147022 - Zalathar:no-args, r=wesleywiser 2025-10-22 00:21:08 +00:00
rustc_const_eval Rollup merge of #147764 - beepster4096:oopsies_sorry, r=saethlin 2025-10-18 08:08:38 +02:00
rustc_data_structures Rollup merge of #147716 - zhetaicheleba:master, r=jdonszelmann 2025-10-15 23:41:05 +02:00
rustc_driver compiler: Add Windows resources to rustc-main and rustc_driver 2025-09-05 14:06:31 -04:00
rustc_driver_impl Remove current code for embedding command-line args in PDB 2025-10-18 12:24:40 +11:00
rustc_error_codes Rollup merge of #146585 - hkBst:indexing-1, r=jdonszelmann 2025-10-02 10:27:49 +02:00
rustc_error_messages Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_errors fix: Use untrimmed line numbers for trimmed suggestions 2025-10-19 23:58:04 +08:00
rustc_expand Rollup merge of #147438 - reddevilmidzy:rename-non-inline-module-in-msg, r=fee1-dead 2025-10-18 23:54:44 +02:00
rustc_feature Extract common logic for iterating over features 2025-10-02 21:43:14 +00:00
rustc_fluent_macro some cleanups in compiler 2025-10-12 08:08:30 +00:00
rustc_fs_util Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_graphviz some cleanups in compiler 2025-10-12 08:08:30 +00:00
rustc_hashes some cleanups in compiler 2025-10-12 08:08:30 +00:00
rustc_hir Rollup merge of #147676 - jdonszelmann:span-is-doc-comment, r=GuillaumeGomez 2025-10-15 23:41:03 +02:00
rustc_hir_analysis Rollup merge of #147734 - fmease:tighten-relaxed, r=lcnr 2025-10-20 22:30:53 +11:00
rustc_hir_id rustc_hir_id: Add a comment explaining why the crate exists 2025-08-20 15:04:00 -07:00
rustc_hir_pretty Rollup merge of #146102 - fmease:rm-dead-eff-code-iii, r=fee1-dead 2025-09-02 17:08:58 +02:00
rustc_hir_typeck Auto merge of #146725 - lcnr:eager-instantiate-binder, r=BoxyUwU 2025-10-21 21:09:46 +00:00
rustc_incremental Do not GC the current active incremental session directory 2025-10-20 02:39:55 +00:00
rustc_index Rollup merge of #147751 - nnethercote:bit_set-Word, r=Zalathar 2025-10-16 19:35:27 +02:00
rustc_index_macros Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_infer rename select_where_possible and select_all_or_error 2025-10-07 23:02:23 +01:00
rustc_interface Remove current code for embedding command-line args in PDB 2025-10-18 12:24:40 +11:00
rustc_lexer Fix a crash/mislex when more than one frontmatter closing possibility is considered 2025-09-22 15:10:41 -04:00
rustc_lint Rollup merge of #147382 - joshtriplett:unused-must-use-ignore-result-unit-uninhabited, r=fmease 2025-10-20 16:12:54 +11:00
rustc_lint_defs remove useless #![deny]s 2025-10-19 19:48:21 +02:00
rustc_llvm Remove current code for embedding command-line args in PDB 2025-10-18 12:24:40 +11:00
rustc_log Restrict sysroot crate imports to those defined in this repo. 2025-10-15 13:17:25 +01:00
rustc_macros use declarative macro for #[derive(TryFromU32)] 2025-10-06 14:54:38 +00:00
rustc_metadata Auto merge of #147695 - cjgillot:deduce-param-freeze, r=tmiasko 2025-10-18 12:37:45 +00:00
rustc_middle Auto merge of #147723 - ChayimFriedman2:ns-types, r=BoxyUwU 2025-10-21 14:43:26 +00:00
rustc_mir_build Fix ICE in pattern matching with generic const array length errors 2025-10-16 19:15:32 +08:00
rustc_mir_dataflow make move unwrap_binder! a move subpath 2025-10-11 22:51:40 -07:00
rustc_mir_transform Auto merge of #147867 - cjgillot:invalidate-cleanup, r=tmiasko 2025-10-21 01:17:03 +00:00
rustc_monomorphize Remove Option from impl_trait_header 2025-10-17 08:36:34 -05:00
rustc_next_trait_solver Auto merge of #146725 - lcnr:eager-instantiate-binder, r=BoxyUwU 2025-10-21 21:09:46 +00:00
rustc_parse Parse const unsafe trait properly 2025-10-18 23:39:30 +00:00
rustc_parse_format Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_passes Rollup merge of #138679 - Shunpoco:issue-125323, r=oli-obk 2025-10-18 23:54:43 +02:00
rustc_pattern_analysis Rename various "concrete opaque type" terminology to say "hidden type" 2025-09-27 22:58:02 +01:00
rustc_privacy Split impl_(opt_)trait_ref 2025-10-17 08:36:34 -05:00
rustc_proc_macro Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_public Remove StatementKind::Deinit. 2025-10-10 12:57:24 +00:00
rustc_public_bridge Rollup merge of #147800 - makai410:rp-cache-obj, r=celinval 2025-10-21 12:20:56 +11:00
rustc_query_impl fixup limit handling code 2025-09-08 15:07:12 -07:00
rustc_query_system Auto merge of #147508 - nnethercote:TaskDeps-improvements, r=saethlin 2025-10-17 04:47:43 +00:00
rustc_resolve use module_child index as disambiguator for external items 2025-10-17 18:04:28 +02:00
rustc_sanitizers Split impl_(opt_)trait_ref 2025-10-17 08:36:34 -05:00
rustc_serialize Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_session Auto merge of #147022 - Zalathar:no-args, r=wesleywiser 2025-10-22 00:21:08 +00:00
rustc_span Allow vector-scalar (vs) registers in ppc inline assembly 2025-10-14 09:52:56 -05:00
rustc_symbol_mangling Split impl_(opt_)trait_ref 2025-10-17 08:36:34 -05:00
rustc_target Rollup merge of #147454 - ferrocene:hoverbear/panic-abort-uwtables-qnx, r=wesleywiser 2025-10-18 08:08:37 +02:00
rustc_thread_pool some cleanups in compiler 2025-10-12 08:08:30 +00:00
rustc_trait_selection instantiate predicate binder without recanonicalizing goal in new solver 2025-10-20 10:31:08 +02:00
rustc_traits Auto merge of #146096 - adwinwhite:handle_normalization_overflow_in_mono1, r=saethlin 2025-10-13 00:20:10 +00:00
rustc_transmute prefer to use repeat_n over repeat and take 2025-10-09 01:24:55 +08:00
rustc_ty_utils Auto merge of #147695 - cjgillot:deduce-param-freeze, r=tmiasko 2025-10-18 12:37:45 +00:00
rustc_type_ir Auto merge of #146725 - lcnr:eager-instantiate-binder, r=BoxyUwU 2025-10-21 21:09:46 +00:00
rustc_type_ir_macros some cleanups in compiler 2025-10-12 08:08:30 +00:00
rustc_windows_rc [win] Use find-msvc-tools instead of cc to find the linker and rc on Windows 2025-09-19 12:00:30 -07:00