Closed elichai closed 4 years ago
This invocation will update all packages as well as --target
, x86_64-unknown-linux-gnu
, and --verbose
.
cargo-update
has never supported directly forwarding arbitrary cargo install
options, but there's some per-package config.
That being said, I can see the value in that forwarding, especially since cargo install
doesn't seem to support slurping flags from the environment.
I would really like that. I have a nice bash script that automatically changes every cargo install
invocation into RUSTFLAGS+=' -Clto -Ctarget-cpu=native' command cargo install "$@" --target x86_64-unknown-linux-gnu
so that the installs are with LTO and special instructions(SSE/AVX etc), but this isn't possible with cargo-update
In this case I'd much rather take the arguments to forward like CARGO_INSTALL_OPTS='--target x86_64-unknown-linux-gnu --verbose' cargo install-update
, but I'm assuming this works for you just as well?
Nope, just tried CARGO_INSTALL_OPTS='--target x86_64-unknown-linux-gnu --verbose' cargo install-update --all
and the output isn't verbose
Well, yes, I've yet to finish the patch, I was asking more from a usage standpoint, I guess
ohh yeah. that works for me. but I do think it's more idiomatic to use
command --command-flag -- --inner-command-flag
In the general case I'd agree. but we already take a [PACKAGE]...
argument, for which clap
handles the --
, so that's kinda the more expected behaviour as this stands.
Can you test with https://github.com/nabijaczleweli/cargo-update/commit/9d5a73dcd60136b524421343090fb87e0eaf5d94 from master
?
will do
error: failed to compile `cargo-update v2.3.1 (/home/elichai2/gits/cargo-update)`, intermediate artifacts can be found at `/home/elichai2/gits/cargo-update/target`
Caused by:
failed to resolve patches for `https://github.com/rust-lang/crates.io-index`
Caused by:
patch for `unicode-normalization` in `https://github.com/rust-lang/crates.io-index` resolved to more than one candidate
Yes, that's a work in progress, but you should be able to git reset --hard 9d5a73dcd60136b524421343090fb87e0eaf5d94
in the mean-time
you should do unicode-normalization = "=0.1.9"
if they broke stuff.
it works a lot better than patching
That worked, thank you!
it seems to work but I have a separate problem with cargo itself
anyway, I'll update my bash script to also set CARGO_INSTALL_OPTS
and i'll wait for a release :)
Released in v2.4.0
!
Hi, I'm trying to pass flags to cargo when using this crate but it doesn't seem to register. i.e:
cargo install-update --all -- --target x86_64-unknown-linux-gnu --verbose
looks regular and doesn't pass the verbose flag to cargo