I'm working on the feat/taffy-grid branch of my fork of iced_aw: GitHub - avsaase/iced_aw at feat/taffy-grid (don't look at the code changes, it's a WIP). When I try to run the grid example with cargo run --package grid I get the error
error: There are multiple `grid` packages in your project, and the specification `grid` is ambiguous.
Please re-run this command with `-p <spec>` where `<spec>` is one of the following:
grid@0.1.0
grid@0.10.0
As far as I can see there is there is no second grid package in this workspace so this error doesn't make sense to me. When I follow cargo's suggestion it also says that these packages don't exist in the workspace.
The other examples in the workspace work and on the master branch this example also works.
I tried removing the target folder and deleting the lock file but that didn't help. Did I hit some kind of cargo bug?
You have an example with the crate name grid of version 0.1.0. In addition you depend on taffy, which in turn depends on a crate called grid from crates.io and this one has version 0.10.0. When you do cargo run -p grid it is ambiguous if you are referring to your example or to the grid crate from crates.io.
cargo run does behave differently than other commands (e.g. --workspace is not accepted even though it could sometimes make sense) so I wouldn't be surprised if there's an inconsistency bug here.
It's generally a good idea to avoid reusing package names to keep things simple and clear, though.
I'm not sure what you mean here. If package names within a workspace should be globally unique to avoid conflicts with (transitive) dependencies then that would be very fragile.
I'm saying that it's a good idea to try to avoid identical names, not that you can guarantee that. It makes various diagnostic output easier to read, even if nothing else.