-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Description
Say I have a (list of) patch I want to apply to one of the dependencies of my crate, but I can not have it merged upstream. It would be good if cargo could apply the patch at build time on this crate.
[dependencies.foobar]
version = "1.42"
patches = [
"path/to/patch-1.patch",
"path/to/patch-2/foobarize-a-bit-less.patch"
]
This feature would be useful in the following cases:
- The maintainer of some crate is not responding but I need to ship my fix quickly;
- I am working in a corporate environment, and I need to patch one of my dependencies, but I can not release this patch;
- I want to tune some crate for my specific use case, but there is no way the crate maintainer can accept my patch, and I do not want to fork the crate just for this.
How this could work
The patch would only be accepted in the unified diff format, at a fixed directory level. At build time, cargo would unpack the crate sources, parse the diff and apply it to the source before proceeding with compilation.
Are there any drawback of doing this I did not though of?
Metadata
Metadata
Assignees
Labels
No labels