Skip to content
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

Port tests/run-make-fulldeps/obtain-borrowck to ui-fulldeps #126073

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions tests/run-make-fulldeps/obtain-borrowck/Makefile

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(dead_code)]

trait X {
fn provided(&self) -> usize {
5
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
//@ edition: 2021
//@ run-pass
//@ check-run-results
//@ run-flags: --sysroot {{sysroot-base}} --edition=2021 {{src-base}}/auxiliary/obtain-borrowck-input.rs
//@ ignore-stage1 (requires matching sysroot built with in-tree compiler)
Copy link
Contributor Author

@Zalathar Zalathar Jun 6, 2024

Choose a reason for hiding this comment

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

Incidentally, I was able to track down why these tests require stage 2 in ui-fulldeps.

It's because #110478 made “stage 1” tests in ui-fulldeps actually use the stage 0 compiler, so the test tries to use an in-tree compiler (via API) with a bootstrap sysroot, and predictably fails.

I have an idea of how to solve this (pass along two sysroots and let fulldeps tests select the correct one), but I haven't decided whether it's worth the extra complexity.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh god.

Copy link
Contributor

@jieyouxu jieyouxu Jun 6, 2024

Choose a reason for hiding this comment

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

@Zalathar do you mind opening an issue for that so we don't lose track of it (since you probably have more context than me) and other people might chime in? And leaving a FIXME pointing to that?

Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't surveyed all of the ui-fulldeps tests, but I would be very surprised if any of the tests actually relies on having the stage 2 sysroot being available?

Copy link
Contributor Author

@Zalathar Zalathar Jun 6, 2024

Choose a reason for hiding this comment

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

From what I can tell, ui-fulldeps tests fall into two categories:

  • Those that use rustc crates in a way that doesn’t need a sysroot, so using stage 0 is fine and useful.
  • Those that use rustc crates to invoke the compiler and thus need a suitable sysroot, so they’re all ignore-stage1.

Copy link
Contributor

@jieyouxu jieyouxu Jun 6, 2024

Choose a reason for hiding this comment

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

Ah I see, thanks for the explanation.

I have an idea of how to solve this (pass along two sysroots and let fulldeps tests select the correct one), but I haven't decided whether it's worth the extra complexity.

Seems reasonable to me, but I would like experts on T-bootstrap/T-compiler to help us diagnose if this the right fix for the interaction.

Copy link
Member

@jyn514 jyn514 Jun 6, 2024

Choose a reason for hiding this comment

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

i would also caution you, like, weigh the time it would take to get these working with stage1 against the time it would take to just build both sysroots
it's not super common to need to run ui-fulldeps tests locally

Copy link
Member

Choose a reason for hiding this comment

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

you don't want to know how long it took me to get #110478 working

Copy link
Contributor

Choose a reason for hiding this comment

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

Lol. In that case, we should probably just leave it as is.

// ignore-tidy-linelength

#![feature(rustc_private)]

//! This program implements a rustc driver that retrieves MIR bodies with
Expand Down
Loading