Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error message when passing in relative path to Workspace::new #8321

Merged
merged 2 commits into from
Jun 5, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
Passing a relative path to Workspace now bails with proper message.
Previously, this failure will return an unhelpful warning.
This commit adds an error message saying that the argument for
`manifest_path` must be an absolute path.
  • Loading branch information
hbina committed Jun 4, 2020
commit 84f1dc1b5990068e2df1f0fec3656e55ed2c4b9f
5 changes: 4 additions & 1 deletion src/cargo/core/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ impl<'cfg> Workspace<'cfg> {
ws.target_dir = config.target_dir()?;

if manifest_path.is_relative() {
ws.root_manifest = Some(std::env::current_dir()?);
anyhow::bail!(
"manifest_path:{:?} is not an absolute path. Please provide an absolute path.",
manifest_path
)
} else {
ws.root_manifest = ws.find_root(manifest_path)?;
}
Expand Down