[MSYS2] Allow default host triple to be overridden by an environment variable
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
Bắt đầu bằng cách lần theo cách rustup phân giải các đặc tả toolchain không đủ định danh và cách host mặc định đã cấu hình được nạp. Kiểm tra phần thảo luận để tìm các ràng buộc thiết kế hiện có, sau đó xác minh rằng host được cung cấp từ môi trường chỉ ảnh hưởng đến các đặc tả không đủ định danh, trong khi các host tường minh và việc lựa chọn channel vẫn không thay đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Rust
- Star
- 7.1k
- Fork
- 1.1k
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 43
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rust-lang/rustup
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
rust-lang/rustup#5172 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement O-shell
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Rustup OOMCó thể đã có người làm @Kaileshwar16 đã nhận 2 ngày trước. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
rust-lang/rustup#5173 · 9 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
1.29.3 release planningĐang mởrelease
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 20/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Better setup experience for third-party packagers?Có thể đã có người làm @rami3l đã nhận 7 ngày trước. Đang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
rust-lang/rustup#5149 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rust-lang/rustup
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
could docs good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
README em inglêsĐang mởgood first issue help wanted priority:p2 type:docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
lucacasanova/homedeck#122 ·
-
needs-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
bherbruck/solvecraft#11729 · 1 bình luận · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày