Repository navigation
fix(rustup-mode): backfill non-native targets on rustup toolchain pin - #5248
Conversation
13ec0ca to
b109aee
Compare
|
I see that there are essentially two cases where we want to have the I eventually decided that since most users are in the first case, this bias is still preferable. If the user is really in the second case, then they can always adjust the generated TOML file just like how we conventionally audit generated SQL migration scripts when working with ORMs. As such, |
b109aee to
e23bdf5
Compare
e23bdf5 to
74a9054
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
There was a problem hiding this comment.
🟡 Changes recommended
The component guard uses the default host instead of the toolchain target, causing an explicitly qualified toolchain’s pinned file to omit an installed target that is then lost on reinstall.
1 open issue
What changed in this PR
This PR updates rustup toolchain pin to record installed non-native standard libraries under targets, addressing the generated-file format problem reported in #5240.
Changes:
- Separate installed components and cross-compilation targets when generating pinned toolchain files.
- Add a shared
Component::is_std()helper for standard-library checks. - Add regression coverage for pinning and reinstalling a toolchain with an extra target.
| File | Description |
|---|---|
tests/suite/cli_rustup.rs |
Add extra-target pinning and reinstall coverage; update snapshots. |
src/toolchain/channels.rs |
Use the shared standard-library predicate. |
src/dist/manifest.rs |
Introduce Component::is_std(). |
src/config.rs |
Expose targets for pinned-file generation. |
src/cli/rustup_mode.rs |
Separate pinned targets from components and adopt the helper. |
src/cli/completions.rs |
Use the helper when selecting target completions. |
Review effort: Balanced
… extra target Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
… pin` without overrides
…pin` Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
74a9054 to
6b51fd7
Compare

Closes #5240 by addressing the concern No. 1 in #5240 (comment):
Previously, non-native targets are populated in the
componentssection like so, causing confusion for both users andrustup toolchain install:This PR has fixed the resulting TOML format so non-native
rust-stdcomponents are put into the targets section rather than in the components section:API migration and generation of tests assisted by Copilot on Claude Sonnet 5.5.