You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a git override with cargo-overrides --git <uri> flag, a URL is provided for the git repository. If that git repository happens to contain a workspace, cargo-override will use the default package in that workspace.
For example, since sqlx defines a default package at its root, it'll be that crate that gets patched when cargo override --git https://github.com/launchbadge/sqlx is used. It is not currently possible to patch an of the other sqlx crates with --git, such as sqlx-core.
Crates like tokio and tracing, don't contain any default package in their workspace root, so aren't possible to patch at all. cargo override --git currently always fails for those.
Suggested solution
First we need to ensure that git patches of crates, without a default package, are possible with Cargo. I have not tested this so am not 100% certain it works.
Once that is done, we can add a -p <pkgid> flag that can be used with --git to specify the package we wish to use in the patch.
The text was updated successfully, but these errors were encountered:
It could also make sense to generalise this change to work with --path also, since the path could also contain multiple packages in a workspace.
This is also a nice opportunity to have improved error/help messages, where we print out package IDs of the potential packages that can be passed into -p <pkgid>
--path maps to a PathSource which expects a package at that location.
--git maps to a GitSource which wraps a RecursivePathSource. I would patch everything found within the GitSource that is present in the Resolve, warning when a referenced package name is ambiguous.
Problem
When creating a git override with
cargo-override
s--git <uri>
flag, a URL is provided for the git repository. If that git repository happens to contain a workspace,cargo-override
will use the default package in that workspace.For example, since
sqlx
defines a default package at its root, it'll be that crate that gets patched whencargo override --git https://github.com/launchbadge/sqlx
is used. It is not currently possible to patch an of the othersqlx
crates with--git
, such assqlx-core
.Crates like
tokio
andtracing
, don't contain any default package in their workspace root, so aren't possible to patch at all.cargo override --git
currently always fails for those.Suggested solution
First we need to ensure that git patches of crates, without a default package, are possible with Cargo. I have not tested this so am not 100% certain it works.
Once that is done, we can add a
-p <pkgid>
flag that can be used with--git
to specify the package we wish to use in the patch.The text was updated successfully, but these errors were encountered: