feat(cli/rustup-mode): add rustup ci subcommand - #5021
Conversation
| CARGO_PROFILE_DEV_DEBUG=0 | ||
| CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse | ||
| CARGO_TERM_COLOR=always | ||
| CARGO_UNSTABLE_SPARSE_REGISTRY=true |
There was a problem hiding this comment.
As per https://github.com/actions-rust-lang/setup-rust-toolchain/blob/8439c15d249cd2e2a5c80ad3da200c3d8c553ae4/action.yml#L145-L149 this will be a no-op on cargo versions that don't support this flag.
| @@ -0,0 +1,6 @@ | |||
| CARGO_INCREMENTAL=0 | |||
| CARGO_PROFILE_DEV_DEBUG=0 | |||
| CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse | |||
There was a problem hiding this comment.
@weihanglo Is it safe to always set this flag similarly to #5021 (comment)?
There was a problem hiding this comment.
For incremental I think so. Cargo shipped a similar thing recently: rust-lang/cargo#17220
For profile dev debug, Cargo will have a new debug profile and we planned to turn off debug for dev profile:
rust-lang/cargo#17214. So, the direction looks pretty aligned.
For registry protocol, we may want to test if there is any version treating it as a hard error if not recognized. I believe no but worth a double check.
There was a problem hiding this comment.
probably could test pre-1.61 1.61 to 1.68, and post 1.68
|
Feel free to use my solution for whatever you need👍 |
e680603 to
d5a9f89
Compare
Co-authored-by: r7kamura <r7kamura@gmail.com>
d5a9f89 to
5917940
Compare
|
@r7kamura Thanks a lot for the extra context! I've made you the co-author for this commit as a sign of appreciation. |
| // For all other subcommands, the hint may be useful if rustup is still unusable after | ||
| // the command has completed. | ||
| Self::Check { .. } | ||
| | Self::Ci { .. } |
There was a problem hiding this comment.
I believe that this new sub-command should belong to the false arm instead.
If I am not overlooking anything, it seems that one can run rustup ci without any installed toolchain.
There was a problem hiding this comment.
@FranciscoTGouveia Good catch!
Actually, however, it depends on how https://github.com/rust-lang/rustup/pull/5021/changes#r3843602435 should be addressed so it's still a bit hard to say... If it involves determining the active cargo version then everything changes.
| CARGO_INCREMENTAL=0 | ||
| CARGO_PROFILE_DEV_DEBUG=0 | ||
| CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse | ||
| CARGO_TERM_COLOR=always |
There was a problem hiding this comment.
Will this command be used outside GitHub Actions? I know that GitHub Actions is good with ANSI color.
Part of #5011.
This first version has implemented a few main subcommands:
rustup ci env: prints a hardcodedbase.envtaken from Provide a built-in way for rustup to adapt to a CI environment #5011 (comment).rustup ci problem-matcher github: prints a hardcoded problem matcher configuration for GitHub1.Footnotes
Taken from @r7kamura's solution (https://github.com/r7kamura/rust-problem-matchers/blob/7e46a19e8d2f3a44f97b551aee14a7b3cc18fcd0/.github/matchers.json) since it seems to be the most comprehensive of all. ↩