Skip to content

Commit

Permalink
Auto merge of #2962 - alexcrichton:demote-error, r=brson
Browse files Browse the repository at this point in the history
Demote duplicate build target error to a warning

Added in #2847 this ended up unfortunately breaking the `regex` crate on
nightly, so let's just issue a warning for awhile first. Eventually we can
promote this to an error if it becomes a problem.
  • Loading branch information
bors authored Aug 5, 2016
2 parents dc90d15 + c261964 commit 4e66190
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/cargo/util/toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,8 @@ impl TomlManifest {
}

if let Err(e) = unique_build_targets(&targets, layout) {
bail!("duplicate build target found: `{}`", e);
warnings.push(format!("file found to be present in multiple \
build targets: {}", e));
}

let mut deps = Vec::new();
Expand Down
17 changes: 7 additions & 10 deletions tests/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,18 @@ fn cargo_compile_duplicate_build_targets() {
[dependencies]
"#)
.file("src/main.rs", r#"
#![allow(warnings)]
fn main() {}
"#);

let error_message = format!("\
[ERROR] failed to parse manifest at `[..]`
Caused by:
duplicate build target found: `{}`",
p.root().join("src[..]main.rs").display());

assert_that(p.cargo_process("build"),
execs()
.with_status(101)
.with_stderr(error_message)
)
.with_status(0)
.with_stderr("\
warning: file found to be present in multiple build targets: [..]main.rs
[COMPILING] foo v0.0.1 ([..])
[FINISHED] [..]
"));
}

#[test]
Expand Down

0 comments on commit 4e66190

Please sign in to comment.