Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -3521,7 +3527,7 @@ dependencies = [
"ar_archive_writer",
"bitflags",
"bstr",
"cc",
"find-msvc-tools",
"itertools",
"libc",
"object 0.37.3",
Expand Down Expand Up @@ -5417,8 +5423,7 @@ version = "0.1.0"
[[package]]
name = "tikv-jemalloc-sys"
version = "0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd3c60906412afa9c2b5b5a48ca6a5abe5736aec9eb48ad05037a677e52e4e2d"
source = "git+https://github.com/dpaoliello/jemallocator.git?branch=cat#b4d42b26db067cbced289fe71a6f69950b029ada"
dependencies = [
"cc",
"libc",
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@ codegen-units = 1

# If you want to use a crate with local modifications, you can set a path or git dependency here.
# For git dependencies, also add your source to ALLOWED_SOURCES in src/tools/tidy/src/extdeps.rs.
#[patch.crates-io]

[patch.crates-io]
tikv-jemalloc-sys = { git = 'https://github.com/dpaoliello/jemallocator.git', branch = 'cat' }
5 changes: 2 additions & 3 deletions compiler/rustc_codegen_ssa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_codegen_ssa/src/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -53,7 +53,7 @@ pub(crate) fn get_linker<'a>(
self_contained: bool,
target_cpu: &'a str,
) -> Box<dyn Linker + 'a> {
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
Expand Down Expand Up @@ -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));
Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions src/tools/tidy/src/deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/tools/tidy/src/extdeps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const ALLOWED_SOURCES: &[&str] = &[
r#""registry+https://github.com/rust-lang/crates.io-index""#,
// This is `rust_team_data` used by `site` in src/tools/rustc-perf,
r#""git+https://github.com/rust-lang/team#a5260e76d3aa894c64c56e6ddc8545b9a98043ec""#,
r#""git+https://github.com/dpaoliello/jemallocator.git?branch=cat#b4d42b26db067cbced289fe71a6f69950b029ada""#,
];

/// Checks for external package sources. `root` is the path to the directory that contains the
Expand Down
Loading