Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bend-n committed May 7, 2024
1 parent fdeea3d commit 6f05bfb
Show file tree
Hide file tree
Showing 66 changed files with 1,090 additions and 736 deletions.
17 changes: 17 additions & 0 deletions src/cargo/core/compiler/job_queue/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -826,13 +826,30 @@ 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() {
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
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}",
);
if !build_runner.bcx.build_config.build_plan {
=======
let message =
format!("`{profile_name}` profile [{opt_type}] target(s) in {time_elapsed}",);
=======
let message = format!("{profile_name} [{opt_type}] target(s) in {time_elapsed}",);
>>>>>>> parent of e7e8d8748 (fix(compiler): Clarify we're showing a profile name)
=======
let message = format!(
"{} [{}] target(s) in {}",
profile_name, opt_type, time_elapsed
);
>>>>>>> parent of 1906d27cf (refactor(compiler): Use inline string interpolation)
if !cx.bcx.build_config.build_plan {
>>>>>>> parent of 69f38a08d (fix(compiler): Link people to more info about profiles)
// It doesn't really matter if this fails.
let _ = build_runner.bcx.gctx.shell().status("Finished", message);
future_incompat::save_and_display_report(
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
53 changes: 27 additions & 26 deletions tests/testsuite/artifact_dep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ fn features_are_unified_among_lib_and_bin_dep_of_same_target() {
[COMPILING] d2 v0.0.1 ([CWD]/d2)
[COMPILING] d1 v0.0.1 ([CWD]/d1)
[COMPILING] 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 @@ -587,9 +587,7 @@ fn build_script_with_bin_artifacts() {
.masquerade_as_nightly_cargo(&["bindeps"])
.with_stderr_contains("[COMPILING] foo [..]")
.with_stderr_contains("[COMPILING] bar v0.5.0 ([CWD]/bar)")
.with_stderr_contains(
"[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]",
)
.with_stderr_contains("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]")
.run();

let build_script_output = build_script_output_string(&p, "foo");
Expand Down Expand Up @@ -778,7 +776,7 @@ fn build_script_with_selected_dashed_bin_artifact_and_lib_true() {
[LOCKING] 2 packages to latest compatible versions
[COMPILING] bar-baz v0.5.0 ([CWD]/bar)
[COMPILING] foo [..]
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]",
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]",
)
.run();

Expand Down Expand Up @@ -880,7 +878,7 @@ fn lib_with_selected_dashed_bin_artifact_and_lib_true() {
[LOCKING] 2 packages to latest compatible versions
[COMPILING] bar-baz v0.5.0 ([CWD]/bar)
[COMPILING] foo [..]
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]",
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]",
)
.run();

Expand Down Expand Up @@ -927,9 +925,7 @@ fn allow_artifact_and_no_artifact_dep_to_same_package_within_different_dep_categ
p.cargo("test -Z bindeps")
.masquerade_as_nightly_cargo(&["bindeps"])
.with_stderr_contains("[COMPILING] bar v0.5.0 ([CWD]/bar)")
.with_stderr_contains(
"[FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [..]",
)
.with_stderr_contains("[FINISHED] test [unoptimized + debuginfo] target(s) in [..]")
.run();
}

Expand Down Expand Up @@ -1277,7 +1273,7 @@ fn no_cross_doctests_works_with_artifacts() {
[LOCKING] 2 packages to latest compatible versions
[COMPILING] bar v0.5.0 ([CWD]/bar)
[COMPILING] foo v0.0.1 ([CWD])
[FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [..]
[FINISHED] test [unoptimized + debuginfo] target(s) in [..]
[RUNNING] [..] (target/{triple}/debug/deps/foo-[..][EXE])
[DOCTEST] foo
",
Expand All @@ -1299,7 +1295,7 @@ fn no_cross_doctests_works_with_artifacts() {
[RUNNING] `rustc --crate-name bar --edition=2015 bar/src/main.rs [..]--target {triple} [..]
[COMPILING] foo v0.0.1 ([CWD])
[RUNNING] `rustc --crate-name foo [..]
[FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [..]",
[FINISHED] test [unoptimized + debuginfo] target(s) in [..]",
triple = target
))
.run();
Expand All @@ -1316,7 +1312,7 @@ fn no_cross_doctests_works_with_artifacts() {
"[FRESH] bar v0.5.0 ([CWD]/bar)
[COMPILING] foo v0.0.1 ([CWD])
[RUNNING] `rustc --crate-name foo [..]--test[..]
[FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [..]
[FINISHED] test [unoptimized + debuginfo] target(s) in [..]
[RUNNING] `[CWD]/target/{triple}/debug/deps/foo-[..][EXE]`",
triple = target
))
Expand Down Expand Up @@ -1810,7 +1806,7 @@ fn allow_artifact_and_non_artifact_dependency_to_same_crate_if_these_are_not_the
[LOCKING] 2 packages to latest compatible versions
[COMPILING] bar [..]
[COMPILING] foo [..]
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
)
.run();
Expand Down Expand Up @@ -1847,7 +1843,7 @@ fn prevent_no_lib_warning_with_artifact_dependencies() {
[LOCKING] 2 packages to latest compatible versions\n\
[COMPILING] bar v0.5.0 ([CWD]/bar)\n\
[CHECKING] foo v0.0.0 ([CWD])\n\
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]",
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]",
)
.run();
}
Expand Down Expand Up @@ -1882,7 +1878,7 @@ fn show_no_lib_warning_with_artifact_dependencies_that_have_no_lib_but_lib_true(
.with_stderr_contains("[WARNING] foo v0.0.0 ([CWD]) ignoring invalid dependency `bar` which is missing a lib target")
.with_stderr_contains("[COMPILING] bar v0.5.0 ([CWD]/bar)")
.with_stderr_contains("[CHECKING] foo [..]")
.with_stderr_contains("[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]")
.with_stderr_contains("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]")
.run();
}

Expand Down Expand Up @@ -2095,7 +2091,7 @@ fn env_vars_and_build_products_for_various_build_targets() {
[LOCKING] 2 packages to latest compatible versions
[COMPILING] bar [..]
[COMPILING] foo [..]
[FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [..]
[FINISHED] test [unoptimized + debuginfo] target(s) in [..]
[RUNNING] unittests [..]
[RUNNING] tests/main.rs [..]
[DOCTEST] foo
Expand Down Expand Up @@ -2283,7 +2279,7 @@ fn doc_lib_true() {
[COMPILING] bar v0.0.1 ([CWD]/bar)
[DOCUMENTING] bar v0.0.1 ([CWD]/bar)
[DOCUMENTING] foo v0.0.1 ([CWD])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
[GENERATED] [CWD]/target/doc/foo/index.html
",
)
Expand Down Expand Up @@ -2365,7 +2361,7 @@ fn rustdoc_works_on_libs_with_artifacts_and_lib_false() {
[LOCKING] 2 packages to latest compatible versions
[COMPILING] bar v0.5.0 ([CWD]/bar)
[DOCUMENTING] foo v0.0.1 ([CWD])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
[GENERATED] [CWD]/target/doc/foo/index.html
",
)
Expand Down Expand Up @@ -2573,7 +2569,7 @@ fn calc_bin_artifact_fingerprint() {
[LOCKING] 2 packages to latest compatible versions
[COMPILING] bar v0.5.0 ([CWD]/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 @@ -2590,7 +2586,7 @@ fn calc_bin_artifact_fingerprint() {
[DIRTY] foo v0.1.0 ([CWD]): the dependency bar was rebuilt
[CHECKING] foo v0.1.0 ([CWD])
[RUNNING] `rustc --crate-name foo [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
)
.run();
Expand All @@ -2602,7 +2598,7 @@ fn calc_bin_artifact_fingerprint() {
"\
[FRESH] bar v0.5.0 ([CWD]/bar)
[FRESH] foo v0.1.0 ([CWD])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
)
.run();
Expand Down Expand Up @@ -2657,7 +2653,7 @@ fn with_target_and_optional() {
[RUNNING] `rustc --crate-name d1 [..]--crate-type bin[..]
[CHECKING] foo v0.0.1 [..]
[RUNNING] `rustc --crate-name foo [..]--cfg[..]d1[..]
[FINISHED] `dev` profile [..]
[FINISHED] dev [..]
",
)
.run();
Expand Down Expand Up @@ -2708,8 +2704,13 @@ fn with_assumed_host_target_and_optional_build_dep() {
[RUNNING] `rustc --crate-name build_script_build --edition=2021 [..]--crate-type bin[..]
[RUNNING] `rustc --crate-name d1 --edition=2021 [..]--crate-type bin[..]
[RUNNING] `[CWD]/target/debug/build/foo-[..]/build-script-build`
<<<<<<< HEAD
[RUNNING] `rustc --crate-name foo --edition=2021 [..]--cfg[..]d1[..]
[FINISHED] `dev` profile [..]
=======
[RUNNING] `rustc --crate-name foo [..]--cfg[..]d1[..]
[FINISHED] dev [..]
>>>>>>> parent of e7e8d8748 (fix(compiler): Clarify we're showing a profile name)
",
)
.run();
Expand Down Expand Up @@ -2836,7 +2837,7 @@ fn decouple_same_target_transitive_dep_from_artifact_dep() {
[COMPILING] a v0.1.0 ([CWD]/a)
[COMPILING] bar v0.1.0 ([CWD]/bar)
[COMPILING] foo v0.1.0 ([CWD])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
)
.run();
Expand Down Expand Up @@ -2939,7 +2940,7 @@ fn decouple_same_target_transitive_dep_from_artifact_dep_lib() {
[COMPILING] a v0.1.0 ([CWD]/a)
[COMPILING] bar v0.1.0 ([CWD]/bar)
[COMPILING] foo v0.1.0 ([CWD])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
)
.run();
Expand Down Expand Up @@ -3068,7 +3069,7 @@ fn decouple_same_target_transitive_dep_from_artifact_dep_and_proc_macro() {
[COMPILING] c v0.1.0 ([CWD]/c)
[COMPILING] bar v0.1.0 ([CWD]/bar)
[COMPILING] foo v0.1.0 ([CWD])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
)
.run();
Expand Down Expand Up @@ -3131,7 +3132,7 @@ fn same_target_artifact_dep_sharing() {
[COMPILING] a v0.1.0 ([CWD]/a)
[COMPILING] bar v0.1.0 ([CWD]/bar)
[COMPILING] foo v0.1.0 ([CWD])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
)
.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
Loading

0 comments on commit 6f05bfb

Please sign in to comment.