Skip to content

compiletest: Remove the libtest-based executor and its dependency #140392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2025

Conversation

Zalathar
Copy link
Contributor

@Zalathar Zalathar commented Apr 28, 2025

Now that #140288 has landed and the new compiletest executor is used by default, we can now move forward with removing the libtest dependency from compiletest.

My hope is that after landing this, we can configure bootstrap to build compiletest with the pre-built stage0 library by default, instead of the in-tree stage0 library. That would give the stage0 redesign one less thing to worry about.


This PR has deliberately been kept small and simple, to make it easier to revert if necessary. Further cleanup can take palce after we're confident that it won't need to be reverted.

r? jieyouxu

Blocker for #119899

This patch has deliberately been kept small and simple, to make it easier to
revert if necessary. Further cleanup can take palce after we're confident that
it won't need to be reverted.
@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 Apr 28, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 28, 2025

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@jieyouxu
Copy link
Member

jieyouxu commented Apr 28, 2025

I think we should keep the libtest executor until the next stable release (2025-05-15 (in 16 days)) in case something goes horribly wrong (seems very unlikely, but as a backup plan) during stable release or whatever. Wdyt?

EDIT: but I guess we'd have to do changes and reverts anyway.

@Zalathar
Copy link
Contributor Author

Hmm, at the very least it’s probably a good idea to avoid any subsequent cleanup that would make this harder to revert, until after the next beta.

But I think it should be fine to land something like this change (or perhaps an even easier-to-revert variant) in the near-ish future.

@jieyouxu
Copy link
Member

jieyouxu commented Apr 28, 2025

If we really ought to

avoid any subsequent cleanup that would make this harder to revert, until after the next beta

then I think we might want to hold this off until next beta anyway. We can still land stage 0 redesign PR without this PR (if that might happen), keeping the compiletest-stage0 hack, and then rip out the stage0 hack after landing stage 0 redesign, then this.

@Zalathar
Copy link
Contributor Author

Zalathar commented Apr 29, 2025

In the medium-term (i.e. after this and the stage 0 redesign have both landed), the situation I hope to be in is:

  • Compiletest uses pre-built stage0 std by default for all contributors (despite using internal_output_capture).
  • There is a bootstrap flag to force it to use in-tree stage1 std instead, but this is only enabled in a small number of CI jobs (to make sure it actually works), for the benefit of distros etc that want to bootstrap with a same-version compiler instead of previous-beta.
  • In the unlikely (?) event that the internal_output_capture API changes before we eventually stop using it, compiletest would use cfg(bootstrap) to account for the differences.

Removing the libtest dependency before landing the stage 0 redesign is not strictly necessary, because we do have the stage0 hack, and it's likely that the libtest dependency will be removed before any internal details of libtest actually change (which is what would break the hack).

But I would prefer to not to force compiler contributors to have to think about the hack if reasonably possible.

@jieyouxu
Copy link
Member

I thought about this some more. Let's land this, I'll put a hold on any further compiletest adjustments that would complicate reverting libtest removal until next beta. Agreed that ideally, compiler contributors won't have to worry about the compiletest stage0 hack.

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 29, 2025

📌 Commit cbfc364 has been approved by jieyouxu

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 Apr 29, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Apr 29, 2025
compiletest: Remove the libtest-based executor and its dependency

Now that rust-lang#140288 has landed and the new compiletest executor is used by default, we can now move forward with removing the libtest dependency from compiletest.

My hope is that after landing this, we can configure bootstrap to build compiletest with the pre-built stage0 library by default, instead of the in-tree stage0 library. That would give the stage0 redesign one less thing to worry about.

---

This PR has deliberately been kept small and simple, to make it easier to revert if necessary. Further cleanup can take palce after we're confident that it won't need to be reverted.

r? jieyouxu
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 29, 2025
Rollup of 6 pull requests

Successful merges:

 - rust-lang#139883 (crashes: more tests)
 - rust-lang#140312 (Improve pretty-printing of braces)
 - rust-lang#140392 (compiletest: Remove the libtest-based executor and its dependency)
 - rust-lang#140395 (organize and extend forbidden target feature tests)
 - rust-lang#140422 (unwind: bump `unwinding` dependency to 0.2.6)
 - rust-lang#140432 (Update documentation for `fn target_config`)

r? `@ghost`
`@rustbot` modify labels: rollup
@jyn514
Copy link
Member

jyn514 commented Apr 29, 2025

this is really amazing work, thank you both so much <3

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 29, 2025
Rollup of 7 pull requests

Successful merges:

 - rust-lang#138344 (Enable `reliable_f16_math` on x86)
 - rust-lang#139909 (implement or-patterns for pattern types)
 - rust-lang#140392 (compiletest: Remove the libtest-based executor and its dependency)
 - rust-lang#140400 (PassWrapper: adapt for llvm/llvm-project@d3d856ad8469)
 - rust-lang#140422 (unwind: bump `unwinding` dependency to 0.2.6)
 - rust-lang#140432 (Update documentation for `fn target_config`)
 - rust-lang#140433 (Replace the \01__gnu_mcount_nc to LLVM intrinsic for additional ARM targets)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f7110fa into rust-lang:master Apr 29, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 29, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 29, 2025
Rollup merge of rust-lang#140392 - Zalathar:goodbye-libtest, r=jieyouxu

compiletest: Remove the libtest-based executor and its dependency

Now that rust-lang#140288 has landed and the new compiletest executor is used by default, we can now move forward with removing the libtest dependency from compiletest.

My hope is that after landing this, we can configure bootstrap to build compiletest with the pre-built stage0 library by default, instead of the in-tree stage0 library. That would give the stage0 redesign one less thing to worry about.

---

This PR has deliberately been kept small and simple, to make it easier to revert if necessary. Further cleanup can take palce after we're confident that it won't need to be reverted.

r? jieyouxu

Blocker for rust-lang#119899
@Zalathar Zalathar deleted the goodbye-libtest branch April 30, 2025 00:20
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.

5 participants