Patching an indirect dependency with package = "xxx"
renaming
#13734
Labels
C-question
Category: question
S-needs-info
Status: Needs more info, such as a reproduction or more background for a feature request.
Problem
Context
We have three crates:
parent
child
client
Where
client
depends onchild
andchild
depends onparent
.We want to patch (overriding) the
parent
used bychild
.First Try: with package renaming
Here, we would use the patch syntax in
client/Cargo.toml
:https://github.com/billy1624/test-cargo-patch/blob/2257248f866c8bd9efcc635b33075cb66f89fd93/client/Cargo.toml#L1-L17
Overriding
parent
withparent-x
. Theparent-x
is being renamed asparent
as follows:package = "xxx"
https://github.com/billy1624/test-cargo-patch/blob/2257248f866c8bd9efcc635b33075cb66f89fd93/client/Cargo.toml#L12-L17
parent-x
is exported asparent
https://github.com/billy1624/test-cargo-patch/blob/2257248f866c8bd9efcc635b33075cb66f89fd93/parent-x/Cargo.toml#L1-L12
Checkout the branch.
From the result of
cargo build
andcargo tree
, we saw that it did NOT patch (override) theparent
dependency that's used inchild
.Second Try: without package renaming
Overriding
parent
withparent-x
. The package inparent-x
is being named asparent
, without any renaming:https://github.com/billy1624/test-cargo-patch/blob/18d4e28b039b851e8ab18cf2749b8700f7d91935/client/Cargo.toml#L1-L17
https://github.com/billy1624/test-cargo-patch/blob/18d4e28b039b851e8ab18cf2749b8700f7d91935/parent-x/Cargo.toml#L1-L12
Checkout the branch.
Here, we successfully patch (override) the
parent
dependency that's used inchild
.Questions
Steps
No response
Possible Solution(s)
No response
Notes
No response
Version
No response
The text was updated successfully, but these errors were encountered: