TimonPost / cargo-dependency-inheritor

Utility to inherit dependencies from workspace file if it occurs 'n' or more times throughout the project.
Apache License 2.0
30 stars 1 forks source link

Skip local dependencies with `path =` source #7

Closed MarijnS95 closed 1 year ago

MarijnS95 commented 1 year ago

These dependencies are typically part of a workspace and referred to with a path = "../some/crate" designator. Pointing to them through a workspace dependency is possible and maybe even more concise at the detriment of specifying them more often, but at least without removing path= from the per-crate dependencies causes havoc:

Dependency 'foo' has different source paths depending on the build target. Each dependency must have a single canonical source path irrespective of build target.
TimonPost commented 1 year ago

cool, we can open that PR, seems like a valuable addition! Thanks

MarijnS95 commented 1 year ago

cool, we can open that PR, seems like a valuable addition! Thanks

Maybe a default-true flag?

TimonPost commented 1 year ago

Will get back at it later today when back home. There are some more questions regarding what key/values to copy to the workspace. Would be nice if people could configure this with CLI arguments. Specifying to Skipp workspace packages, or also copying certain feature flags.

MarijnS95 commented 1 year ago

Done this in #8, but may still need a CLI flag.

Would be great to copy git and rev and branch flags as well, and perhaps bail if the user set some key that we don't know about, but I don't think cargo-metadata provides that info.