Skip to content

fix(rust): restore the components a toolchain's profile requires - #14525

Merged
jdx merged 3 commits into
jdx:mainfrom
JamBalaya56562:fix-rust-profile-components
Oct 16, 2026
Merged

jdx merged 3 commits into
jdx:mainfrom
JamBalaya56562:fix-rust-profile-components

Conversation

@JamBalaya56562

@JamBalaya56562 JamBalaya56562 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

mise install checks that an existing Rust toolchain still has the components its profile installed, but it only checked default's clippy, rust-docs and rustfmt. If cargo, rustc or the host's rust-std went missing, mise reported the toolchain as installed and left it broken:

[tools]
rust = { version = "1.81.0", profile = "minimal" }
$ rustup component remove --toolchain 1.81.0 cargo rust-std
$ mise install
mise all tools are installed
$ mise exec -- cargo --version
...
help: run `rustup component add cargo` to install it

mise install now treats cargo, rust-std and rustc as required for the minimal and default profiles, alongside default's three, and passes any missing ones to rustup as --component.

A component now counts only for the toolchain's own host when that host is known, read from its rustc-<triple> component, since rustc only exists for the host. Before, a component with any target suffix counted, so a cross target's rust-std-wasm32-unknown-unknown would have satisfied the host's rust-std. When rustc itself is missing, the host is unknown and any target suffix still counts as before. The toolchain is reinstalled anyway, because rustc is missing.

This takes over #12816 by @risu729, which pr-closer closed after 7 days without contributor activity. They are credited as co-author. Its profile-alias part has since merged as #14220. Its open CodeRabbit Major was that a failed rustup show active-toolchain left the host unset and then accepted only unsuffixed names, so a toolchain would be reinstalled on every run. Taking the host from the installed rustc instead needs no extra rustup call, and an unknown host falls back to the old matching. rust-mingw, which the minimal profile also installs on windows-gnu hosts, is left out.

Validation

  • With the real rustup in a Linux rust:1 container, rust = { version = "1.81.0", profile = "minimal" }, then rustup component remove --toolchain 1.81.0 cargo rust-std:
    • Released 2026.10.11: mise install rust --dry-run-code reports already installed, mise install leaves only rustc-x86_64-unknown-linux-gnu, and cargo does not run.
    • This branch: the dry run reports would install, mise install restores cargo-x86_64-unknown-linux-gnu and rust-std-x86_64-unknown-linux-gnu, and mise exec -- cargo --version prints cargo 1.81.0.
  • e2e/core/test_rust_components_reconcile gains that case with the host's cargo and rust-std removed and a cross target's rust-std left behind. Its fake rustup now gives a new toolchain the host-suffixed cargo, rust-std and rustc, as rustup does. It fails with the released binary and passes with this branch.
  • New unit tests cover the host-only matching and each profile's components; plugins::core::rust tests pass.
  • cargo clippy --workspace --all-features --all-targets -- -D warnings passes.

AI-assisted β€” Tool: Claude Code; model: anthropic/claude-opus-5-5; version: unavailable.

πŸ€– Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • mise install now ensures Rust toolchains have the components required by their configured profile, including host components even when cross-target components are installed.
    • Toolchains missing required components are no longer reported as fully installed.
  • Documentation
    • Clarified that installing an existing Rust toolchain adds missing configured components and those included in its profile.

Co-authored-by: Taku Kodama <79110363+risu729@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack β†’

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration
  • Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: aec88c11-9c22-4c55-b974-a1ae3cbf064b
πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 3c7d754 and c9de88a.

πŸ“’ Files selected for processing: 3
  • e2e/core/test_rust_config_env_homes
  • e2e/core/test_rust_mr_boxington
  • e2e/core/test_rust_stable_upgrade

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

πŸ“ Walkthrough

Rust installation now derives required components from the selected toolchain profile and checks host components against the installed host. Tests cover reconciliation of missing components, and the documentation describes behavior for already-installed toolchains.

Changes: Rust component reconciliation

Layer / File(s) Summary
Profile requirements and host matching
src/plugins/core/rust.rs
minimal requires cargo, rust-std, and rustc. default also requires clippy, rust-docs, and rustfmt. When the host is known, a cross-target rust-std does not match the host requirement.
Installation reconciliation and validation
src/plugins/core/rust.rs, e2e/core/test_rust_components_reconcile, e2e/core/test_rust_config_env_homes, e2e/core/test_rust_mr_boxington, e2e/core/test_rust_stable_upgrade, docs/lang/rust.md
Installation and satisfaction checks use profile-derived components. Tests cover missing host components and retain a cross-target standard library. Mock component lists include host components. The documentation describes adding missing profile components to an installed toolchain.

