How to apply patch to external crate

one upstream crate contains c++ sources and has some issues. I have some patches to workaround the issues.
is there sinple ways to apply patches during cargo building process other than clone and maintain the git source?
sorry if there were same topics.

Check out the documentation for overriding dependencies.

it requires maintaining the git source.

I want to apply the patch while the crate can be updated by its owner.

I don't really understand what you mean, but the methods listed on that page are the only ways to override a dependency.

Do you want to store locally only the diff and apply it automatically on whatever code is provided upstream? I'm not sure if this is something that was done before, simple because it's not very robust - the upstream maintainer can change the unrelated code in such a way that your path doesn't apply anymore.


I know it's not robust or elegant. but it's easier than maintaining the source which has 3 layers of submodules. and the upstream is not very responsive in solving the issue.

You can't do it in that way.


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.