Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert #13422 #13876

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 2 additions & 6 deletions src/cargo/core/compiler/job_queue/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -826,12 +826,8 @@ impl<'gctx> DrainState<'gctx> {
// `display_error` inside `handle_error`.
Some(anyhow::Error::new(AlreadyPrintedError::new(error)))
} else if self.queue.is_empty() && self.pending_queue.is_empty() {
let profile_link = build_runner.bcx.gctx.shell().err_hyperlink(
"https://doc.rust-lang.org/cargo/reference/profiles.html#default-profiles",
);
let message = format!(
"{profile_link}`{profile_name}` profile [{opt_type}]{profile_link:#} target(s) in {time_elapsed}",
);
let message =
format!("`{profile_name}` profile [{opt_type}] target(s) in {time_elapsed}",);
if !build_runner.bcx.build_config.build_plan {
// It doesn't really matter if this fails.
let _ = build_runner.bcx.gctx.shell().status("Finished", message);
Expand Down
4 changes: 2 additions & 2 deletions tests/build-std/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn basic() {
// There have been multiple bugs where every build triggers and update.
.with_stderr(
"[COMPILING] foo v0.0.1 [..]\n\
[FINISHED] `dev` profile [..]",
[FINISHED] dev [..]",
)
.run();
p.cargo("run").build_std().target_host().run();
Expand Down Expand Up @@ -262,7 +262,7 @@ fn remap_path_scope() {
.with_status(101)
.with_stderr_contains(
"\
[FINISHED] `release` profile [optimized + debuginfo] [..]
[FINISHED] release [optimized + debuginfo] [..]
[RUNNING] [..]
[..]thread '[..]' panicked at [..]src/main.rs:3:[..]",
)
Expand Down
20 changes: 10 additions & 10 deletions tests/testsuite/alt_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fn depend_on_alt_registry() {
[DOWNLOADED] bar v0.0.1 (registry `alternative`)
[CHECKING] bar v0.0.1 (registry `alternative`)
[CHECKING] foo v0.0.1 ([CWD])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s
",
)
.run();
Expand All @@ -51,7 +51,7 @@ fn depend_on_alt_registry() {
"\
[CHECKING] bar v0.0.1 (registry `alternative`)
[CHECKING] foo v0.0.1 ([CWD])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s
",
)
.run();
Expand Down Expand Up @@ -95,7 +95,7 @@ fn depend_on_alt_registry_depends_on_same_registry_no_index() {
[CHECKING] baz v0.0.1 (registry `alternative`)
[CHECKING] bar v0.0.1 (registry `alternative`)
[CHECKING] foo v0.0.1 ([CWD])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s
",
)
.run();
Expand Down Expand Up @@ -139,7 +139,7 @@ fn depend_on_alt_registry_depends_on_same_registry() {
[CHECKING] baz v0.0.1 (registry `alternative`)
[CHECKING] bar v0.0.1 (registry `alternative`)
[CHECKING] foo v0.0.1 ([CWD])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s
",
)
.run();
Expand Down Expand Up @@ -184,7 +184,7 @@ fn depend_on_alt_registry_depends_on_crates_io() {
[CHECKING] baz v0.0.1
[CHECKING] bar v0.0.1 (registry `alternative`)
[CHECKING] foo v0.0.1 ([CWD])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s
",
)
.run();
Expand Down Expand Up @@ -220,7 +220,7 @@ fn registry_and_path_dep_works() {
[LOCKING] 2 packages to latest compatible versions
[CHECKING] bar v0.0.1 ([CWD]/bar)
[CHECKING] foo v0.0.1 ([CWD])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s
",
)
.run();
Expand Down Expand Up @@ -428,7 +428,7 @@ fn alt_registry_and_crates_io_deps() {
[CHECKING] alt_reg_dep v0.1.0 (registry `alternative`)
[CHECKING] crates_io_dep v0.0.1
[CHECKING] foo v0.0.1 ([CWD])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s
",
)
.run();
Expand Down Expand Up @@ -701,7 +701,7 @@ fn patch_alt_reg() {
[LOCKING] 2 packages to latest compatible versions
[CHECKING] bar v0.1.0 ([CWD]/bar)
[CHECKING] foo v0.0.1 ([CWD])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
)
.run();
Expand Down Expand Up @@ -796,7 +796,7 @@ fn no_api() {
[DOWNLOADED] bar v0.0.1 (registry `alternative`)
[CHECKING] bar v0.0.1 (registry `alternative`)
[CHECKING] foo v0.0.1 ([CWD])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s
",
)
.run();
Expand Down Expand Up @@ -1359,7 +1359,7 @@ fn registries_index_relative_url() {
[DOWNLOADED] bar v0.0.1 (registry `relative`)
[CHECKING] bar v0.0.1 (registry `relative`)
[CHECKING] foo v0.0.1 ([CWD])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s
",
)
.run();
Expand Down
8 changes: 4 additions & 4 deletions tests/testsuite/bad_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ fn unused_keys() {
"\
warning: unused manifest key: target.foo.bar
[CHECKING] foo v0.1.0 ([CWD])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
)
.run();
Expand All @@ -711,7 +711,7 @@ warning: unused manifest key: target.foo.bar
"\
warning: unused manifest key: package.bulid
[CHECKING] foo [..]
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
)
.run();
Expand Down Expand Up @@ -739,7 +739,7 @@ warning: unused manifest key: package.bulid
"\
warning: unused manifest key: lib.build
[CHECKING] foo [..]
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
)
.run();
Expand All @@ -764,7 +764,7 @@ fn unused_keys_in_virtual_manifest() {
"\
[WARNING] [..]/foo/Cargo.toml: unused manifest key: workspace.bulid
[CHECKING] bar [..]
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
)
.run();
Expand Down
52 changes: 26 additions & 26 deletions tests/testsuite/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn cargo_bench_simple() {
.with_stderr(
"\
[COMPILING] foo v0.5.0 ([CWD])
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] [..] (target/release/deps/foo-[..][EXE])",
)
.with_stdout_contains("test bench_hello ... bench: [..]")
Expand Down Expand Up @@ -81,7 +81,7 @@ fn bench_bench_implicit() {
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] [..] (target/release/deps/foo-[..][EXE])
[RUNNING] [..] (target/release/deps/mybench-[..][EXE])
",
Expand Down Expand Up @@ -125,7 +125,7 @@ fn bench_bin_implicit() {
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] [..] (target/release/deps/foo-[..][EXE])
",
)
Expand Down Expand Up @@ -158,7 +158,7 @@ fn bench_tarname() {
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] [..] (target/release/deps/bin2-[..][EXE])
",
)
Expand Down Expand Up @@ -223,7 +223,7 @@ fn cargo_bench_verbose() {
"\
[COMPILING] foo v0.5.0 ([CWD])
[RUNNING] `rustc [..] src/main.rs [..]`
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] `[..]target/release/deps/foo-[..][EXE] hello --bench`",
)
.with_stdout_contains("test bench_hello ... bench: [..]")
Expand Down Expand Up @@ -310,7 +310,7 @@ fn cargo_bench_failing_test() {
.with_stderr_contains(
"\
[COMPILING] foo v0.5.0 ([CWD])[..]
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] [..] (target/release/deps/foo-[..][EXE])",
)
.with_stdout_contains("[..]thread '[..]' panicked at[..]")
Expand Down Expand Up @@ -378,7 +378,7 @@ fn bench_with_lib_dep() {
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] [..] (target/release/deps/foo-[..][EXE])
[RUNNING] [..] (target/release/deps/baz-[..][EXE])",
)
Expand Down Expand Up @@ -441,7 +441,7 @@ fn bench_with_deep_lib_dep() {
[LOCKING] 2 packages to latest compatible versions
[COMPILING] foo v0.0.1 ([..])
[COMPILING] bar v0.0.1 ([CWD])
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] [..] (target/release/deps/bar-[..][EXE])",
)
.with_stdout_contains("test bar_bench ... bench: [..]")
Expand Down Expand Up @@ -495,7 +495,7 @@ fn external_bench_explicit() {
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] [..] (target/release/deps/foo-[..][EXE])
[RUNNING] [..] (target/release/deps/bench-[..][EXE])",
)
Expand Down Expand Up @@ -538,7 +538,7 @@ fn external_bench_implicit() {
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] [..] (target/release/deps/foo-[..][EXE])
[RUNNING] [..] (target/release/deps/external-[..][EXE])",
)
Expand Down Expand Up @@ -613,7 +613,7 @@ automatically infer them to be a target, such as in subfolders.
For more information on this warning you can consult
https://github.com/rust-lang/cargo/issues/5330
[COMPILING] foo v0.0.1 ([CWD])
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] [..] (target/release/deps/foo-[..][EXE])
",
)
Expand Down Expand Up @@ -652,15 +652,15 @@ fn pass_through_command_line() {
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] [..] (target/release/deps/foo-[..][EXE])",
)
.with_stdout_contains("test bar ... bench: [..]")
.run();

