Patch not being applied during build

Hey all, question about specifying patches in Cargo.toml: I have a library I am trying to release, but I need to patch another dependency library that will eventually be updated, but isn't yet. For now, I am hosting the updated version on my own github, and have specified the Cargo.toml as

[dependencies]
k = { version = "0.29.1" }
[patch.crates-io]
k = {git = "https://github.com/AndrewJSchoen/k" }

However, when I build from scratch (e.g. clone repo and run cargo build), it uses the unpatched version and fails to build. Have I done something wrong here?

Side note: if I comment out the patch section, build (which obviously fails), then uncomment, it works. Not sure what might be going on there. Seems like it doesn't notice it the first time.

You can only add patches in the workspace you are trying to directly build. Anyone consuming your library will not pick up the patch.

This isn't using "consuming" the library, though, from what I understand. The patch is in the library I am trying to build from source.

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.