Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to specify the exact version of one crate #612

Closed
lnshi opened this issue Nov 24, 2021 · 5 comments
Closed

Unable to specify the exact version of one crate #612

lnshi opened this issue Nov 24, 2021 · 5 comments
Assignees
Labels
Milestone

Comments

@lnshi
Copy link

lnshi commented Nov 24, 2021

Describe The Bug

I followed the instruction in the README.md: here, and tried to specify a specific version of rustfmt by doing:

[tasks.fmt]
install_crate = { crate_name = "rustfmt", binary = "rustfmt", version = "1.4.38", test_arg = "--help" }
command = "cargo"
args = ["fmt", "--all", "--manifest-path=rsmain/Cargo.toml"]

but result in the below warning, and still the installed old version of rustfmt is used:

[cargo-make] INFO - cargo make 0.35.6
[cargo-make] INFO - Build File: Makefile.toml
[cargo-make] INFO - Task: fmt
[cargo-make] INFO - Profile: development
[cargo-make] INFO - Running Task: legacy-migration
[cargo-make] WARN - Unable to read currently installed version for crate: rustfmt
[cargo-make] INFO - Execute Command: "cargo" "fmt" "--all" "--manifest-path=rsmain/Cargo.toml"
[cargo-make] INFO - Build Done in 2.21 seconds.

But in the same console if i do rustfmt --version i got rustfmt 1.4.37-stable (59eed8a2 2021-11-01) correctly, no idea what the WARN is complaining.

To Reproduce

Just create a default Makefile.toml and copy in the above task definition and run.

Wha am i missing? How should i make sure the version i want get installed?

@sagiegurari
Copy link
Owner

thanks for notifying me. i'll check it out.

@sagiegurari
Copy link
Owner

@lnshi the reason it didn't work for you is that rustfmt is installed from rustup which seems not to update the .crates.toml which i use to find the version.
I'm going to add an additional check using the --version cli command to find out of those type of crates.
however, in your specific use case, it won't help, because i think rustfmt installation instructions do not talk about simple cargo install. so maybe it will solve your issue, maybe it won't.

sagiegurari added a commit that referenced this issue Nov 28, 2021
@sagiegurari
Copy link
Owner

@lnshi you can try out the dev branch 0.35.7 which now has the fix for this.
would love your feedback to understand if it starts up the cargo install.

@sagiegurari sagiegurari added this to the 0.35.7 milestone Nov 29, 2021
@lnshi
Copy link
Author

lnshi commented Nov 29, 2021

@sagiegurari thanks for the quick response, i will try it out

@sagiegurari
Copy link
Owner

@lnshi this is now officially released. if you still face issues, feel free to open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants