rust-lang / rust-lang/rust

Rework `run-make-support`'s `target` to be a structured API

Open
#148,747 0 comments 0 reactions 1 assignee View on GitHub

@jieyouxu is already working on this.

Since Sep 7, 2026.

A-run-make A-testsuite C-enhancement T-bootstrap T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

run-make tests often need to have target-specific behavior (or have a distinction between host / target). We should make support for that properly structured and not via substring matching. E.g. instead of the various is_windows_msvc and target helpers, introduce a structured target API:

fn host() -> TargetInfo;
fn target() -> Targetinfo;

#[non_exhaustive]
pub struct TargetInfo {
    pub target_tuple: String,
    pub arch: Arch, // possibly with a subarch too
    pub env: Env, // with a Env::None
    pub os: Os, // with a Os::None
    pub vendor: Vendor, // with a Vendor::None
    pub target_family: TargetFamily, // with a TargetFamily::None
}

Also, consider changing the run-make test <-> run_make_support <-> compiletest env vars to be prefixed as internal-only, then only "publicly" expose this to run-make tests.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.