-
Notifications
You must be signed in to change notification settings - Fork 17
Description
To run the build script, cargo needs to resolve dependencies first, so if the target/patch/{PACKAGE} directory pointed to in the [patch.crates-io] section isn't existing and populated, cargo will fail to do pretty much anything. You can run cargo patch once to get that directory, and any changes to the patches will (presumably) be applied on subsequent builds. But this requires everyone who first clones a repository for a project that uses this to install and run this command, as well as rerun the command any time they cargo clean. Which sucks, and almost defeats the purpose of using the build script.
There is no real way to fix this. The best way to work around it is to use cargo-make in conjunction with this program, adding a task to run rust code before building that invokes cargo_patch::patch().
I'd suggest updating the readme to warn against this issue and recommend the use of cargo-make, or just replace the build.rs method with the cargo-make method.