From 87328f7a4762b6e7ccf1b7d36c31d000529db269 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Wed, 3 Sep 2025 17:02:52 -0700 Subject: [PATCH 1/9] Update cc-rs to 1.2.33 --- Cargo.lock | 12 +++++++++--- compiler/rustc_codegen_ssa/Cargo.toml | 5 ++--- compiler/rustc_codegen_ssa/src/back/link.rs | 6 +++--- compiler/rustc_codegen_ssa/src/back/linker.rs | 5 ++--- compiler/rustc_llvm/Cargo.toml | 5 ++--- src/tools/tidy/src/deps.rs | 1 + 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c4c96f1569b6f..eec27c64a02f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -462,9 +462,9 @@ version = "0.1.0" [[package]] name = "cc" -version = "1.2.16" +version = "1.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +checksum = "3ee0f8803222ba5a7e2777dd72ca451868909b1ac410621b676adf07280e9b5f" dependencies = [ "jobserver", "libc", @@ -1325,6 +1325,12 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "find-msvc-tools" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e178e4fba8a2726903f6ba98a6d221e76f9c12c650d5dc0e6afdc50677b49650" + [[package]] name = "flate2" version = "1.1.2" @@ -3521,7 +3527,7 @@ dependencies = [ "ar_archive_writer", "bitflags", "bstr", - "cc", + "find-msvc-tools", "itertools", "libc", "object 0.37.3", diff --git a/compiler/rustc_codegen_ssa/Cargo.toml b/compiler/rustc_codegen_ssa/Cargo.toml index 2dfbc58164323..e61764dff2b04 100644 --- a/compiler/rustc_codegen_ssa/Cargo.toml +++ b/compiler/rustc_codegen_ssa/Cargo.toml @@ -8,9 +8,8 @@ edition = "2024" ar_archive_writer = "0.5" bitflags = "2.4.1" bstr = "1.11.3" -# `cc` updates often break things, so we pin it here. Cargo enforces "max 1 semver-compat version -# per crate", so if you change this, you need to also change it in `rustc_llvm`. -cc = "=1.2.16" +# `find-msvc-tools` updates often break things, so we pin it here. +find-msvc-tools = "=0.1.0" itertools = "0.12" pathdiff = "0.2.0" regex = "1.4" diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 48b01ea2df197..371f2c1a6a299 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -9,7 +9,7 @@ use std::path::{Path, PathBuf}; use std::process::{Output, Stdio}; use std::{env, fmt, fs, io, mem, str}; -use cc::windows_registry; +use find_msvc_tools; use itertools::Itertools; use regex::Regex; use rustc_arena::TypedArena; @@ -877,9 +877,9 @@ fn link_natively( // All Microsoft `link.exe` linking ror codes are // four digit numbers in the range 1000 to 9999 inclusive if is_msvc_link_exe && (code < 1000 || code > 9999) { - let is_vs_installed = windows_registry::find_vs_version().is_ok(); + let is_vs_installed = find_msvc_tools::find_vs_version().is_ok(); let has_linker = - windows_registry::find_tool(&sess.target.arch, "link.exe").is_some(); + find_msvc_tools::find_tool(&sess.target.arch, "link.exe").is_some(); sess.dcx().emit_note(errors::LinkExeUnexpectedError); diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs index a2efd420a327a..dff9f1eb06288 100644 --- a/compiler/rustc_codegen_ssa/src/back/linker.rs +++ b/compiler/rustc_codegen_ssa/src/back/linker.rs @@ -4,7 +4,7 @@ use std::io::prelude::*; use std::path::{Path, PathBuf}; use std::{env, io, iter, mem, str}; -use cc::windows_registry; +use find_msvc_tools; use rustc_hir::def_id::{CrateNum, LOCAL_CRATE}; use rustc_metadata::{ find_native_static_library, try_find_native_dynamic_library, try_find_native_static_library, @@ -53,7 +53,7 @@ pub(crate) fn get_linker<'a>( self_contained: bool, target_cpu: &'a str, ) -> Box { - let msvc_tool = windows_registry::find_tool(&sess.target.arch, "link.exe"); + let msvc_tool = find_msvc_tools::find_tool(&sess.target.arch, "link.exe"); // If our linker looks like a batch script on Windows then to execute this // we'll need to spawn `cmd` explicitly. This is primarily done to handle @@ -117,7 +117,6 @@ pub(crate) fn get_linker<'a>( if sess.target.is_like_msvc && let Some(ref tool) = msvc_tool { - cmd.args(tool.args()); for (k, v) in tool.env() { if k == "PATH" { new_path.extend(env::split_paths(v)); diff --git a/compiler/rustc_llvm/Cargo.toml b/compiler/rustc_llvm/Cargo.toml index cd352ce3d0f4f..45011f9b446cb 100644 --- a/compiler/rustc_llvm/Cargo.toml +++ b/compiler/rustc_llvm/Cargo.toml @@ -10,9 +10,8 @@ libc = "0.2.73" [build-dependencies] # tidy-alphabetical-start -# `cc` updates often break things, so we pin it here. Cargo enforces "max 1 semver-compat version -# per crate", so if you change this, you need to also change it in `rustc_codegen_ssa`. -cc = "=1.2.16" +# `cc` updates often break things, so we pin it here. +cc = "=1.2.33" # tidy-alphabetical-end [features] diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs index 560f11ecf50ec..93410997f486f 100644 --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs @@ -275,6 +275,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[ "expect-test", "fallible-iterator", // dependency of `thorin` "fastrand", + "find-msvc-tools", "flate2", "fluent-bundle", "fluent-langneg", From afc411829c3bacbd842a97099cf190742b4cdae0 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Fri, 5 Sep 2025 14:30:55 +0800 Subject: [PATCH 2/9] [EXPERIMENT 1] Pin compiler `cc` @ `1.2.28` (same as bootstrap) --- Cargo.lock | 4 ++-- compiler/rustc_llvm/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eec27c64a02f0..44923c303ea40 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -462,9 +462,9 @@ version = "0.1.0" [[package]] name = "cc" -version = "1.2.33" +version = "1.2.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee0f8803222ba5a7e2777dd72ca451868909b1ac410621b676adf07280e9b5f" +checksum = "4ad45f4f74e4e20eaa392913b7b33a7091c87e59628f4dd27888205ad888843c" dependencies = [ "jobserver", "libc", diff --git a/compiler/rustc_llvm/Cargo.toml b/compiler/rustc_llvm/Cargo.toml index 45011f9b446cb..21fd75a415bf3 100644 --- a/compiler/rustc_llvm/Cargo.toml +++ b/compiler/rustc_llvm/Cargo.toml @@ -11,7 +11,7 @@ libc = "0.2.73" [build-dependencies] # tidy-alphabetical-start # `cc` updates often break things, so we pin it here. -cc = "=1.2.33" +cc = "=1.2.28" # tidy-alphabetical-end [features] From a62c6d0d2a00178328a79024250561212cca1683 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Fri, 5 Sep 2025 15:04:29 +0800 Subject: [PATCH 3/9] [EXPERIMENT 2] Pin compiler `cc` @ `1.2.20` --- Cargo.lock | 4 ++-- compiler/rustc_llvm/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 44923c303ea40..8e2a2a333e855 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -462,9 +462,9 @@ version = "0.1.0" [[package]] name = "cc" -version = "1.2.28" +version = "1.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad45f4f74e4e20eaa392913b7b33a7091c87e59628f4dd27888205ad888843c" +checksum = "04da6a0d40b948dfc4fa8f5bbf402b0fc1a64a28dbf7d12ffd683550f2c1b63a" dependencies = [ "jobserver", "libc", diff --git a/compiler/rustc_llvm/Cargo.toml b/compiler/rustc_llvm/Cargo.toml index 21fd75a415bf3..f6f9f06bdc404 100644 --- a/compiler/rustc_llvm/Cargo.toml +++ b/compiler/rustc_llvm/Cargo.toml @@ -11,7 +11,7 @@ libc = "0.2.73" [build-dependencies] # tidy-alphabetical-start # `cc` updates often break things, so we pin it here. -cc = "=1.2.28" +cc = "=1.2.20" # tidy-alphabetical-end [features] From 9f6f8020769e730d09b5937deaacb4daf025c79f Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Fri, 5 Sep 2025 20:42:59 +0800 Subject: [PATCH 4/9] [EXPERIMENT 3] Pin compiler `cc` @ `1.2.26` --- Cargo.lock | 4 ++-- compiler/rustc_llvm/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e2a2a333e855..8e8a02b1c1a78 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -462,9 +462,9 @@ version = "0.1.0" [[package]] name = "cc" -version = "1.2.20" +version = "1.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04da6a0d40b948dfc4fa8f5bbf402b0fc1a64a28dbf7d12ffd683550f2c1b63a" +checksum = "956a5e21988b87f372569b66183b78babf23ebc2e744b733e4350a752c4dafac" dependencies = [ "jobserver", "libc", diff --git a/compiler/rustc_llvm/Cargo.toml b/compiler/rustc_llvm/Cargo.toml index f6f9f06bdc404..c831c744c3170 100644 --- a/compiler/rustc_llvm/Cargo.toml +++ b/compiler/rustc_llvm/Cargo.toml @@ -11,7 +11,7 @@ libc = "0.2.73" [build-dependencies] # tidy-alphabetical-start # `cc` updates often break things, so we pin it here. -cc = "=1.2.20" +cc = "=1.2.26" # tidy-alphabetical-end [features] From 0967f74d700024da08cf1c8e6114e073ca4f90a7 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Fri, 5 Sep 2025 21:26:51 +0800 Subject: [PATCH 5/9] [EXPERIMENT 4] Pin compiler `cc` @ `1.2.25` --- Cargo.lock | 4 ++-- compiler/rustc_llvm/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e8a02b1c1a78..0607e84ab3bcd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -462,9 +462,9 @@ version = "0.1.0" [[package]] name = "cc" -version = "1.2.26" +version = "1.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956a5e21988b87f372569b66183b78babf23ebc2e744b733e4350a752c4dafac" +checksum = "d0fc897dc1e865cc67c0e05a836d9d3f1df3cbe442aa4a9473b18e12624a4951" dependencies = [ "jobserver", "libc", diff --git a/compiler/rustc_llvm/Cargo.toml b/compiler/rustc_llvm/Cargo.toml index c831c744c3170..134c5b62f119a 100644 --- a/compiler/rustc_llvm/Cargo.toml +++ b/compiler/rustc_llvm/Cargo.toml @@ -11,7 +11,7 @@ libc = "0.2.73" [build-dependencies] # tidy-alphabetical-start # `cc` updates often break things, so we pin it here. -cc = "=1.2.26" +cc = "=1.2.25" # tidy-alphabetical-end [features] From 7a2d876d44ae1420de97c5bcb54e60fefd0431c4 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Fri, 5 Sep 2025 22:15:23 +0800 Subject: [PATCH 6/9] [EXPERIMENT 5] Pin compiler `cc` @ `1.2.23` --- Cargo.lock | 4 ++-- compiler/rustc_llvm/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0607e84ab3bcd..81a1ef6af7d91 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -462,9 +462,9 @@ version = "0.1.0" [[package]] name = "cc" -version = "1.2.25" +version = "1.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0fc897dc1e865cc67c0e05a836d9d3f1df3cbe442aa4a9473b18e12624a4951" +checksum = "5f4ac86a9e5bc1e2b3449ab9d7d3a6a405e3d1bb28d7b9be8614f55846ae3766" dependencies = [ "jobserver", "libc", diff --git a/compiler/rustc_llvm/Cargo.toml b/compiler/rustc_llvm/Cargo.toml index 134c5b62f119a..f80c283f6a5e4 100644 --- a/compiler/rustc_llvm/Cargo.toml +++ b/compiler/rustc_llvm/Cargo.toml @@ -11,7 +11,7 @@ libc = "0.2.73" [build-dependencies] # tidy-alphabetical-start # `cc` updates often break things, so we pin it here. -cc = "=1.2.25" +cc = "=1.2.23" # tidy-alphabetical-end [features] From fffb6586367a3bbd04ccc68ffa0808bbc465a8e8 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Fri, 5 Sep 2025 22:45:24 +0800 Subject: [PATCH 7/9] [EXPERIMENT 6] Pin compiler `cc` @ `1.2.20` --- Cargo.lock | 4 ++-- compiler/rustc_llvm/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81a1ef6af7d91..8e2a2a333e855 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -462,9 +462,9 @@ version = "0.1.0" [[package]] name = "cc" -version = "1.2.23" +version = "1.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4ac86a9e5bc1e2b3449ab9d7d3a6a405e3d1bb28d7b9be8614f55846ae3766" +checksum = "04da6a0d40b948dfc4fa8f5bbf402b0fc1a64a28dbf7d12ffd683550f2c1b63a" dependencies = [ "jobserver", "libc", diff --git a/compiler/rustc_llvm/Cargo.toml b/compiler/rustc_llvm/Cargo.toml index f80c283f6a5e4..f6f9f06bdc404 100644 --- a/compiler/rustc_llvm/Cargo.toml +++ b/compiler/rustc_llvm/Cargo.toml @@ -11,7 +11,7 @@ libc = "0.2.73" [build-dependencies] # tidy-alphabetical-start # `cc` updates often break things, so we pin it here. -cc = "=1.2.23" +cc = "=1.2.20" # tidy-alphabetical-end [features] From b077ef72d82a63b4e3b0edee1b86af9f7e7663dc Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Sat, 6 Sep 2025 01:46:32 +0800 Subject: [PATCH 8/9] [EXPERIMENT 7] Pin compiler `cc` @ `1.2.22` --- Cargo.lock | 4 ++-- compiler/rustc_llvm/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e2a2a333e855..bcd3516f66955 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -462,9 +462,9 @@ version = "0.1.0" [[package]] name = "cc" -version = "1.2.20" +version = "1.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04da6a0d40b948dfc4fa8f5bbf402b0fc1a64a28dbf7d12ffd683550f2c1b63a" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" dependencies = [ "jobserver", "libc", diff --git a/compiler/rustc_llvm/Cargo.toml b/compiler/rustc_llvm/Cargo.toml index f6f9f06bdc404..43c2389dfc0db 100644 --- a/compiler/rustc_llvm/Cargo.toml +++ b/compiler/rustc_llvm/Cargo.toml @@ -11,7 +11,7 @@ libc = "0.2.73" [build-dependencies] # tidy-alphabetical-start # `cc` updates often break things, so we pin it here. -cc = "=1.2.20" +cc = "=1.2.22" # tidy-alphabetical-end [features] From bfa0d2bb392b67e826c4606c963583e37ce8806e Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Sat, 6 Sep 2025 01:45:17 +0800 Subject: [PATCH 9/9] [EXPERIMENT 8] Pin compiler `cc` @ `1.2.21` --- Cargo.lock | 4 ++-- compiler/rustc_llvm/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bcd3516f66955..c702dd52247f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -462,9 +462,9 @@ version = "0.1.0" [[package]] name = "cc" -version = "1.2.22" +version = "1.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +checksum = "8691782945451c1c383942c4874dbe63814f61cb57ef773cda2972682b7bb3c0" dependencies = [ "jobserver", "libc", diff --git a/compiler/rustc_llvm/Cargo.toml b/compiler/rustc_llvm/Cargo.toml index 43c2389dfc0db..d12a01b4dc31b 100644 --- a/compiler/rustc_llvm/Cargo.toml +++ b/compiler/rustc_llvm/Cargo.toml @@ -11,7 +11,7 @@ libc = "0.2.73" [build-dependencies] # tidy-alphabetical-start # `cc` updates often break things, so we pin it here. -cc = "=1.2.22" +cc = "=1.2.21" # tidy-alphabetical-end [features]