Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lqd committed Sep 2, 2024
1 parent f1df0c5 commit a178559
Showing 1 changed file with 30 additions and 36 deletions.
66 changes: 30 additions & 36 deletions tests/run-make/rustc-crates-on-stable/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,42 +1,36 @@
//! 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};
use run_make_support::{cargo, 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()
// Ensure `proc-macro2`'s nightly detection is disabled
.env("RUSTC_STAGE", "0")
.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"]"#,
// 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",
".",
])
// 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();
});
// Use the stage0 beta cargo for the compilation (it shouldn't really matter which cargo we use)
cargo()
// Ensure `proc-macro2`'s nightly detection is disabled
.env("RUSTC_STAGE", "0")
.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(&[
// 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",
"target",
])
// 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();
}

0 comments on commit a178559

Please sign in to comment.