Skip to content

feat(cli/rustup-mode): add rustup ci subcommand - #5021

Open
rami3l wants to merge 1 commit into
rust-lang:mainfrom
rami3l:x/rustup-ci-subcmd
Open

feat(cli/rustup-mode): add rustup ci subcommand#5021
rami3l wants to merge 1 commit into
rust-lang:mainfrom
rami3l:x/rustup-ci-subcmd

Conversation

@rami3l

@rami3l rami3l commented Aug 18, 2026

Copy link
Copy Markdown
Member

Part of #5011.

This first version has implemented a few main subcommands:

Footnotes

  1. 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.

Comment thread src/cli/ci/base.env
CARGO_PROFILE_DEV_DEBUG=0
CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
CARGO_TERM_COLOR=always
CARGO_UNSTABLE_SPARSE_REGISTRY=true

@rami3l rami3l Aug 18, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/cli/ci/base.env
@@ -0,0 +1,6 @@
CARGO_INCREMENTAL=0
CARGO_PROFILE_DEV_DEBUG=0
CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse

@rami3l rami3l Aug 18, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weihanglo Is it safe to always set this flag similarly to #5021 (comment)?

View changes since the review

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably could test pre-1.61 1.61 to 1.68, and post 1.68

@r7kamura

Copy link
Copy Markdown

Feel free to use my solution for whatever you need👍
It actually came from the issue and PR below, so check 'em out if you're interested:

@rami3l
rami3l force-pushed the x/rustup-ci-subcmd branch from e680603 to d5a9f89 Compare August 18, 2026 14:08
Co-authored-by: r7kamura <r7kamura@gmail.com>
@rami3l
rami3l force-pushed the x/rustup-ci-subcmd branch from d5a9f89 to 5917940 Compare August 18, 2026 14:10
@rami3l

rami3l commented Aug 18, 2026

Copy link
Copy Markdown
Member Author

@r7kamura Thanks a lot for the extra context! I've made you the co-author for this commit as a sign of appreciation.

@rami3l
rami3l marked this pull request as ready for review August 19, 2026 10:56
Comment thread src/cli/rustup_mode.rs
// For all other subcommands, the hint may be useful if rustup is still unusable after
// the command has completed.
Self::Check { .. }
| Self::Ci { .. }

@FranciscoTGouveia FranciscoTGouveia Aug 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

View changes since the review

@rami3l rami3l Aug 24, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Comment thread src/cli/ci/base.env
CARGO_INCREMENTAL=0
CARGO_PROFILE_DEV_DEBUG=0
CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
CARGO_TERM_COLOR=always

@weihanglo weihanglo Aug 24, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this command be used outside GitHub Actions? I know that GitHub Actions is good with ANSI color.

View changes since the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants