Skip to content

Commit 216bbad

Browse files
Auto merge of #146186 - dpaoliello:cc, r=<try>
Update cc-rs to 1.2.33, and switch rustc_codegen_ssa to use find-msvc-tools try-job: dist-aarch64-linux
2 parents 91edc3e + 45a0e10 commit 216bbad

File tree

6 files changed

+19
-15
lines changed

6 files changed

+19
-15
lines changed

Cargo.lock

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,9 @@ version = "0.1.0"
462462

463463
[[package]]
464464
name = "cc"
465-
version = "1.2.16"
465+
version = "1.2.33"
466466
source = "registry+https://github.com/rust-lang/crates.io-index"
467-
checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c"
467+
checksum = "3ee0f8803222ba5a7e2777dd72ca451868909b1ac410621b676adf07280e9b5f"
468468
dependencies = [
469469
"jobserver",
470470
"libc",
@@ -1325,6 +1325,12 @@ dependencies = [
13251325
"windows-sys 0.59.0",
13261326
]
13271327

1328+
[[package]]
1329+
name = "find-msvc-tools"
1330+
version = "0.1.0"
1331+
source = "registry+https://github.com/rust-lang/crates.io-index"
1332+
checksum = "e178e4fba8a2726903f6ba98a6d221e76f9c12c650d5dc0e6afdc50677b49650"
1333+
13281334
[[package]]
13291335
name = "flate2"
13301336
version = "1.1.2"
@@ -3521,7 +3527,7 @@ dependencies = [
35213527
"ar_archive_writer",
35223528
"bitflags",
35233529
"bstr",
3524-
"cc",
3530+
"find-msvc-tools",
35253531
"itertools",
35263532
"libc",
35273533
"object 0.37.3",

compiler/rustc_codegen_ssa/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ edition = "2024"
88
ar_archive_writer = "0.5"
99
bitflags = "2.4.1"
1010
bstr = "1.11.3"
11-
# `cc` updates often break things, so we pin it here. Cargo enforces "max 1 semver-compat version
12-
# per crate", so if you change this, you need to also change it in `rustc_llvm`.
13-
cc = "=1.2.16"
11+
# `find-msvc-tools` updates often break things, so we pin it here.
12+
find-msvc-tools = "=0.1.0"
1413
itertools = "0.12"
1514
pathdiff = "0.2.0"
1615
regex = "1.4"

compiler/rustc_codegen_ssa/src/back/link.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::path::{Path, PathBuf};
99
use std::process::{Output, Stdio};
1010
use std::{env, fmt, fs, io, mem, str};
1111

12-
use cc::windows_registry;
12+
use find_msvc_tools;
1313
use itertools::Itertools;
1414
use regex::Regex;
1515
use rustc_arena::TypedArena;
@@ -877,9 +877,9 @@ fn link_natively(
877877
// All Microsoft `link.exe` linking ror codes are
878878
// four digit numbers in the range 1000 to 9999 inclusive
879879
if is_msvc_link_exe && (code < 1000 || code > 9999) {
880-
let is_vs_installed = windows_registry::find_vs_version().is_ok();
880+
let is_vs_installed = find_msvc_tools::find_vs_version().is_ok();
881881
let has_linker =
882-
windows_registry::find_tool(&sess.target.arch, "link.exe").is_some();
882+
find_msvc_tools::find_tool(&sess.target.arch, "link.exe").is_some();
883883

884884
sess.dcx().emit_note(errors::LinkExeUnexpectedError);
885885

compiler/rustc_codegen_ssa/src/back/linker.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::io::prelude::*;
44
use std::path::{Path, PathBuf};
55
use std::{env, io, iter, mem, str};
66

7-
use cc::windows_registry;
7+
use find_msvc_tools;
88
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
99
use rustc_metadata::{
1010
find_native_static_library, try_find_native_dynamic_library, try_find_native_static_library,
@@ -53,7 +53,7 @@ pub(crate) fn get_linker<'a>(
5353
self_contained: bool,
5454
target_cpu: &'a str,
5555
) -> Box<dyn Linker + 'a> {
56-
let msvc_tool = windows_registry::find_tool(&sess.target.arch, "link.exe");
56+
let msvc_tool = find_msvc_tools::find_tool(&sess.target.arch, "link.exe");
5757

5858
// If our linker looks like a batch script on Windows then to execute this
5959
// we'll need to spawn `cmd` explicitly. This is primarily done to handle
@@ -117,7 +117,6 @@ pub(crate) fn get_linker<'a>(
117117
if sess.target.is_like_msvc
118118
&& let Some(ref tool) = msvc_tool
119119
{
120-
cmd.args(tool.args());
121120
for (k, v) in tool.env() {
122121
if k == "PATH" {
123122
new_path.extend(env::split_paths(v));

compiler/rustc_llvm/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ libc = "0.2.73"
1010

1111
[build-dependencies]
1212
# tidy-alphabetical-start
13-
# `cc` updates often break things, so we pin it here. Cargo enforces "max 1 semver-compat version
14-
# per crate", so if you change this, you need to also change it in `rustc_codegen_ssa`.
15-
cc = "=1.2.16"
13+
# `cc` updates often break things, so we pin it here.
14+
cc = "=1.2.33"
1615
# tidy-alphabetical-end
1716

1817
[features]

src/tools/tidy/src/deps.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
275275
"expect-test",
276276
"fallible-iterator", // dependency of `thorin`
277277
"fastrand",
278+
"find-msvc-tools",
278279
"flate2",
279280
"fluent-bundle",
280281
"fluent-langneg",

0 commit comments

Comments
 (0)