Skip to content

fix(dist): write lib/rustlib/components in sorted order - #5199

Closed
fenollp wants to merge 1 commit into
rust-lang:mainfrom
fenollp:sortcomps
Closed

fenollp wants to merge 1 commit into
rust-lang:mainfrom
fenollp:sortcomps

Conversation

@fenollp

@fenollp fenollp commented Nov 6, 2026

Copy link
Copy Markdown

Installing the same toolchain twice can produce different $RUSTUP_HOME/toolchains/$RUSTUP_TOOLCHAIN/lib/rustlib/components files:

rustup-init -y --no-modify-path --profile minimal \
  --default-toolchain 1.94.0-x86_64-unknown-linux-gnu

yields cargo\nrust-std\nrustc\n and sometimes rust-std\ncargo\nrustc\n.

@rami3l

rami3l commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

@fenollp Thanks for the patch!

I think as per the previous discussion in #4853 (comment), fully reproducible lib/rustlib/components is not a contract to be upheld by rustup-managed toolchains in general, since rustup's global states are mutable in nature.

If you are packaging for Nix/NixOS/Guix and friends and you want to "freeze" a toolchain installed by rustup, using the workaround #4853 (comment) is the way to go.

Installing the same toolchain twice can produce different
`$RUSTUP_HOME/toolchains/$RUSTUP_TOOLCHAIN/lib/rustlib/components` files:

    rustup-init -y --no-modify-path --profile minimal \
      --default-toolchain 1.94.0-x86_64-unknown-linux-gnu

yields `cargo\nrust-std\nrustc\n` and sometimes `rust-std\ncargo\nrustc\n`.

Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
@fenollp

fenollp commented Nov 7, 2026

Copy link
Copy Markdown
Author

Oh well! Sorry I missed that and thanks for your answer. I guess we can close this now?

@rami3l

rami3l commented Nov 7, 2026

Copy link
Copy Markdown
Member

@fenollp Yes, many thanks for your comprehension!

@rami3l rami3l closed this Nov 7, 2026
@fenollp
fenollp deleted the sortcomps branch November 7, 2026 10:24
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