Yes, patches are applied transitively:
It’s also worth noting that
[patch]
applies transitively. Let’s say you usemy-library
in a larger package, such as:[package] name = "my-binary" version = "0.1.0" [dependencies] my-library = { git = 'https://example.com/git/my-library' } uuid = "1.0" [patch.crates-io] uuid = { git = 'https://github.com/uuid-rs/uuid.git' }
Remember that
[patch]
is applicable transitively but can only be defined at the top level so we consumers ofmy-library
have to repeat the[patch]
section if necessary. Here, though, the newuuid
crate applies to both our dependency onuuid
and themy-library -> uuid
dependency. Theuuid
crate will be resolved to one version for this entire crate graph, 1.0.1, and it’ll be pulled from the git repository.