Skip to content

[patch] in config.toml triggers unhelpful warnings #11782

@alecmocatta

Description

@alecmocatta

Problem

#9269 introduced [patch] in .cargo/config.toml. If dependencies patched in this way are used in some workspaces but not others, unnecessary warnings are emitted:

warning: Patch `headless_chrome v0.9.0 (https://github.com/alecmocatta/rust-headless-chrome#db63e48b)` was not used in the crate graph.
Patch `optional_struct v0.2.0 (https://github.com/alecmocatta/OptionalStruct#58d1f03a)` was not used in the crate graph.
Patch `tokio-tar v0.3.0 (https://github.com/alecmocatta/tokio-tar#01af794b)` was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run `cargo update` to use the new
version. This may also occur with an optional dependency that is not enabled.

We use the xtask pattern, with workspaces for different targets.

Possible Solution(s)

Silence warnings about unused patches that come from config.tomls

Version

cargo 1.65.0-nightly (efd4ca3dc 2022-08-12)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Error and warning messages generated by Cargo itself.A-patchArea: [patch] table overrideC-bugCategory: bugS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions