Skip to content

Select specific workspace package in --git overrides #107

@eopb

Description

@eopb

Problem

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions