Skip to content

Location of patch information #13952

Open
@kurtlawrence

Description

Problem

If there are errors in a [patch] entry, it can be hard to locate where the patch was specified.

I work on a large code base that spans multiple workspace crates and cross repo crates.
I have experienced a few times that we migrate a set of dependencies, and get caught with resolution errors. If the error is because of a [patch] entry which is no longer applicable, it only gives the crate name that is failing.
Most of the time we define patches in the workspace Cargo.toml, however there have been occasion to put them into the .cargo/config.toml for various reasons.

The .cargo/config.toml is not a common location to look for patches, it would be helpful if the error message could point to where the patch is being specified.

Proposed Solution

Cargo gives more detail for error messages involving [patch]es. Specifically the location of the [patch] entry would quickly help pinpoint where to fix the issue.

Notes

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Error and warning messages generated by Cargo itself.A-patchArea: [patch] table overrideC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`E-mediumExperience: MediumS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions