Skip to content

Commit

Permalink
Add additional info on a new line
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusGrass committed Jun 5, 2023
1 parent 073a32b commit 03675ef
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/cargo/ops/cargo_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ impl<'cfg, 'a> InstallablePackage<'cfg, 'a> {

format!(
"failed to compile `{}`, intermediate artifacts can be \
found at `{}`, to reuse those artifacts with a future \
found at `{}`.\nTo reuse those artifacts with a future \
compilation, set the environment variable \
`CARGO_TARGET_DIR` to that path.",
self.pkg,
Expand Down
8 changes: 5 additions & 3 deletions tests/testsuite/directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ fn simple_install_fail() {
.with_status(101)
.with_stderr(
" Installing bar v0.1.0
error: failed to compile `bar v0.1.0`, intermediate artifacts can be found at `[..]`, \
to reuse those artifacts with a future compilation, set the environment variable \
error: failed to compile `bar v0.1.0`, intermediate artifacts can be found at `[..]`.
To reuse those artifacts with a future compilation, set the environment variable \
`CARGO_TARGET_DIR` to that path.
Caused by:
Expand Down Expand Up @@ -761,7 +761,9 @@ fn version_missing() {
.with_stderr(
"\
[INSTALLING] bar v0.1.0
error: failed to compile [..]
error: failed to compile [..], intermediate artifacts can be found at `[..]`.
To reuse those artifacts with a future compilation, set the environment variable \
`CARGO_TARGET_DIR` to that path.
Caused by:
failed to select a version for the requirement `foo = \"^2\"`
Expand Down
6 changes: 3 additions & 3 deletions tests/testsuite/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ fn compile_failure() {
"\
[ERROR] could not compile `foo` (bin \"foo\") due to previous error
[ERROR] failed to compile `foo v0.0.1 ([..])`, intermediate artifacts can be \
found at `[..]target`, to reuse those artifacts with a future compilation, \
found at `[..]target`.\nTo reuse those artifacts with a future compilation, \
set the environment variable `CARGO_TARGET_DIR` to that path.
",
)
Expand Down Expand Up @@ -2266,7 +2266,7 @@ fn failed_install_retains_temp_directory() {
.unwrap();
compare::match_contains(
"error: failed to compile `foo v0.0.1`, intermediate artifacts can be found at \
`[..]`, to reuse those artifacts with a future compilation, set the environment \
`[..]`.\nTo reuse those artifacts with a future compilation, set the environment \
variable `CARGO_TARGET_DIR` to that path.",
&stderr,
None,
Expand All @@ -2275,7 +2275,7 @@ fn failed_install_retains_temp_directory() {

// Find the path in the output.
let start = stderr.find("found at `").unwrap() + 10;
let end = stderr[start..].find(',').unwrap() - 1;
let end = stderr[start..].find('.').unwrap() - 1;
let path = Path::new(&stderr[start..(end + start)]);
assert!(path.exists());
assert!(path.join("release/deps").exists());
Expand Down
7 changes: 4 additions & 3 deletions tests/testsuite/required_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,9 @@ Consider enabling some of the needed features by passing, e.g., `--features=\"a\
"\
[INSTALLING] foo v0.0.1 ([..])
[ERROR] failed to compile `foo v0.0.1 ([..])`, intermediate artifacts can be found at \
`[..]target`, to reuse those artifacts with a future compilation, set the environment \
variable `CARGO_TARGET_DIR` to that path.
`[..]target`.
To reuse those artifacts with a future compilation, set the environment \
variable `CARGO_TARGET_DIR` to that path.
Caused by:
target `foo` in package `foo` requires the features: `a`
Expand All @@ -679,7 +680,7 @@ Caused by:
"\
[INSTALLING] foo v0.0.1 ([..])
[ERROR] failed to compile `foo v0.0.1 ([..])`, intermediate artifacts can be found at \
`[..]target`, to reuse those artifacts with a future compilation, set the environment \
`[..]target`.\nTo reuse those artifacts with a future compilation, set the environment \
variable `CARGO_TARGET_DIR` to that path.
Caused by:
Expand Down

0 comments on commit 03675ef

Please sign in to comment.