Skip to content

Conversation

@Zalathar
Copy link
Member

Some tests only apply to ELF targets, or want to enable different test revisions for ELF and non-ELF targets. So compiletest supports the //@ only-elf and //@ ignore-elf directives to make that possible.

Historically, deciding whether the current target is an ELF target relied on a handful of ad-hoc string comparisons against the target tuple.

However, nowadays compiletest has access to the output of --print=all-target-specs-json, and that JSON output specifies the binary format of each target, making it much easier to determine whether a target is ELF or not.

@rustbot
Copy link
Collaborator

rustbot commented Nov 18, 2025

compiletest directives have been modified. Please add or update docs for the
new or modified directive in src/doc/rustc-dev-guide/.

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Nov 18, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 18, 2025

r? @clubby789

rustbot has assigned @clubby789.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@clubby789
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Nov 18, 2025

📌 Commit 7560717 has been approved by clubby789

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 18, 2025
bors added a commit that referenced this pull request Nov 18, 2025
Rollup of 4 pull requests

Successful merges:

 - #148970 (std: sys: fs: uefi: Implement stat)
 - #149020 (flush_delayed: add note about stashed diagnostics)
 - #149026 (Add test for href of reexported enum variant)
 - #149049 (compiletest: Use JSON "binary-format" to decide `//@ only-elf` and `//@ ignore-elf`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6120f0d into rust-lang:main Nov 18, 2025
11 checks passed
rust-timer added a commit that referenced this pull request Nov 18, 2025
Rollup merge of #149049 - Zalathar:only-elf, r=clubby789

compiletest: Use JSON "binary-format" to decide `//@ only-elf` and `//@ ignore-elf`

Some tests only apply to ELF targets, or want to enable different test revisions for ELF and non-ELF targets. So compiletest supports the `//@ only-elf` and `//@ ignore-elf` directives to make that possible.

Historically, deciding whether the current target is an ELF target relied on a handful of ad-hoc string comparisons against the target tuple.

However, nowadays compiletest has access to the output of `--print=all-target-specs-json`, and that JSON output specifies the binary format of each target, making it much easier to determine whether a target is ELF or not.
@rustbot rustbot added this to the 1.93.0 milestone Nov 18, 2025
@Zalathar Zalathar deleted the only-elf branch November 18, 2025 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants