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

For the problem at hand I ended up doing:

1. Add the release tarball of the dep to the list of sources the package builder downloads and verifies
2. Patch the unpacked dep with the back ported bug fix
3. Patch in an [patch.crates-io] entry into the Cargo.toml to use the patched dep by path
4. Patch the Cargo.lock to match point 3.

That is a bit more involved than I would like, but I think this manageable and maintainable.

Supporting patches directly in [patch.crates-io] would simplify it.