Open Urgau opened 1 month ago
I have a local branch where I experimented with hiding/grouping those --check-cfg
args, and two things came up:
-vv
?
-v
should hide them but -vv
shouldn't; it would be similar to the env variables which are hidden in -v
but visible with -vv
.--check-cfg
args ?
[@check-cfg]
at the end of the command.With my local branch:
Running `rustc --crate-name foo --edition=2021 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=104 --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 --warn=unexpected_cfgs -C metadata=48a4dac05867c2f4 -C extra-filename=-48a4dac05867c2f4 --out-dir /tmp/foo/target/debug/deps -C incremental=/tmp/foo/target/debug/incremental -L dependency=/tmp/foo/target/debug/deps [@check-cfg]`
My stance is that -v should hide them but -vv shouldn't; it would similar to the env variables which are hidden in -v but visible with -vv.
In general I would agree. However, if -vv
is required to get proper information about why a dependency was rebuilt (as has been suggested in https://github.com/rust-lang/cargo/issues/13859), it would be unfortunate if that mode was so verbose that it becomes near impossible to see the rebuild information...
Cc @weihanglo
That is a problem I have with verbosity in general: everyone wants a different piece of information and showing for one user can overwhelm and hide the information another user wants. Thats why for rebuild information, #2904 is likely a better route.
btw there is a purist aspect of me that is hesitant about hiding parts of the command line.
btw there is a purist aspect of me that is hesitant about hiding parts of the command line.
(fwi, my local branch actually uses an argfile for all --check-cfg
, so the only thing that would really be hidden from the displayed args is the argfile path, but I understand your point)
Problem
Some crates have a lot of custom cfgs and they can take quite a lot of place in the logs output. For some crates they can easily dominate the output of
check -v
.Reported in https://github.com/rust-lang/rust/issues/125351#issue-2307499426 and https://github.com/rust-lang/rust/issues/124740#issuecomment-2094808609
Proposed Solution
Use dedicated argument file to pass of the
--check-cfg
arguments at once.Notes
No response