Skip to content

Commit 83709ee

Browse files
committed
Auto merge of #159857 - weihanglo:update-cargo, r=ranger-ross
Update cargo submodule ## src/tools/cargo 23 commits in 3efb1f477e99b42974b982d939fd100303cdf7db..7c83d4cc0953b81d823e47d640c64da9b8bd4fac 2026-07-17 23:53:19 +0000 to 2026-07-29 21:34:53 +0000 - fix: Pass rustdoc flags to final CCI merge step (rust-lang/cargo#17269) - Reworked how we enable the new build-dir layout on nightly (rust-lang/cargo#17272) - Allow setting `-Zembed-metadata` value from the config (rust-lang/cargo#17266) - fix(cli): don't panic during completions when rustup is unavailable (rust-lang/cargo#17263) - docs(workspace): add recommended structure to members field (rust-lang/cargo#17166) - Update cargo-fetch.md to remove cargo-prefetch reference (rust-lang/cargo#16568) - chore: bump to `libgit2-sys@0.18.7+1.9.6` (rust-lang/cargo#17259) - Enable build-dir layout v2 on nightly by default (rust-lang/cargo#17258) - fix(path): clarify error message when path dependency has wrong package (rust-lang/cargo#16927) - fix(toml): warn on hyphenated lint names and duplicates (rust-lang/cargo#17051) - fix(test): gate trim-paths tests on split debuginfo support (rust-lang/cargo#17256) - test(git): Explicitly test for git injection attacks (rust-lang/cargo#17253) - fix(git): Suggest libgit2 if git-cli fails (rust-lang/cargo#17252) - fix(diag): bound transitive unused dependency traversal (rust-lang/cargo#17251) - fix(git): Hide git fetch output without progress (rust-lang/cargo#17243) - revert(lint): Remove `new_implicit_minimum_version_req` (rust-lang/cargo#16321) (rust-lang/cargo#17249) - fix: Add haiku's dylib path (rust-lang/cargo#17248) - Zsh completion: Add `-p` and `--package` flags for `cargo add` (rust-lang/cargo#17247) - refactor(source): Clarify the name of the remote git registry (rust-lang/cargo#17240) - fix(timings): only report units the job queue actually ran (rust-lang/cargo#17238) - Do not include proc-macro deps in rustc search path args (rust-lang/cargo#17236) - chore(deps): update cargo-semver-checks to v0.49.0 (rust-lang/cargo#17237) - rustdoc: rename the doc parts metadata params (rust-lang/cargo#17234) ## src/tools/rustc-perf 12 commits in 0508bdcd37152b28c39b6752828683cdd3f128b5..74ecbcdf88411937a6e39baf2779948565dfd388 2026-07-15 10:20:27 +0000 to 2026-07-27 15:02:48 +0000 - feat: support `@argfile` for rustc-fake (rust-lang/rustc-perf#2509) - Download Clippy when a Clippy profile is requested (rust-lang/rustc-perf#2508) - Add early check for missing rustdoc/clippy in a toolchain (rust-lang/rustc-perf#2507) - Add 2026-07-21 triage (rust-lang/rustc-perf#2506) - use stable extract_if: since 1.87 (rust-lang/rustc-perf#2191) - Update GitHub Actions (rust-lang/rustc-perf#2460) - Update dependency @types/msgpack-lite to v0.1.12 (rust-lang/rustc-perf#2439) - Add 30 day history link to artifact size tab on the compare page (rust-lang/rustc-perf#2505) - Fix selecting color for the bootstrap chart on the toolchain page (rust-lang/rustc-perf#2504) - Add artifact size history chart to toolchain page (rust-lang/rustc-perf#2501) - Parallel frontend compiler support (perf backend only) (rust-lang/rustc-perf#2491) - Run benchmark smoke test for all profiles on Windows on CI (rust-lang/rustc-perf#2503)
2 parents 1a833e1 + 84600e0 commit 83709ee

7 files changed

Lines changed: 55 additions & 30 deletions

File tree

src/tools/cargo

Submodule cargo updated 53 files

