Skip to content

[nextest-runner] support "host-tuple" as a target triple#2872

Merged
sunshowers merged 1 commit into
mainfrom
host-tuple
Jan 1, 2026
Merged

[nextest-runner] support "host-tuple" as a target triple#2872
sunshowers merged 1 commit into
mainfrom
host-tuple

Conversation

@sunshowers

Copy link
Copy Markdown
Member

Recent Rust versions added --target host-tuple support, allowing users to explicitly do a cross-compile targeting the host platform. This change adds support for "host-tuple" as a special target string that resolves to the detected host platform.

Closes #2858.

Recent Rust versions added `--target host-tuple` support, allowing users to
explicitly do a cross-compile targeting the host platform. This change adds
support for "host-tuple" as a special target string that resolves to the
detected host platform.

Closes #2858.

Copilot AI left a comment

Copy link
Copy Markdown

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 adds support for "host-tuple" as a special target triple value that resolves to the host platform, matching recent Rust compiler functionality that allows --target host-tuple to explicitly cross-compile targeting the host platform.

Key Changes:

  • Modified TargetTriple::find and related methods to accept a host_platform parameter used to resolve "host-tuple"
  • Added special case handling in resolve_triple to detect "host-tuple" and return the host platform
  • Updated all call sites to pass the host platform information
  • Added comprehensive test coverage for "host-tuple" across all configuration sources (CLI, env var, config file)

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
nextest-runner/src/cargo_config/target_triple.rs Core implementation: added host_platform parameter to find, from_env, from_cargo_configs, and resolve_triple methods; added "host-tuple" special case handling; added comprehensive tests
cargo-nextest/src/dispatch/helpers.rs Updated detect_build_platforms and discover_target_triple to pass host platform to TargetTriple::find
nextest-runner/src/config/utils/test_helpers.rs Updated test helper to create and pass dummy host platform to TargetTriple::find
nextest-runner/tests/integration/target_runner.rs Updated integration test to pass host platform from detected host to TargetTriple::find
nextest-runner/tests/integration/target_triple.rs Added dummy_host_platform helper and updated target_triple test function to pass host platform

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

@@ -96,10 +96,12 @@ impl TargetTriple {
/// 2. the CARGO_BUILD_TARGET env var
/// 3. build.target in Cargo config files
///

Copilot AI Jan 1, 2026

Copy link

Choose a reason for hiding this comment

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

The documentation for the find method should mention that "host-tuple" can be used as a special target triple value that resolves to the host platform. While line 99 mentions the host_platform parameter is used to resolve "host-tuple", it would be clearer to explicitly state in the method's main documentation (around line 91-98) that callers can pass "host-tuple" as a value for target_cli_option or set it in environment variables/config files.

Suggested change
///
///
/// Any of these sources may specify the special target triple value `"host-tuple"`, which
/// resolves to the host platform.
///

Copilot uses AI. Check for mistakes.
@codecov

codecov Bot commented Jan 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.55072% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.63%. Comparing base (0a34643) to head (69e9b84).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
nextest-runner/src/cargo_config/target_triple.rs 98.48% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2872      +/-   ##
==========================================
+ Coverage   80.55%   80.63%   +0.07%     
==========================================
  Files         115      115              
  Lines       27880    28008     +128     
==========================================
+ Hits        22459    22584     +125     
- Misses       5421     5424       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sunshowers sunshowers merged commit 8960268 into main Jan 1, 2026
29 checks passed
@sunshowers sunshowers deleted the host-tuple branch January 1, 2026 07:10
@trunk-io

trunk-io Bot commented Jan 1, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

1 similar comment
@trunk-io

trunk-io Bot commented Jan 1, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

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.

2 participants