Skip to content

Commit

Permalink
Auto merge of #2501 - ryanq:issue2266, r=alexcrichton
Browse files Browse the repository at this point in the history
Check local targets before resolving dependencies

A call to `generate_targets(...)` before calling `resolve_dependencies()`
catches invalid target names before fetching the source for the
dependencies.

Closes #2266
  • Loading branch information
bors committed Apr 20, 2016
2 parents d99a7eb + 10ee610 commit fa9d601
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cargo/ops/cargo_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ pub fn compile_pkg<'a>(root_package: &Package,
bail!("jobs must be at least 1")
}

let profiles = root_package.manifest().profiles();
if spec.len() == 0 {
try!(generate_targets(root_package, profiles, mode, filter, release));
}

let (packages, resolve_with_overrides) = {
try!(resolve_dependencies(root_package, config, source, features,
no_default_features))
Expand Down Expand Up @@ -186,7 +191,6 @@ pub fn compile_pkg<'a>(root_package: &Package,
let mut general_targets = Vec::new();
let mut package_targets = Vec::new();

let profiles = root_package.manifest().profiles();
match (*target_rustc_args, *target_rustdoc_args) {
(Some(..), _) |
(_, Some(..)) if to_builds.len() != 1 => {
Expand Down

0 comments on commit fa9d601

Please sign in to comment.