Open SUPERCILEX opened 1 year ago
We talked specifically about consistency with cargo update -w
in the cargo team meeting. We felt that improving consistency is important which precludes any other command having a -w
that isn't a short for --workspace
.
We did not decide how to resolve the inconsistency on the existing -w
flag, whether we feel that -w
was a mistake that slipped in (and we would want to deprecate) or is something we want to push for in the rest of cargo. That was a wider conversation than we were prepared for and had time for.
To help move the conversation forward, I personally feel the remaining points are
-w
for --workspace
would be consistent with npm--watch
from #9339 -w
is --width
which shouldn't be too ambiguous to read as that would take a numeric value-w
without a value as --write
and I didn't even remember that I had used -w
in a tool of mine for --write-changes
(just now thought to check and I wrote that flag years ago and never used it)cargo check
and cargo clippy
, if I'm checking the workspace, I want to check everything and I also pass in --all-targets
. At that point, --workspace
(or the older --all
) being shortened doesn't matter all that much. Instead I use make
or could use an aliascargo test -w
being shorter than cargo test --workspace
I feel the --workspace
flag is way too long to type it out on a regular basis and I've never started to use it. I use --all
instead, for example when I want to ensure that I'm not regressing the build of one of the crates in the workspace before making a PR (default-members
defaults to all workspace members but it could in theory have been set to a subset). I don't really agree that --all
is confusing, but I'm still okay with the removal as long as there is some short alternative to it. Being forced onto --workspace
feels like a regression to me.
If -w
is not good (say you want to use it for cargo watch
), what about --ws
?
I feel the same about foo.workspace = true
by the way. foo = "ws"
as alias for foo.workspace = true
would be really wonderful. If you have a bunch of crates like foo.workspace = true
then it's hard to scan the dependencies (and hard to add new dependencies because you have to type these long words). ws
is not a valid semver version, and if you want to specify features you can still do foo = { workspace = true, feature = ["a"]}
, like how you do foo = { version = "1.0", feature = ["a"]}
today.
See discussion here: https://github.com/rust-lang/cargo/pull/11549
Key points:
-w
appears to be for--watch
or--workspace
, depending on the tool. Bias appears to be towards watch.-w
==--workspace
: https://doc.rust-lang.org/cargo/commands/cargo-update.htmlThus, we're blocked on https://github.com/rust-lang/cargo/issues/9339