-
Notifications
You must be signed in to change notification settings - Fork 121
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
Specify minimum version for tools/dependencies #265
Comments
ya thats a great idea and i was thinking about it long time ago. but since i see i'm not the only one thinking about it, i'll add partial support, meaning if i can pull that info, i'll validate the min_version requested. if I can't, i'll ignore the min_version value. i'm not sure i'll be checking the cargo.toml as those build dependencies would most likely not be defined there (for example clippy/rustfmt/....) but instead will be in the crate installation object under the relevant task. |
wait... didn't read your entire post :) |
was thinking the Makefile.toml itself would have a [dependencies] section, not the Cargo.toml. This way, "implicit" installations could still have a minimum version to check. But a dedicated install task would work too. |
@roblabla I just pushed this feature to the 0.22.0 development branch. |
Awesome! The limitations shouldn't be a problem for me. I'll implement it in SunriseOS ASAP. Going over the docs, this stood out:
Maybe this should break the build, or at least put out a warning that Something I was wondering, but I'm not 100% sure if it's a good idea: can this be used to get |
on windows the exe is locked while executing so ya, windows is out of the question. if this and few other features I pushed in the previous days will look ok, I'll publish a new official version in few days. |
I'm running into a bit of a problem with this feature. I tried making a rule that updates TOML: [config]
skip_core_tasks = true
min_version = "0.21.0"
[tasks.install-cargo-xbuild]
install_crate = { crate_name = "cargo-xbuild", binary = "cargo", test_arg = ["xbuild", "--version"], min_version = "0.5.14" }
[tasks.bootstrap]
workspace = false
description = "Compiles the i386 bootstrap for debug"
dependencies = ["install-cargo-xbuild"]
command = "cargo"
args = ["xbuild", "--target=i386-unknown-none", "--package=sunrise-bootstrap" ] Output:
EDIT: Is the |
InstallCrateInfo supports both min version + binary + test_arg so it should have used that. |
@roblabla did the latest fix resolve the issue? |
Tried it again, and there's still a bug. Here's a makefile:
Did some digging, and I found that here, crate_only_info is false. This happens because I don't set a |
I'll setup more test cases for sure. thanks, will check |
fixed and added more tests |
@roblabla cargo make 0.22.0 has now been published with min version validation changes. |
Features Description
It'd be kinda neat to specify the minimum version of a tool we want. For instance, in SunriseOS, we now require cargo-xbuild 0.5.14, but
cargo-make
won't install the latestcargo-xbuild
, it'll only install it if it wasn't found previously.Describe the solution you'd like
Having some kind of
[dependencies]
section where we specify minimum version of the tools in the Makefile would be nice.Alternatively, maybe
cargo-make
could always trigger an update?cargo install
has an unstable flag to trigger an update instead of failing (cargo install -Z install-upgrade
), but relying on unstable flags is kinda icky.The version can be checked by looking at
~/.cargo/.crates.toml
or~/.cargo/.crates2.json
, or it could be checked through some kind of regex match againstbinary --version
?Code Sample
Should install latest cargo-xbuild if not present or if version installed is below the specified version.
The text was updated successfully, but these errors were encountered: