Skip to content

Commit 304885d

Browse files
authored
Rollup merge of #47460 - Mark-Simulacrum:bootstrap-check, r=alexcrichton
Add ./x.py check src/{libstd,libtest,librustc} This currently only supports a limited subset of the full compilation, but is likely 90% of what people will want and is possible without building a full compiler (and also building LLVM). In theory, this means that contributors who don't want to build LLVM now have an easy way to compile locally, though running tests won't work.
2 parents 1bdef2f + 6aeb1cf commit 304885d

File tree

8 files changed

+1670
-1486
lines changed

8 files changed

+1670
-1486
lines changed

src/bootstrap/bin/rustc.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,6 @@ fn main() {
125125
cmd.arg(format!("-Clinker={}", target_linker));
126126
}
127127

128-
// Pass down incremental directory, if any.
129-
if let Ok(dir) = env::var("RUSTC_INCREMENTAL") {
130-
cmd.arg(format!("-Zincremental={}", dir));
131-
}
132-
133128
let crate_name = args.windows(2)
134129
.find(|a| &*a[0] == "--crate-name")
135130
.unwrap();

src/bootstrap/bootstrap.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ def build_bootstrap(self):
602602
env["LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \
603603
(os.pathsep + env["LIBRARY_PATH"]) \
604604
if "LIBRARY_PATH" in env else ""
605+
env["RUSTFLAGS"] = "-Cdebuginfo=2"
605606
env["PATH"] = os.path.join(self.bin_root(), "bin") + \
606607
os.pathsep + env["PATH"]
607608
if not os.path.isfile(self.cargo()):

src/bootstrap/builder.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ use util::{exe, libdir, add_lib_path};
2626
use {Build, Mode};
2727
use cache::{INTERNER, Interned, Cache};
2828
use check;
29+
use test;
2930
use flags::Subcommand;
3031
use doc;
3132
use tool;
@@ -230,6 +231,7 @@ impl<'a> ShouldRun<'a> {
230231
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
231232
pub enum Kind {
232233
Build,
234+
Check,
233235
Test,
234236
Bench,
235237
Dist,
@@ -251,13 +253,13 @@ impl<'a> Builder<'a> {
251253
tool::Compiletest, tool::RemoteTestServer, tool::RemoteTestClient,
252254
tool::RustInstaller, tool::Cargo, tool::Rls, tool::Rustdoc, tool::Clippy,
253255
native::Llvm, tool::Rustfmt, tool::Miri),
254-
Kind::Test => describe!(check::Tidy, check::Bootstrap, check::DefaultCompiletest,
255-
check::HostCompiletest, check::Crate, check::CrateLibrustc, check::Rustdoc,
256-
check::Linkcheck, check::Cargotest, check::Cargo, check::Rls, check::Docs,
257-
check::ErrorIndex, check::Distcheck, check::Rustfmt, check::Miri, check::Clippy,
258-
check::RustdocJS),
259-
260-
Kind::Bench => describe!(check::Crate, check::CrateLibrustc),
256+
Kind::Check => describe!(check::Std, check::Test, check::Rustc),
257+
Kind::Test => describe!(test::Tidy, test::Bootstrap, test::DefaultCompiletest,
258+
test::HostCompiletest, test::Crate, test::CrateLibrustc, test::Rustdoc,
259+
test::Linkcheck, test::Cargotest, test::Cargo, test::Rls, test::Docs,
260+
test::ErrorIndex, test::Distcheck, test::Rustfmt, test::Miri, test::Clippy,
261+
test::RustdocJS),
262+
Kind::Bench => describe!(test::Crate, test::CrateLibrustc),
261263
Kind::Doc => describe!(doc::UnstableBook, doc::UnstableBookGen, doc::TheBook,
262264
doc::Standalone, doc::Std, doc::Test, doc::Rustc, doc::ErrorIndex, doc::Nomicon,
263265
doc::Reference, doc::Rustdoc, doc::RustByExample, doc::CargoBook),
@@ -304,6 +306,7 @@ impl<'a> Builder<'a> {
304306
pub fn run(build: &Build) {
305307
let (kind, paths) = match build.config.cmd {
306308
Subcommand::Build { ref paths } => (Kind::Build, &paths[..]),
309+
Subcommand::Check { ref paths } => (Kind::Check, &paths[..]),
307310
Subcommand::Doc { ref paths } => (Kind::Doc, &paths[..]),
308311
Subcommand::Test { ref paths, .. } => (Kind::Test, &paths[..]),
309312
Subcommand::Bench { ref paths, .. } => (Kind::Bench, &paths[..]),
@@ -493,13 +496,14 @@ impl<'a> Builder<'a> {
493496
cargo.env("RUSTC_CODEGEN_UNITS", n.to_string());
494497
}
495498

499+
496500
if let Some(host_linker) = self.build.linker(compiler.host) {
497501
cargo.env("RUSTC_HOST_LINKER", host_linker);
498502
}
499503
if let Some(target_linker) = self.build.linker(target) {
500504
cargo.env("RUSTC_TARGET_LINKER", target_linker);
501505
}
502-
if cmd != "build" {
506+
if cmd != "build" && cmd != "check" {
503507
cargo.env("RUSTDOC_LIBDIR", self.rustc_libdir(self.compiler(2, self.build.build)));
504508
}
505509

@@ -566,8 +570,7 @@ impl<'a> Builder<'a> {
566570
// not guaranteeing correctness across builds if the compiler
567571
// is changing under your feet.`
568572
if self.config.incremental && compiler.stage == 0 {
569-
let incr_dir = self.incremental_dir(compiler);
570-
cargo.env("RUSTC_INCREMENTAL", incr_dir);
573+
cargo.env("CARGO_INCREMENTAL", "1");
571574
}
572575

573576
if let Some(ref on_fail) = self.config.on_fail {

0 commit comments

Comments
 (0)