diff --git a/src/cargo/ops/cargo_rustc/job_queue.rs b/src/cargo/ops/cargo_rustc/job_queue.rs index 281f057aba1..f34053735de 100644 --- a/src/cargo/ops/cargo_rustc/job_queue.rs +++ b/src/cargo/ops/cargo_rustc/job_queue.rs @@ -8,7 +8,7 @@ use std::sync::mpsc::{channel, Sender, Receiver}; use crossbeam::{self, Scope}; use jobserver::{Acquired, HelperThread}; -use core::{PackageId, Target, Profile}; +use core::{PackageId, Target, TargetKind, Profile}; use util::{Config, DependencyQueue, Fresh, Dirty, Freshness}; use util::{CargoResult, ProcessBuilder, profile, internal, CargoResultExt}; use {handle_error}; @@ -372,8 +372,16 @@ impl<'a> JobQueue<'a> { config.shell().status("Documenting", key.pkg)?; } } else { - self.compiled.insert(key.pkg); - config.shell().status("Compiling", key.pkg)?; + match *key.target.kind() { + TargetKind::Bin => { + config.shell().status("Linking", key.pkg.name())?; + }, + TargetKind::Lib(..) => { + self.compiled.insert(key.pkg); + config.shell().status("Compiling", key.pkg)?; + }, + _ => {} + } } } Fresh if self.counts[key.pkg] == 0 => { diff --git a/tests/alt-registry.rs b/tests/alt-registry.rs index 7d3f911557e..e8e6481f7e8 100644 --- a/tests/alt-registry.rs +++ b/tests/alt-registry.rs @@ -56,10 +56,9 @@ fn depend_on_alt_registry() { [UPDATING] registry `{reg}` [DOWNLOADING] bar v0.0.1 (registry `file://[..]`) [COMPILING] bar v0.0.1 (registry `file://[..]`) -[COMPILING] foo v0.0.1 ({dir}) +[LINKING] foo [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs ", - dir = p.url(), reg = registry::alt_registry()))); assert_that(p.cargo("clean").masquerade_as_nightly_cargo(), execs().with_status(0)); @@ -68,11 +67,10 @@ fn depend_on_alt_registry() { assert_that(p.cargo("build").masquerade_as_nightly_cargo(), execs().with_status(0).with_stderr(&format!("\ [COMPILING] bar v0.0.1 (registry `file://[..]`) -[COMPILING] foo v0.0.1 ({dir}) +[LINKING] foo [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs ", - dir = p.url()))); -} +)))} #[test] fn depend_on_alt_registry_depends_on_same_registry_no_index() { @@ -102,10 +100,9 @@ fn depend_on_alt_registry_depends_on_same_registry_no_index() { [DOWNLOADING] [..] v0.0.1 (registry `file://[..]`) [COMPILING] baz v0.0.1 (registry `file://[..]`) [COMPILING] bar v0.0.1 (registry `file://[..]`) -[COMPILING] foo v0.0.1 ({dir}) +[LINKING] foo [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs ", - dir = p.url(), reg = registry::alt_registry()))); } @@ -137,10 +134,9 @@ fn depend_on_alt_registry_depends_on_same_registry() { [DOWNLOADING] [..] v0.0.1 (registry `file://[..]`) [COMPILING] baz v0.0.1 (registry `file://[..]`) [COMPILING] bar v0.0.1 (registry `file://[..]`) -[COMPILING] foo v0.0.1 ({dir}) +[LINKING] foo [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs ", - dir = p.url(), reg = registry::alt_registry()))); } @@ -173,10 +169,9 @@ fn depend_on_alt_registry_depends_on_crates_io() { [DOWNLOADING] [..] v0.0.1 (registry `file://[..]`) [COMPILING] baz v0.0.1 (registry `file://[..]`) [COMPILING] bar v0.0.1 (registry `file://[..]`) -[COMPILING] foo v0.0.1 ({dir}) +[LINKING] foo [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs ", - dir = p.url(), alt_reg = registry::alt_registry(), reg = registry::registry()))); } @@ -212,7 +207,7 @@ fn registry_and_path_dep_works() { execs().with_status(0) .with_stderr(&format!("\ [COMPILING] bar v0.0.1 ({dir}/bar) -[COMPILING] foo v0.0.1 ({dir}) +[LINKING] foo [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs ", dir = p.url()))); @@ -336,7 +331,7 @@ fn alt_registry_and_crates_io_deps() { .with_stderr_contains("\ [COMPILING] crates_io_dep v0.0.1") .with_stderr_contains(&format!("\ -[COMPILING] foo v0.0.1 ({})", p.url())) +[LINKING] foo")) .with_stderr_contains("\ [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs")) diff --git a/tests/bad-config.rs b/tests/bad-config.rs index 87717578c2a..eed303ef660 100644 --- a/tests/bad-config.rs +++ b/tests/bad-config.rs @@ -741,7 +741,7 @@ The TOML spec requires newlines after table definitions (e.g. `[a] b = 1` is invalid), but this file has a table header which does not have a newline after it. A newline needs to be added and this warning will soon become a hard error in the future. -[COMPILING] empty_deps v0.0.0 ([..]) +[LINKING] empty_deps [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ")); } diff --git a/tests/cargotest/support/mod.rs b/tests/cargotest/support/mod.rs index 099e39d1892..7179333dce4 100644 --- a/tests/cargotest/support/mod.rs +++ b/tests/cargotest/support/mod.rs @@ -875,6 +875,7 @@ fn substitute_macros(input: &str) -> String { let macros = [ ("[RUNNING]", " Running"), ("[COMPILING]", " Compiling"), + ("[LINKING]", " Linking"), ("[CREATED]", " Created"), ("[FINISHED]", " Finished"), ("[ERROR]", "error:"),