Priority: βž– Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: jdx

Merge Risk: βšͺ Minimal Β· up to c9de8

The changes reconcile missing profile components, and the reviewed fixtures reflect the expected host components. No actionable merge-blocking risk is established in the reviewed changes.

Pre-merge checks: Passed 4 Β· Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 63.64% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 1 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: restoring Rust components required by a toolchain profile.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 63.64% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 1 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
  • Autofix Β· Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Restores missing Rust profile components and distinguishes the host’s standard library from cross-target copies.

  • Rust installs restore components required by the selected profile.

Reviews (3) Β· Last reviewed commit: "test(rust): list the host components fro..." Β· Reviewed by Greptile

Comment thread e2e/core/test_rust_components_reconcile Resolved
JamBalaya56562 and others added 2 commits October 16, 2026 18:29
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jdx
jdx enabled auto-merge (squash) October 16, 2026 12:13
@jdx
jdx merged commit c585c7a into jdx:main Oct 16, 2026
64 checks passed
@JamBalaya56562
JamBalaya56562 deleted the fix-rust-profile-components branch October 16, 2026 13:26
jdx pushed a commit that referenced this pull request Oct 17, 2026
<!-- entire-trail-link-start -->
https://entire.io/gh/jdx/mise/trails/781
<!-- entire-trail-link-end -->

### πŸš€ Features

- **(bootstrap)** template repo url and ref, add clone options by @jdx
in [#14548](#14548)
- **(ls-remote)** list every version range of a registry tool by @jdx in
[#14544](#14544)
- **(registry)** let one backend carry different options per version
range by @jdx in [#14543](#14543)
- **(vfox)** allow a headers table in the PreInstall result by @jdx in
[#14531](#14531)

### πŸ› Bug Fixes

- **(ci)** install zipsign with --locked by @fang2hou in
[#14551](#14551)
- **(github)** install each version with its own request options by
@JamBalaya56562 in [#14537](#14537)
- **(hooks)** run task hooks with mise instead of the initiating tool
shim by @jdx in [#14550](#14550)
- **(install)** keep lockfile resolution when a linked version doesn't
match the request by @jdx in
[#14539](#14539)
- **(java)** skip the catalog fetch when installing a locked build by
@jdx in [#14534](#14534)
- **(lock)** keep other platforms' option variants when mise link
rewrites mise.lock by @jdx in
[#14519](#14519)
- **(ruby)** lock windows platforms when running mise lock on Windows by
@jdx in [#14520](#14520)
- **(ruby)** lock linux and macos platforms when running mise lock on
Windows by @jdx in [#14529](#14529)
- **(rust)** restore the components a toolchain's profile requires by
@JamBalaya56562 in [#14525](#14525)
- **(shim)** keep task lazy tool shims when a task installs another tool
by @jdx in [#14533](#14533)
- **(task)** avoid deadlock when parallel tasks install the same tool by
@jdx in [#14536](#14536)
- **(watch)** exit quietly when watchexec is interrupted with Ctrl+C by
@jdx in [#14541](#14541)

### πŸ“š Documentation

- say OpenTelemetry export and spinel installs need experimental by
@ZainnQureshii in [#14552](#14552)

### ◀️ Revert

- Revert "chore(deps): pin zipsign-api to 0.2.1" by @jdx in
[baafe33](baafe33)

### πŸ“¦οΈ Dependency Updates

- pin zipsign-api to 0.2.1 by @jdx in
[6d1bd25](6d1bd25)
- rerun providers when mise recreates the venv by @halms in
[#14532](#14532)

### πŸ“¦ Registry

- prefer signed xcsift releases and enable Linux by @jdx in
[#14540](#14540)
- install protoc-gen-connect-go v2 from its /v2 module path by @jdx in
[#14545](#14545)

### Chore

- **(release)** pin zipsign install to 0.2.1 by @jdx in
[d5ef6f9](d5ef6f9)

### Security

- **(config)** ignore [settings] from untrusted project configs by @jdx
in [#14538](#14538)

### New Contributors

- @ZainnQureshii made their first contribution in
[#14552](#14552)
- @fang2hou made their first contribution in
[#14551](#14551)
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.

2 participants