Skip to content

Commit

Permalink
Add more instructions to error message
Browse files Browse the repository at this point in the history
  • Loading branch information
gferon committed May 29, 2018
1 parent e31f3c3 commit 53480ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/cargo/ops/cargo_package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,9 @@ fn run_verify(ws: &Workspace, tar: &FileLock, opts: &PackageOpts) -> CargoResult
bail!(
"Source directory was modified by build.rs during cargo publish. \
Build scripts should not modify anything outside of OUT_DIR. \
Modified file: {}",
path.display()
Modified file: {}\n\n\
To proceed despite this, pass the `--no-verify` flag.",
path.display()
)
}

Expand Down
12 changes: 11 additions & 1 deletion tests/testsuite/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,17 @@ fn do_not_package_if_src_was_modified() {

assert_that(
p.cargo("package"),
execs().with_status(101),
execs().with_status(101)
.with_stderr_contains(
"\
error: failed to verify package tarball
Caused by:
Source directory was modified by build.rs during cargo publish. \
Build scripts should not modify anything outside of OUT_DIR. Modified file: [..]src/generated.txt
To proceed despite this, pass the `--no-verify` flag.",
),
);

assert_that(
Expand Down

0 comments on commit 53480ac

Please sign in to comment.