Skip to content

Commit 6fc517b

Browse files
committed
Auto merge of #10784 - tedinski:fix-10783, r=epage
Allow '.' in workspace.default-members in non-virtual workspaces.
2 parents d583b21 + 917b87e commit 6fc517b

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

src/cargo/core/workspace.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,8 @@ impl<'cfg> Workspace<'cfg> {
686686
})?;
687687
}
688688

689+
self.find_path_deps(&root_manifest_path, &root_manifest_path, false)?;
690+
689691
if let Some(default) = default_members_paths {
690692
for path in default {
691693
let normalized_path = paths::normalize_path(&path);
@@ -716,7 +718,7 @@ impl<'cfg> Workspace<'cfg> {
716718
self.default_members.push(self.current_manifest.clone())
717719
}
718720

719-
self.find_path_deps(&root_manifest_path, &root_manifest_path, false)
721+
Ok(())
720722
}
721723

722724
fn find_path_deps(

tests/testsuite/workspaces.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,35 @@ fn non_virtual_default_members_build_other_member() {
119119
.run();
120120
}
121121

122+
#[cargo_test]
123+
fn non_virtual_default_members_build_root_project() {
124+
let p = project()
125+
.file(
126+
"Cargo.toml",
127+
r#"
128+
[project]
129+
name = "foo"
130+
version = "0.1.0"
131+
authors = []
132+
133+
[workspace]
134+
members = ["bar"]
135+
default-members = ["."]
136+
"#,
137+
)
138+
.file("src/main.rs", "fn main() {}")
139+
.file("bar/Cargo.toml", &basic_manifest("bar", "0.1.0"))
140+
.file("bar/src/lib.rs", "pub fn bar() {}")
141+
.build();
142+
143+
p.cargo("build")
144+
.with_stderr(
145+
"[..] Compiling foo v0.1.0 ([..])\n\
146+
[..] Finished dev [unoptimized + debuginfo] target(s) in [..]\n",
147+
)
148+
.run();
149+
}
150+
122151
#[cargo_test]
123152
fn inferred_root() {
124153
let p = project()

0 commit comments

Comments
 (0)