portability-wg icon indicating copy to clipboard operation
portability-wg copied to clipboard

Modifying upstream crates

Open jethrogb opened this issue 6 years ago • 6 comments

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:

  1. Send patches adding platform support upstream
  2. 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.

jethrogb avatar Mar 07 '18 17:03 jethrogb

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.

Ericson2314 avatar Mar 07 '18 19:03 Ericson2314

One (probably bad) idea I had is to allow [patch] statements to trickle up the dependency tree.

jethrogb avatar Mar 07 '18 20:03 jethrogb

What do you mean by that?

Ericson2314 avatar Mar 07 '18 20:03 Ericson2314

I guess I hadn't really thought it through. Maybe better is if you could specify [patch] sections per target in your cargo config?

jethrogb avatar Mar 07 '18 21:03 jethrogb

The alternative being to do some target-specific [cfg]s in your patched version?

pierzchalski avatar Mar 08 '18 00:03 pierzchalski

Related https://github.com/rust-lang/rfcs/pull/2624

jethrogb avatar Jan 13 '19 12:01 jethrogb