feat(config): allow the default host to be overridden with `RUSTUP_DE… - #5026
Closed
pgalbraith wants to merge 1 commit into
Closed
feat(config): allow the default host to be overridden with `RUSTUP_DE…#5026pgalbraith wants to merge 1 commit into
pgalbraith wants to merge 1 commit into
Conversation
…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
Author
|
Withdrawing per discussion on linked issue: this may not be an issue at all. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.