cargo_metadata
cargo_metadata copied to clipboard
Made camino an optional dependency.
As I already said in #193 I don't feel like camino is necessary however there might people that relay/need this kind of behavior so I made it an optional dependency disabled by default. I also updated the changelog with the corresponding entry.
This does not seem right because the cargo feature should be additive.
For example, enabling this feature may break dependencies that do not enable this feature because some signatures of camino and std::path APIs are incompatible. Also, in some cases, third-party traits implemented in std::path are not implemented in camino, so the code that uses them will also be broken.
I assumed Utf8PathBuf implemented all the methods from PathBuf but I see how that can be a problem especially with third-party impls. Is there a better solution to make camino optional? Otherwise it might be better to remove camino entirely. As I said in #193 it adds needless restrictions considering that every Utf8PathBuf is a valid PathBuf but not the other way around.
I assumed Utf8PathBuf implemented all the methods from PathBuf but I see how that can be a problem especially with third-party impls.
That's not the main issue, the main issue is that the types are different, so if someone passes that field to a function expecting a PathBuf
, because their crate uses cargo_metadata
without the camino feature, then that would break the moment any other crate in the deptree enables the feature.
Will comment on the issue
Yeah I see how that's a big very big issue. Maybe a better solution is a wrapper type kinda like the map in serde_json. But honestly I think camino should be removed all together.