portability-wg
portability-wg copied to clipboard
Modifying upstream crates
Inevitably, you'll come across a crate which requires minor patches to be compatible with another platform. Currently there are two options to deal with this situation:
- Send patches adding platform support upstream
- Require downstream users of your create to use your fork
This issue proposes finding a middle ground between these options in case upstream is not cooperating.
I'm not sure there exists such a good middle ground, but it would be cool to be wrong! As it stands, I think our goal should be to make the situation good enough that there's no reason that upstream wouldn't take the patch. [patch]
in Cargo ought to work well enough that the second case isn't so bad until they do.
One (probably bad) idea I had is to allow [patch]
statements to trickle up the dependency tree.
What do you mean by that?
I guess I hadn't really thought it through. Maybe better is if you could specify [patch]
sections per target in your cargo config?
The alternative being to do some target-specific [cfg]
s in your patched version?
Related https://github.com/rust-lang/rfcs/pull/2624