-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Add test to build crates used by r-a on stable #129529
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
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
893413d
Add a run-make test for checking that certain `rustc_` crates build o…
Kobzol 7957140
inhibit proc-macro2 nightly detection
lqd d9794a9
run test in tmp dir and emit artifacts there
lqd 2190c28
remove use of RUSTC_BOOTSTRAP and cargo nightly features
lqd 0577035
separate the crates to test from the test setup
lqd f1df0c5
remove unneeded type ascription
lqd a178559
address review comments
lqd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use crate::command::Command; | ||
use crate::env_var; | ||
|
||
/// Returns a command that can be used to invoke Cargo. | ||
pub fn cargo() -> Command { | ||
Command::new(env_var("BOOTSTRAP_CARGO")) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
//! Checks if selected rustc crates can be compiled on the stable channel (or a "simulation" of it). | ||
//! These crates are designed to be used by downstream users. | ||
|
||
use run_make_support::{cargo, run_in_tmpdir, rustc_path, source_root}; | ||
|
||
fn main() { | ||
run_in_tmpdir(|| { | ||
// Use the stage0 beta cargo for the compilation (it shouldn't really matter which cargo we | ||
// use) | ||
let cargo = cargo() | ||
lqd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Ensure `proc-macro2`'s nightly detection is disabled | ||
.env("RUSTC_STAGE", "0") | ||
lqd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
.env("RUSTC", rustc_path()) | ||
// We want to disallow all nightly features to simulate a stable build | ||
.env("RUSTFLAGS", "-Zallow-features=") | ||
.arg("build") | ||
.arg("--manifest-path") | ||
.arg(source_root().join("Cargo.toml")) | ||
.args(&[ | ||
"--config", | ||
r#"workspace.exclude=["library/core"]"#, | ||
lqd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Avoid depending on transitive rustc crates | ||
"--no-default-features", | ||
// Emit artifacts in this temporary directory, not in the source_root's `target` | ||
// folder | ||
"--target-dir", | ||
".", | ||
lqd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
]) | ||
// Check that these crates can be compiled on "stable" | ||
.args(&[ | ||
"-p", | ||
"rustc_type_ir", | ||
"-p", | ||
"rustc_next_trait_solver", | ||
"-p", | ||
"rustc_pattern_analysis", | ||
"-p", | ||
"rustc_lexer", | ||
]) | ||
.run(); | ||
}); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.