Allow using `cargo-binstall` / `cargo-quickinstall` to download `install_crate` dependencies
Feature Description
Building crates from scratch can be slow—luckily cargo-quickinstall and cargo-binstall provide a solution! Popular crates (in the case of quickinstall) or crates that opt-in to the right format (in the case of binstall) can be downloaded as prebuilt binaries! I'd love to be able to use install_crate in my Makefile.toml while leveraging one of those tools; unfortunately, neither of them have a --force flag, so I can't get this to work.
Describe The Solution You'd Like
Add a no_force flag or similar to install_crate to allow omitting the --force flag so that install_command = "binstall" will work.
Code Sample
[tasks.mdbook.install_crate]
crate_name = "mdbook"
binary = "mdbook"
test_arg = ["serve", "--help"]
install_command = "quickinstall"
Today, the output is:
Error: "unexpected positional arguments: --force mdbook"
good idea. I'll check it out
@dbanty can you checkout the dev branch 0.35.16 for this? basically add also force=false to the install_crate block. still need to write few tests, but it should be ok now. would love your feedback
Hmm, I'm still seeing the same error 🤔 I could have done something wrong though. I installed the new version like cargo install --git https://github.com/sagiegurari/cargo-make --branch=0.35.16 (I've never used that syntax before, so maybe that's wrong?). It then told me:
Replaced package `cargo-make v0.35.15` with `cargo-make v0.35.15 (https://github.com/sagiegurari/cargo-make?branch=0.35.16#7b52723d)` (executables `cargo-make`, `makers`)
I then uninstalled mdbook with cargo uninstall mdbook and added a couple of lines to my install_crate section so that it now looks like this:
[tasks.mdbook.install_crate]
crate_name = "mdbook"
binary = "mdbook"
test_arg = "--help"
install_command = "quickinstall"
force = false
When running a makers serve-book command that requires that dependency, I still get this output:
[cargo-make] INFO - makers 0.35.15
[cargo-make] INFO - Project: knope
[cargo-make] INFO - Build File: Makefile.toml
[cargo-make] INFO - Task: serve-book
[cargo-make] INFO - Profile: development
[cargo-make] INFO - Running Task: legacy-migration
[cargo-make] INFO - Execute Command: "cargo" "quickinstall" "--force" "mdbook"
Error: "unexpected positional arguments: --force mdbook"
[cargo-make] ERROR - Error while executing command, exit code: 1
[cargo-make] WARN - Build Failed.
thanks and sorry about that. i'll check it out tomorrow. didn't have time to setup tests...
No problem, thanks for working on this!
@dbanty it should work well now with your usecase.
@dbanty this is now officially released. if there are any issues with it, feel free to open an issue and I'll handle. thanks for the idea