Skip to content
Open
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
4 changes: 3 additions & 1 deletion src/cargo/core/compiler/job_queue/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -844,8 +844,10 @@ impl<'gctx> DrainState<'gctx> {
let profile_link = build_runner.bcx.gctx.shell().err_hyperlink(
"https://doc.rust-lang.org/cargo/reference/profiles.html#default-profiles",
);
let target_count = self.counts.len();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong as it counted every package in the dependency graph, not just selected local packages.

This change ensures that the finished message correctly uses "target" or "targets"
based on the number of targets built, improving clarity in multi-target builds.

However, maybe the question should be asked like: What do we really want to count here? What does target(s) mean here really?

let message = format!(
"{profile_link}`{profile_name}` profile [{opt_type}]{profile_link:#} target(s) in {time_elapsed}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message is emitted in every build command, and changing this failed 960 tests. To fix them we then need to update snapshots in those 960 tests. I am not sure if it is worthy.

"{profile_link}`{profile_name}` profile [{opt_type}]{profile_link:#} target{} in {time_elapsed}",
(target_count == 1).then(|| "").unwrap_or("s")
);
if !build_runner.bcx.build_config.build_plan {
// It doesn't really matter if this fails.
Expand Down
Loading