src/tools/cargotest/main.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,14 @@ fn run_cargo_test(
201201
command.args(filters);
202202

203203
let status = command
204+
// `xsv` locates binaries relative to `current_exe()`
205+
// which assumes Cargo legacy build-dir layout.
206+
//
207+
// See failure logs:
208+
// https://triage.rust-lang.org/gha-logs/rust-lang/rust/90658568103
209+
//
210+
// FIXME(weihanglo): replace xsv to something else with similar portfolio.
211+
.env("__CARGO_TEMPORARY_BUILD_DIR_NEW_LAYOUT_OPT_OUT", "1")
204212
// Disable rust-lang/cargo's cross-compile tests
205213
.env("CFG_DISABLE_CROSS_TESTS", "1")
206214
// Relax #![deny(warnings)] in some crates

src/tools/run-make-support/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ pub use crate::external_deps::rustdoc::{Rustdoc, bare_rustdoc, rustdoc};
8484
// Path-related helpers.
8585
pub use crate::path_helpers::{
8686
build_root, cwd, filename_contains, filename_not_in_denylist, has_extension, has_prefix,
87-
has_suffix, not_contains, path, shallow_find_directories, shallow_find_files, source_root,
87+
has_suffix, not_contains, path, recursive_find_files, shallow_find_directories,
88+
shallow_find_files, source_root,
8889
};
8990
// Convenience helpers for running binaries and other commands.
9091
pub use crate::run::{cmd, run, run_fail, run_with_args};

src/tools/run-make-support/src/path_helpers.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,30 @@ pub fn shallow_find_files<P: AsRef<Path>, F: Fn(&PathBuf) -> bool>(
5959
matching_files
6060
}
6161

62+
/// Browse the directory `path` recursively and return all files which respect the parameters
63+
/// outlined by `closure`.
64+
#[track_caller]
65+
pub fn recursive_find_files<P: AsRef<Path>, F: Fn(&PathBuf) -> bool>(
66+
path: P,
67+
filter: F,
68+
) -> Vec<PathBuf> {
69+
let mut matching_files = Vec::new();
70+
let mut stack = vec![path.as_ref().to_path_buf()];
71+
while let Some(dir) = stack.pop() {
72+
for entry in rfs::read_dir(dir) {
73+
let entry = entry.expect("failed to read directory entry.");
74+
let path = entry.path();
75+
76+
if path.is_dir() {
77+
stack.push(path);
78+
} else if path.is_file() && filter(&path) {
79+
matching_files.push(path);
80+
}
81+
}
82+
}
83+
matching_files
84+
}
85+
6286
/// Browse the directory `path` non-recursively and return all directories which respect the
6387
/// parameters outlined by `closure`.
6488
#[track_caller]

src/tools/rustc-perf

Submodule rustc-perf updated 50 files

tests/run-make-cargo/compiler-builtins/rmake.rs

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use std::collections::HashSet;
1919
use run_make_support::object::read::Object;
2020
use run_make_support::object::read::archive::ArchiveFile;
2121
use run_make_support::object::{ObjectSection, ObjectSymbol, RelocationTarget};
22-
use run_make_support::rfs::{read, read_dir};
23-
use run_make_support::{cargo, object, path, target};
22+
use run_make_support::rfs::read;
23+
use run_make_support::{cargo, object, path, recursive_find_files, target};
2424

2525
fn main() {
2626
let target_dir = path("target");
@@ -44,18 +44,14 @@ fn main() {
4444
.env("LIB", std::env::var("LIB").unwrap_or_default())
4545
.run();
4646

47-
let rlibs_path = target_dir.join(target()).join("debug").join("deps");
48-
let compiler_builtins_rlib = read_dir(rlibs_path)
49-
.find_map(|e| {
50-
let path = e.unwrap().path();
51-
let file_name = path.file_name().unwrap().to_str().unwrap();
52-
if file_name.starts_with("libcompiler_builtins") && file_name.ends_with(".rlib") {
53-
Some(path)
54-
} else {
55-
None
56-
}
57-
})
58-
.unwrap();
47+
// The rlib file is emitted as an intermediate build artifacts.
48+
// Do not hardcode the path.
49+
let mut rlibs = recursive_find_files(&target_dir.join(target()).join("debug"), |path| {
50+
let file_name = path.file_name().unwrap().to_str().unwrap();
51+
file_name.starts_with("libcompiler_builtins") && file_name.ends_with(".rlib")
52+
});
53+
assert_eq!(rlibs.len(), 1, "expected exactly one compiler_builtins rlib: {rlibs:?}");
54+
let compiler_builtins_rlib = rlibs.pop().unwrap();
5955

6056
// rlib files are archives, where the archive members each a CGU, and we also have one called
6157
// lib.rmeta which is the encoded metadata. Each of the CGUs is an object file.

tests/run-make-cargo/panic-immediate-abort-codegen/rmake.rs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#![deny(warnings)]
77

8-
use run_make_support::{cargo, llvm_filecheck, path, rfs, target};
8+
use run_make_support::{cargo, llvm_filecheck, path, recursive_find_files, target};
99

1010
fn main() {
1111
let target_dir = path("target");
@@ -29,18 +29,14 @@ fn main() {
2929
.env("LIB", std::env::var("LIB").unwrap_or_default())
3030
.run();
3131

32-
let out_dir = target_dir.join(target()).join("release").join("deps");
33-
let ir_file = rfs::read_dir(out_dir)
34-
.find_map(|e| {
35-
let path = e.unwrap().path();
36-
let file_name = path.file_name().unwrap().to_str().unwrap();
37-
if file_name.starts_with("panic_scenarios") && file_name.ends_with(".ll") {
38-
Some(path)
39-
} else {
40-
None
41-
}
42-
})
43-
.unwrap();
32+
// The .ll file is emitted as an intermediate build artifacts.
33+
// Do not hardcode the path.
34+
let mut ir_files = recursive_find_files(&target_dir.join(target()).join("release"), |path| {
35+
let file_name = path.file_name().unwrap().to_str().unwrap();
36+
file_name.starts_with("panic_scenarios") && file_name.ends_with(".ll")
37+
});
38+
assert_eq!(ir_files.len(), 1, "expected exactly one .ll file: {ir_files:?}");
39+
let ir_file = ir_files.pop().unwrap();
4440

4541
llvm_filecheck().patterns("lib.rs").input_file(ir_file).run();
4642
}

0 commit comments

Comments
 (0)