Skip to content

Commit 29ef271

Browse files
committed
Search for root manifest with ephemeral workspaces
Fixes #5495.
1 parent 9826222 commit 29ef271

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cargo/core/workspace.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,9 @@ impl<'cfg> Workspace<'cfg> {
198198
target_dir: Option<Filesystem>,
199199
require_optional_deps: bool,
200200
) -> CargoResult<Workspace<'cfg>> {
201-
let mut ws = Workspace::new_default(package.manifest_path().to_path_buf(), config);
201+
let manifest_path = package.manifest_path();
202+
let mut ws = Workspace::new_default(manifest_path.to_path_buf(), config);
203+
ws.root_manifest = ws.find_root(&manifest_path)?;
202204
ws.is_ephemeral = true;
203205
ws.require_optional_deps = require_optional_deps;
204206
let key = ws.current_manifest.parent().unwrap();

0 commit comments

Comments
 (0)