-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Description
When parsing workspace.members, the result of glob matching doesn't filter directories. It will gladly append Cargo.toml to file paths like README.md:
cargo-subcommand/src/manifest.rs
Lines 38 to 42 in de0458c
| for member in &workspace.members { | |
| for manifest_dir in glob::glob(workspace_root.join(member).to_str().unwrap())? { | |
| let manifest_dir = manifest_dir?; | |
| let manifest_path = manifest_dir.join("Cargo.toml"); | |
| let manifest = Manifest::parse_from_toml(&manifest_path)?; |
Assumes a manifest being parsed contains:
[workspace]
members = [
"examples/*",
"tests/*",
]... and these directories contain a README.md or other files as direct children. An example repo in the wild where this is done:
egui:
This kind of setup causes Subcommand::new() to return an error here:
cargo-subcommand/src/subcommand.rs
Lines 67 to 71 in de0458c
| utils::find_package_manifest_in_workspace( | |
| workspace_manifest, | |
| potential_manifest, | |
| package, | |
| )? |
The glob result needs to be filtered to match directories. Checking manifest_dir.is_dir() is a good start, but symlinks also need to be followed.
Metadata
Metadata
Assignees
Labels
No labels