Skip to content
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
14 changes: 11 additions & 3 deletions src/cargo/ops/cargo_rustc/job_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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 => {
Expand Down
21 changes: 8 additions & 13 deletions tests/alt-registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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() {
Expand Down Expand Up @@ -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())));
}

Expand Down Expand Up @@ -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())));
}

Expand Down Expand Up @@ -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())));
}
Expand Down Expand Up @@ -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())));
Expand Down Expand Up @@ -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"))

Expand Down
2 changes: 1 addition & 1 deletion tests/bad-config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 [..]
"));
}
Expand Down
1 change: 1 addition & 0 deletions tests/cargotest/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,7 @@ fn substitute_macros(input: &str) -> String {
let macros = [
("[RUNNING]", " Running"),
("[COMPILING]", " Compiling"),
("[LINKING]", " Linking"),
("[CREATED]", " Created"),
("[FINISHED]", " Finished"),
("[ERROR]", "error:"),
Expand Down