Skip to content

Commit 9907039

Browse files
committed
Attemtping to solve Workspace using relative path.
1 parent 40ebd52 commit 9907039

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/cargo/core/workspace.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,13 @@ impl<'cfg> Workspace<'cfg> {
145145
pub fn new(manifest_path: &Path, config: &'cfg Config) -> CargoResult<Workspace<'cfg>> {
146146
let mut ws = Workspace::new_default(manifest_path.to_path_buf(), config);
147147
ws.target_dir = config.target_dir()?;
148-
ws.root_manifest = ws.find_root(manifest_path)?;
148+
149+
if manifest_path.is_relative() {
150+
ws.root_manifest = Some(std::env::current_dir()?);
151+
} else {
152+
ws.root_manifest = ws.find_root(manifest_path)?;
153+
}
154+
149155
ws.find_members()?;
150156
ws.resolve_behavior = match ws.root_maybe() {
151157
MaybePackage::Package(p) => p.manifest().resolve_behavior(),

0 commit comments

Comments
 (0)