Patch in .toml file for crate with multiple members doesn't bring in all members

So I had a Cargo.toml file that had a line

rend3 = "0.2.3"

"rend3" has a list of features in its Cargo.toml file:

members = [
    "rend3",
    "rend3-egui",
    "rend3-framework",
    "rend3-gltf",
    "rend3-imgui",
    "rend3-routine",
    "rend3-types"
]

So pulling in "rend3" from "crates.io" makes all those names visible. Fine.

But there's a bug in that which is fixed on Github but not yet on crates.io, and I thus need to use the version from Github. So, in my Cargo.toml file that uses rend3, I overrode crates.io with

[patch.crates.io]
rend3 = { git = 'https://github.com/Bve-Reborn/rend3.git' }

This brings in "rend3", but the other members are not visible. I get the compile error

use rend3_routine;
       ^^^^^^^^^^^^^ no external crate `rend3_routine`

How do I bring in all the members? Thanks.

You will have to use [patch.crates-io] for each member of the repo. In addition you need to specify rend3-routine as dependency in [dependencies] too to be able to use it in your crate. Also I don't know of it is a mistake when copying to your post, but [patch.crates.io] should be [patch.crates-io]. (crates-io with a - instead of a .)

You will have to use [patch.crates-io] for each member of the repo.

Turns out that won't work. The new repo has a different list of members than the one in crates.io, and you can't patch a member that isn't in the old one. So, renaming members breaks the patch system.

So I just did it the hard way, commenting out the crates.io references and putting in ones to github. No use of patch at all.

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.