Does any rust dev or package maintainer has found a viable approach to downstream patch management? E.g. Arch, Fedora, Alpine and probably most others use diff patches along with the "package recipe", as this allows maintaining everything in one place.

E.g. rust package foo depending on crate bar: If there is a patch for foo, diffs work fine. But what if I need to patch bar? Note that patching in a `[patch.crates-io]` entry is manageable, having that point to a repo is not.

#rustlang #distro

I came up with two approaches:

1. cargo would allow an array of patches to be specified in [patch.crates-io] that it will apply to the crate in the specified order

2. a CLI tool that accepts two+ arguments, the name of the crate to patch as first argument and the patch(es) to apply as arguments two etc.: It would then obtain and verify the source as specified in Cargo.toml, apply the patches, and patch the Cargo.toml to use the prepared and patched folder instead.