{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/cargo/issues/3830","repository_url":"https://api.github.com/repos/rust-lang/cargo","labels_url":"https://api.github.com/repos/rust-lang/cargo/issues/3830/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/cargo/issues/3830/comments","events_url":"https://api.github.com/repos/rust-lang/cargo/issues/3830/events","html_url":"https://github.com/rust-lang/cargo/issues/3830","id":214083338,"number":3830,"title":"Add ability to dynamically patch a dependency","user":{"login":"Luthaf","id":6141587,"avatar_url":"https://avatars1.githubusercontent.com/u/6141587?v=3","gravatar_id":"","url":"https://api.github.com/users/Luthaf","html_url":"https://github.com/Luthaf","followers_url":"https://api.github.com/users/Luthaf/followers","following_url":"https://api.github.com/users/Luthaf/following{/other_user}","gists_url":"https://api.github.com/users/Luthaf/gists{/gist_id}","starred_url":"https://api.github.com/users/Luthaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Luthaf/subscriptions","organizations_url":"https://api.github.com/users/Luthaf/orgs","repos_url":"https://api.github.com/users/Luthaf/repos","events_url":"https://api.github.com/users/Luthaf/events{/privacy}","received_events_url":"https://api.github.com/users/Luthaf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-03-14T14:08:46Z","updated_at":"2017-03-14T21:52:36Z","closed_at":"2017-03-14T21:52:36Z","body":"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.\r\n\r\n```toml\r\n[dependencies.foobar]\r\nversion = \"1.42\"\r\npatches = [\r\n    \"path/to/patch-1.patch\",\r\n    \"path/to/patch-2/foobarize-a-bit-less.patch\"\r\n]\r\n```\r\n\r\nThis feature would be useful in the following cases:\r\n- The maintainer of some crate is not responding but I need to ship my fix quickly;\r\n- I am working in a corporate environment, and I need to patch one of my dependencies, but I can not release this patch;\r\n- 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.\r\n\r\n## How this could work\r\n\r\nThe 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](https://crates.io/crates/patch) and apply it to the source before proceeding with compilation.\r\n\r\nAre there any drawback of doing this I did not though of?"},"comment":{"url":"https://api.github.com/repos/rust-lang/cargo/issues/comments/286572667","html_url":"https://github.com/rust-lang/cargo/issues/3830#issuecomment-286572667","issue_url":"https://api.github.com/repos/rust-lang/cargo/issues/3830","id":286572667,"user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars2.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"created_at":"2017-03-14T21:52:36Z","updated_at":"2017-03-14T21:52:36Z","body":"Yes this is the intended use case of `[replace]` currently, but one part we've always wanted is a convenient command like `cargo fork` which easily applies a `[replace]` and checks it out locally for you to use!\r\n\r\nWe already have a feature for this, though, so I'm going to close this. Let me know if it doesn't work though!"}}
{"actor":{"display_login":"alexcrichton"}}