-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Partial support for running UI tests with download-rustc
#103969
Conversation
r? @jyn514 (rustbot has picked a reviewer for you, use r? to override) |
src/bootstrap/lib.rs
Outdated
@@ -1034,13 +1034,17 @@ impl Build { | |||
} | |||
|
|||
fn debuginfo_map_to(&self, which: GitRepo) -> Option<String> { | |||
if !self.config.rust_remap_debuginfo { | |||
if !self.config.rust_remap_debuginfo && self.config.download_rustc_commit.is_none() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would this matter? if we're not remapping debuginfo, we shouldn't need this either way, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compiletest only replaces the /rustc/$sha1
paths with a placeholder when the CFG_VIRTUAL_RUST_SOURCE_BASE_DIR
environment variable is passed to it at build time, and right now this is the way to set that.
I guess I could change the implementation and instead of changing this setting globally, pass to compiletest another prefix to normalize when download-rustc is enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah I see, it needs to remap the source directory because the one we've downloaded from CI is not in the path the tests expect. That seems reasonable, can you add it as a comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I could change the implementation and instead of changing this setting globally, pass to compiletest another prefix to normalize when download-rustc is enabled.
Ended up with this approach, as there is way less risk of unintended side effects this way.
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
79a7621
to
8c5e6a8
Compare
☔ The latest upstream changes (presumably #104188) made this pull request unmergeable. Please resolve the merge conflicts. |
8c5e6a8
to
470423c
Compare
@bors r+ |
🌲 The tree is currently closed for pull requests below priority 1. This pull request will be tested once the tree is reopened. |
// Source base on the sysroot (from the src components downloaded by `download-rustc`): | ||
Some(self.config.sysroot_base.join("lib").join("rustlib").join("src").join("rust")), | ||
// Virtual `/rustc/$sha` remapped paths (if `remap-debuginfo` is enabled): | ||
option_env!("CFG_VIRTUAL_RUST_SOURCE_BASE_DIR").map(PathBuf::from), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Could use this in cg_clif too: https://github.com/bjorn3/rustc_codegen_cranelift/blob/d1e499aa2d5e16eab6b70c04b28bd04b67de3c60/scripts/setup_rust_fork.sh#L30-L47
Edit: done in bjorn3/rustc_codegen_cranelift@9723c79
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#103117 (Use `IsTerminal` in place of `atty`) - rust-lang#103969 (Partial support for running UI tests with `download-rustc`) - rust-lang#103989 (Fix build of std for thumbv7a-pc-windows-msvc) - rust-lang#104076 (fix sysroot issue which appears for ci downloaded rustc) - rust-lang#104469 (Make "long type" printing type aware and trim types in E0275) - rust-lang#104497 (detect () to avoid redundant <> suggestion for type) - rust-lang#104577 (Don't focus on notable trait parent when hiding it) - rust-lang#104587 (Update cargo) - rust-lang#104593 (Improve spans for RPITIT object-safety errors) - rust-lang#104604 (Migrate top buttons style to CSS variables) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Right now trying to run UI tests with
download-rustc
results in a bunch of test failures, requiring someone who wants to only work on tests to also build the full compiler. This PR partially addresses the problem by solving a lot of the errors (but not all).rust-src
component on CI toolchains, since the test output depends on whether the standard library source code is installed; We can't just symlink the current source because therustc-dev
component already includes the compiler sources, but not the library sources, and mixing things is worse IMO.$SRC_DIR
normalization done by compiletest correctly handles the source code added above.remap-prefix
to the prefix used in the downloaded toolchain, to ensure compiletest normalizes it.