[MSYS2] Allow default host triple to be overridden by an environment variable
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず、rustup が修飾されていない toolchain 仕様をどのように解決し、設定されたデフォルトのホストをどのように読み込むかを追跡します。既存の設計上の制約について議論を確認し、その後、環境から提供されたホストが修飾されていない仕様にのみ影響し、明示的なホストとチャンネルの選択は変更されないことを検証します。
索引モデルが issue の本文から書いたものです。
説明
Problem you are trying to solve
MSYS2 on Windows provides multiple development environments which can share the same $HOME and therefore the same rustup configuration, but which require different Rust host ABIs. For example:
native Windows → x86_64-pc-windows-msvc
UCRT64 → x86_64-pc-windows-gnu
CLANG64 → x86_64-pc-windows-gnullvm
The appropriate host is therefore a property of the current development environment rather than of the user, machine, or project.
At the same time, a project may want to pin its Rust version without pinning its host ABI:
[toolchain]
channel = "1.97"
Ideally, the same project would then resolve that partial toolchain specification according to the active environment:
native Windows → 1.97-x86_64-pc-windows-msvc
UCRT64 → 1.97-x86_64-pc-windows-gnu
CLANG64 → 1.97-x86_64-pc-windows-gnullvm
Rustup already supports this distinction conceptually: an unqualified toolchain such as 1.97 is completed using rustup's default host. However, the default host is persisted in rustup's configuration, so environments sharing the same rustup home cannot have different defaults.
RUSTUP_TOOLCHAIN does not solve the problem because it selects the complete toolchain and overrides rust-toolchain.toml. Using it to select the ABI would therefore also override the project's choice of Rust version.
Separate RUSTUP_HOMEs can provide separate persisted default hosts, but that makes the host choice a property of separate rustup installations. For environments such as MSYS2, the host choice is naturally a property of the currently active shell environment, while the environments otherwise share the same home directory, projects, and installed tooling.
Solution you'd like
Add an environment variable, perhaps RUSTUP_DEFAULT_HOST, which overrides rustup's configured default host when resolving a toolchain specification that does not contain an explicit host.
For example:
export RUSTUP_DEFAULT_HOST=x86_64-pc-windows-gnullvm
combined with:
[toolchain]
channel = "1.97"
would resolve to:
1.97-x86_64-pc-windows-gnullvm
This would allow environments such as MSYS2 UCRT64 and CLANG64 to set their appropriate default host during environment initialization while continuing to share the same RUSTUP_HOME.
The environment variable would affect only resolution of the omitted host component. It would not select or override the channel/version as RUSTUP_TOOLCHAIN does.
Conceptually, host resolution could follow:
explicit host in toolchain specification
↓
RUSTUP_DEFAULT_HOST
↓
configured default_host_triple
↓
normal rustup host detection/defaulting
An explicitly host-qualified toolchain would therefore remain authoritative, while an unqualified toolchain could inherit its host ABI from the current execution environment.
Notes
No response
- 主要言語
- Rust
- スター
- 7.1k
- フォーク
- 1.1k
- 平均マージ
- 16時間 28分
- マージ済み PR(30日)
- 36
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rust-lang/rustup のほかの issue
-
enhancement O-shell
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
release
難易度 4/5 1〜2日 初心者へのやさしさ 20/100
メンテナーはふだん 1 日以内に返信
-
Solaris support is broken on 1.29.2対応中かも @ChrisDenton が 2 日前に担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
rust-lang/rustup#5164 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 54/100
rust-lang/rustup#5151 · コメント 7 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
rust-lang/rustup#5149 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
rust-lang/rustup の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
status:untriaged
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
midnightntwrk/midnight-zk#592 ·
メンテナーはふだん 3 日以内に返信
-
QuartoHub: have the Document name before the filename in the browser tab対応中かも @cscheid が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
quarto-dev/q2#930 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
muse P3
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
HerringtonDarkholme/hd-lang#923 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信