Skip to content

feat(config): allow the default host to be overridden with `RUSTUP_DE… - #5026

Closed
pgalbraith wants to merge 1 commit into
rust-lang:mainfrom
pgalbraith:pgalbraith/override-default-host
Closed

feat(config): allow the default host to be overridden with `RUSTUP_DE…#5026
pgalbraith wants to merge 1 commit into
rust-lang:mainfrom
pgalbraith:pgalbraith/override-default-host

Conversation

@pgalbraith

Copy link
Copy Markdown

Delivers the suggested override in #5024.

Allow overriding the default host from env var RUSTUP_DEFAULT_HOST. Allows for env-based global toolchain (msvc, gnu, gnullvm) selection while still respecting project-level channel selection. Preferable to setting RUSTUP_TOOLCHAIN at the env level because that would pin channel/version across all projects.

This also documents the new env var and also updates 'rustup show' to unambiguously explain how the current default host has been derived.

…FAULT_HOST`

- Complete a toolchain name that doesn't specify a host from the
  `RUSTUP_DEFAULT_HOST` environment variable when it is set, in
  preference to the `default_host_tuple` setting. A host named in the
  toolchain specification still wins, and unlike `RUSTUP_TOOLCHAIN` this
  doesn't select the toolchain, so a `rust-toolchain.toml` that pins a
  channel keeps its say over the version. This lets environments that
  share a `RUSTUP_HOME` while requiring different host ABIs, such as
  MSYS2's UCRT64 and CLANG64 shells, pick their own host ABI without
  touching the configuration the other environments read.
- Report in `rustup show` where the default host was taken from, whether
  that is the environment variable, the settings file, or detection.
- Warn on `rustup set default-host` that what it writes won't take effect
  while `RUSTUP_DEFAULT_HOST` remains set.
- Document that a host-qualified default toolchain — the only kind
  earlier rustup versions could store — is unreachable by this
  variable, and how to check for and fix that.

Fixes rust-lang#5024
@pgalbraith

Copy link
Copy Markdown
Author

Withdrawing per discussion on linked issue: this may not be an issue at all.

@pgalbraith pgalbraith closed this Aug 21, 2026
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.

1 participant