Skip to content

fix: rename partially "Triple" to "Tuple" to reflect the new terminology (pt.2)#4834

Open
motorailgun wants to merge 5 commits intorust-lang:mainfrom
motorailgun:triple-tuple
Open

fix: rename partially "Triple" to "Tuple" to reflect the new terminology (pt.2)#4834
motorailgun wants to merge 5 commits intorust-lang:mainfrom
motorailgun:triple-tuple

Conversation

@motorailgun
Copy link
Copy Markdown
Contributor

@motorailgun motorailgun commented Apr 26, 2026

Partial effort to #4826, and continuous to #4827.

This PR still does not do functionality changes. Opening as draft PR to rely on CI for Windows-only cfgs. <- fixed!

@motorailgun motorailgun marked this pull request as ready for review April 26, 2026 18:41
@rami3l rami3l requested review from Copilot and rami3l April 26, 2026 19:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR continues the terminology migration from “Triple” to “Tuple” (part 2 of the effort), updating types, modules, and user-facing strings without intending behavioral changes.

Changes:

  • Renames TargetTriple/PartialTargetTriple to TargetTuple/PartialTargetTuple across core dist/config/CLI flows.
  • Moves the generated “known targets” list from dist/triple to dist/tuple and updates the generator test accordingly.
  • Updates CLI prompts, logs, and tests/snapshots to say “tuple” instead of “triple”.

Reviewed changes

Copilot reviewed 15 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/suite/known_tuples.rs Updates generator test to target the new src/dist/tuple/known.rs and renames parser helper.
tests/suite/cli_v2.rs Updates tests to use TargetTuple in manifest manipulation.
tests/suite/cli_rustup.rs Renames tests and expected stderr text from “triple” to “tuple”.
tests/suite/cli_inst_interactive.rs Updates interactive installer snapshots/prompts from “host triple” to “host tuple”.
src/toolchain/names.rs Switches resolver APIs and test imports to TargetTuple / tuple::known.
src/toolchain.rs Changes installed-target parsing to return TargetTuple.
src/test/dist.rs Updates mock dist server to construct/insert TargetTuple keys/values.
src/test.rs Updates host detection helper to use TargetTuple::from_host.
src/errors.rs Re-types error fields from TargetTriple to TargetTuple.
src/dist/tuple/known.rs Adds the generated known arch/os/env lists under the new tuple module.
src/dist/tuple.rs Renames PartialTargetTriple to PartialTargetTuple and updates tests/docs accordingly.
src/dist/mod.rs Replaces triple module with tuple, renames TargetTriple to TargetTuple, and updates associated logic/tests.
src/dist/manifestation/tests.rs Updates manifestation tests to construct components with TargetTuple.
src/dist/manifestation.rs Renames manifestation target field to target_tuple and updates comparisons and lookup logic.
src/dist/manifest.rs Switches manifest target maps/components and (de)serialization helpers to TargetTuple.
src/config.rs Updates config flows to use TargetTuple (including default host resolution and checks).
src/cli/setup_mode.rs Renames install option field to default_host_tuple.
src/cli/self_update/windows.rs Updates Windows self-update MSVC checks to use tuple terminology/types.
src/cli/self_update.rs Renames install options field/prompt/logging to “tuple” and updates host/build tuple usage.
src/cli/rustup_mode.rs Updates CLI logic to use TargetTuple for host/target checks and target add/remove.
src/cli/common.rs Updates shared CLI helpers to accept/use TargetTuple.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

View changes since this review

Comment thread src/cli/rustup_mode.rs
Comment on lines +985 to 988
if name.has_tuple() {
let host_arch = TargetTuple::from_host_or_build(cfg.process);
let target_triple = name.clone().resolve(&host_arch)?.target;
common::check_non_host_toolchain(
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This local variable is still named target_triple, but it now holds a TargetTuple. Renaming it to target_tuple would keep terminology consistent and avoid confusion while reading the host/target compatibility check.

Copilot uses AI. Check for mistakes.
Comment on lines +190 to 191
let host_tuple = if let Some(trip) = opts.default_host_tuple.as_ref() {
trip.to_owned()
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The option is now default_host_tuple, but the temporary binding is still named trip. Consider renaming this binding to tuple (or host_tuple) to match the new terminology and reduce confusion in the MSVC detection logic.

Suggested change
let host_tuple = if let Some(trip) = opts.default_host_tuple.as_ref() {
trip.to_owned()
let host_tuple = if let Some(tuple) = opts.default_host_tuple.as_ref() {
tuple.to_owned()

Copilot uses AI. Check for mistakes.
Comment thread src/dist/mod.rs

pub(crate) mod triple;
pub(crate) use triple::*;
pub(crate) mod tuple;
Copy link
Copy Markdown
Member

@rami3l rami3l Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to be a bit more careful here because previously triple as an abbreviation for target_triple is more or less unambiguous. As discussed in #4668, we would like to rename this module to target_tuple instead of just tuple to avoid potential confusion with the builtin tuple type.

PS: In e.g. method names however, this is less of a problem, so you can do nothing for now. If anyone still finds it too problematic, we can use _target to replace _triple later on.

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! So do you mean we want to keep method names with _triple suffix (or whatsoever) as is, while renaming triple module to target_tuple? (Sorry I'm not really good at English)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! So do you mean we want to keep method names with _triple suffix (or whatsoever) as is, while renaming triple module to target_tuple?

@motorailgun My apologies for not being super clear previously!

For method names you can perform the switch from _triple to _tuple as usual, depending on your progress.

If this doesn't feel quite right for you in certain places please let me know.

}

/// Parses the given triple into 3 parts (target architecture, OS and environment).
/// Parses the given tuple into 3 parts (target architecture, OS and environment).
Copy link
Copy Markdown
Member

@rami3l rami3l Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly to b07ea10#r3144041456, this module should be renamed to known_target_tuples. The function names can stay with _tuple.

View changes since the review

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.

3 participants