p.cargo("bench foo")
.with_stderr(
"[FINISHED] `bench` profile [optimized] target(s) in [..]
"[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] [..] (target/release/deps/foo-[..][EXE])",
)
.with_stdout_contains("test foo ... bench: [..]")
Expand Down Expand Up @@ -738,7 +738,7 @@ fn lib_bin_same_name() {
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] [..] (target/release/deps/foo-[..][EXE])
[RUNNING] [..] (target/release/deps/foo-[..][EXE])",
)
Expand Down Expand Up @@ -783,7 +783,7 @@ fn lib_with_standard_name() {
.with_stderr(
"\
[COMPILING] syntax v0.0.1 ([CWD])
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] [..] (target/release/deps/syntax-[..][EXE])
[RUNNING] [..] (target/release/deps/bench-[..][EXE])",
)
Expand Down Expand Up @@ -832,7 +832,7 @@ fn lib_with_standard_name2() {
.with_stderr(
"\
[COMPILING] syntax v0.0.1 ([CWD])
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] [..] (target/release/deps/syntax-[..][EXE])",
)
.with_stdout_contains("test bench ... bench: [..]")
Expand Down Expand Up @@ -911,7 +911,7 @@ fn bench_dylib() {
[RUNNING] [..] -C opt-level=3 [..]
[RUNNING] [..] -C opt-level=3 [..]
[RUNNING] [..] -C opt-level=3 [..]
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] `[..]target/release/deps/foo-[..][EXE] --bench`
[RUNNING] `[..]target/release/deps/bench-[..][EXE] --bench`",
)
Expand All @@ -924,7 +924,7 @@ fn bench_dylib() {
"\
[FRESH] bar v0.0.1 ([CWD]/bar)
[FRESH] foo v0.0.1 ([CWD])
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] `[..]target/release/deps/foo-[..][EXE] --bench`
[RUNNING] `[..]target/release/deps/bench-[..][EXE] --bench`",
)
Expand Down Expand Up @@ -963,15 +963,15 @@ fn bench_twice_with_build_cmd() {
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] [..] (target/release/deps/foo-[..][EXE])",
)
.with_stdout_contains("test foo ... bench: [..]")
.run();

p.cargo("bench")
.with_stderr(
"[FINISHED] `bench` profile [optimized] target(s) in [..]
"[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] [..] (target/release/deps/foo-[..][EXE])",
)
.with_stdout_contains("test foo ... bench: [..]")
Expand Down Expand Up @@ -1053,7 +1053,7 @@ fn bench_with_examples() {
[RUNNING] `rustc [..]`
[RUNNING] `rustc [..]`
[RUNNING] `rustc [..]`
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] `[CWD]/target/release/deps/foo-[..][EXE] --bench`
[RUNNING] `[CWD]/target/release/deps/testb1-[..][EXE] --bench`",
)
Expand Down Expand Up @@ -1092,7 +1092,7 @@ fn test_a_bench() {
.with_stderr(
"\
[COMPILING] foo v0.1.0 ([..])
[FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [..]
[FINISHED] test [unoptimized + debuginfo] target(s) in [..]
[RUNNING] [..] (target/debug/deps/b-[..][EXE])",
)
.with_stdout_contains("test foo ... ok")
Expand Down Expand Up @@ -1122,7 +1122,7 @@ fn test_bench_no_run() {
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([..])
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[EXECUTABLE] benches src/lib.rs (target/release/deps/foo-[..][EXE])
[EXECUTABLE] benches/bbaz.rs (target/release/deps/bbaz-[..][EXE])
",
Expand Down Expand Up @@ -1153,7 +1153,7 @@ fn test_bench_no_run_emit_json() {
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([..])
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
",
)
.run();
Expand Down Expand Up @@ -1204,7 +1204,7 @@ fn test_bench_no_fail_fast() {
.with_stderr(
"\
[COMPILING] foo v0.5.0 [..]
[FINISHED] `bench` profile [..]
[FINISHED] bench [..]
[RUNNING] unittests src/main.rs (target/release/deps/foo[..])
[ERROR] bench failed, to rerun pass `--bin foo`
[RUNNING] benches/b1.rs (target/release/deps/b1[..])
Expand Down Expand Up @@ -1721,7 +1721,7 @@ fn cargo_bench_print_env_verbose() {
"\
[COMPILING] foo v0.0.1 ([CWD])
[RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] rustc[..]`
[FINISHED] `bench` profile [optimized] target(s) in [..]
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] [CWD]/target/release/deps/foo-[..][EXE] --bench`",
)
.run();
Expand Down
Loading
Loading