Skip to content

Commit 2d5a295

Browse files
committed
Auto merge of #51917 - alexcrichton:update, r=Mark-Simulacrum
Update crates in `Cargo.lock` This is a "hopefully routine" update of our crates.io-based crates in `Cargo.lock`, and let's see how it fares on CI...
2 parents 478226c + d825115 commit 2d5a295

File tree

8 files changed

+696
-645
lines changed

8 files changed

+696
-645
lines changed

src/Cargo.lock

+620-618
Large diffs are not rendered by default.

src/bootstrap/builder.rs

+19-3
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,22 @@ impl<'a> Builder<'a> {
769769

770770
let want_rustdoc = self.doc_tests != DocTests::No;
771771

772+
// We synthetically interpret a stage0 compiler used to build tools as a
773+
// "raw" compiler in that it's the exact snapshot we download. Normally
774+
// the stage0 build means it uses libraries build by the stage0
775+
// compiler, but for tools we just use the precompiled libraries that
776+
// we've downloaded
777+
let use_snapshot = mode == Mode::ToolBootstrap;
778+
assert!(!use_snapshot || stage == 0);
779+
780+
let maybe_sysroot = self.sysroot(compiler);
781+
let sysroot = if use_snapshot {
782+
self.rustc_snapshot_sysroot()
783+
} else {
784+
&maybe_sysroot
785+
};
786+
let libdir = sysroot.join(libdir(&compiler.host));
787+
772788
// Customize the compiler we're running. Specify the compiler to cargo
773789
// as our shim and then pass it some various options used to configure
774790
// how the actual compiler itself is called.
@@ -784,8 +800,8 @@ impl<'a> Builder<'a> {
784800
"RUSTC_DEBUG_ASSERTIONS",
785801
self.config.rust_debug_assertions.to_string(),
786802
)
787-
.env("RUSTC_SYSROOT", self.sysroot(compiler))
788-
.env("RUSTC_LIBDIR", self.rustc_libdir(compiler))
803+
.env("RUSTC_SYSROOT", &sysroot)
804+
.env("RUSTC_LIBDIR", &libdir)
789805
.env("RUSTC_RPATH", self.config.rust_rpath.to_string())
790806
.env("RUSTDOC", self.out.join("bootstrap/debug/rustdoc"))
791807
.env(
@@ -809,7 +825,7 @@ impl<'a> Builder<'a> {
809825
cargo.env("RUSTC_ERROR_FORMAT", error_format);
810826
}
811827
if cmd != "build" && cmd != "check" && want_rustdoc {
812-
cargo.env("RUSTDOC_LIBDIR", self.sysroot_libdir(compiler, self.config.build));
828+
cargo.env("RUSTDOC_LIBDIR", &libdir);
813829
}
814830

815831
if mode.is_tool() {

src/bootstrap/check.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -273,5 +273,6 @@ fn codegen_backend_stamp(builder: &Builder,
273273
/// Cargo's output path for rustdoc in a given stage, compiled by a particular
274274
/// compiler for the specified target.
275275
pub fn rustdoc_stamp(builder: &Builder, compiler: Compiler, target: Interned<String>) -> PathBuf {
276-
builder.cargo_out(compiler, Mode::ToolRustc, target).join(".rustdoc-check.stamp")
276+
builder.cargo_out(compiler, Mode::ToolRustc, target)
277+
.join(".rustdoc-check.stamp")
277278
}

src/bootstrap/dist.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ impl Step for PlainSourceTarball {
958958
if !has_cargo_vendor {
959959
let mut cmd = builder.cargo(
960960
builder.compiler(0, builder.config.build),
961-
Mode::ToolRustc,
961+
Mode::ToolBootstrap,
962962
builder.config.build,
963963
"install"
964964
);

src/bootstrap/doc.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -799,14 +799,22 @@ impl Step for Rustdoc {
799799
builder.ensure(tool::Rustdoc { host: compiler.host });
800800

801801
// Symlink compiler docs to the output directory of rustdoc documentation.
802-
let out_dir = builder.stage_out(compiler, Mode::ToolRustc).join(target).join("doc");
802+
let out_dir = builder.stage_out(compiler, Mode::ToolRustc)
803+
.join(target)
804+
.join("doc");
803805
t!(fs::create_dir_all(&out_dir));
804806
builder.clear_if_dirty(&out, &rustdoc);
805807
t!(symlink_dir_force(&builder.config, &out, &out_dir));
806808

807809
// Build cargo command.
808810
let mut cargo = prepare_tool_cargo(
809-
builder, compiler, Mode::ToolRustc, target, "doc", "src/tools/rustdoc");
811+
builder,
812+
compiler,
813+
Mode::ToolRustc,
814+
target,
815+
"doc",
816+
"src/tools/rustdoc",
817+
);
810818

811819
cargo.env("RUSTDOCFLAGS", "--document-private-items");
812820
builder.run(&mut cargo);

src/bootstrap/lib.rs

+18-5
Original file line numberDiff line numberDiff line change
@@ -328,16 +328,23 @@ pub enum Mode {
328328
/// Build codegen libraries, placing output in the "stageN-codegen" directory
329329
Codegen,
330330

331-
/// Build some tools, placing output in the "stageN-tools" directory.
331+
/// Build some tools, placing output in the "stageN-tools" directory. The
332+
/// "other" here is for miscellaneous sets of tools that are built using the
333+
/// bootstrap compiler in its entirety (target libraries and all).
334+
/// Typically these tools compile with stable Rust.
335+
ToolBootstrap,
336+
337+
/// Compile a tool which uses all libraries we compile (up to rustc).
338+
/// Doesn't use the stage0 compiler libraries like "other", and includes
339+
/// tools like rustdoc, cargo, rls, etc.
332340
ToolStd,
333-
ToolTest,
334341
ToolRustc,
335342
}
336343

337344
impl Mode {
338345
pub fn is_tool(&self) -> bool {
339346
match self {
340-
Mode::ToolStd | Mode::ToolTest | Mode::ToolRustc => true,
347+
Mode::ToolBootstrap | Mode::ToolRustc | Mode::ToolStd => true,
341348
_ => false
342349
}
343350
}
@@ -547,7 +554,9 @@ impl Build {
547554
Mode::Test => "-test",
548555
Mode::Codegen => "-rustc",
549556
Mode::Rustc => "-rustc",
550-
Mode::ToolStd | Mode::ToolTest | Mode::ToolRustc => "-tools",
557+
Mode::ToolBootstrap => "-bootstrap-tools",
558+
Mode::ToolStd => "-tools",
559+
Mode::ToolRustc => "-tools",
551560
};
552561
self.out.join(&*compiler.host)
553562
.join(format!("stage{}{}", compiler.stage, suffix))
@@ -656,8 +665,12 @@ impl Build {
656665

657666
/// Returns the libdir of the snapshot compiler.
658667
fn rustc_snapshot_libdir(&self) -> PathBuf {
668+
self.rustc_snapshot_sysroot().join(libdir(&self.config.build))
669+
}
670+
671+
/// Returns the sysroot of the snapshot compiler.
672+
fn rustc_snapshot_sysroot(&self) -> &Path {
659673
self.initial_rustc.parent().unwrap().parent().unwrap()
660-
.join(libdir(&self.config.build))
661674
}
662675

663676
/// Runs a command, printing out nice contextual information if it fails.

src/bootstrap/test.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1806,7 +1806,10 @@ impl Step for RemoteCopyLibs {
18061806
builder.info(&format!("REMOTE copy libs to emulator ({})", target));
18071807
t!(fs::create_dir_all(builder.out.join("tmp")));
18081808

1809-
let server = builder.ensure(tool::RemoteTestServer { compiler, target });
1809+
let server = builder.ensure(tool::RemoteTestServer {
1810+
compiler: compiler.with_stage(0),
1811+
target,
1812+
});
18101813

18111814
// Spawn the emulator and wait for it to come online
18121815
let tool = builder.tool_exe(Tool::RemoteTestClient);

src/bootstrap/tool.rs

+22-14
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,13 @@ impl Step for ToolBuild {
104104
let is_ext_tool = self.is_ext_tool;
105105

106106
match self.mode {
107-
Mode::ToolStd => builder.ensure(compile::Std { compiler, target }),
108-
Mode::ToolTest => builder.ensure(compile::Test { compiler, target }),
109-
Mode::ToolRustc => builder.ensure(compile::Rustc { compiler, target }),
107+
Mode::ToolRustc => {
108+
builder.ensure(compile::Rustc { compiler, target })
109+
}
110+
Mode::ToolStd => {
111+
builder.ensure(compile::Std { compiler, target })
112+
}
113+
Mode::ToolBootstrap => {} // uses downloaded stage0 compiler libs
110114
_ => panic!("unexpected Mode for tool build")
111115
}
112116

@@ -341,17 +345,17 @@ macro_rules! tool {
341345
}
342346

343347
tool!(
344-
Rustbook, "src/tools/rustbook", "rustbook", Mode::ToolRustc;
348+
Rustbook, "src/tools/rustbook", "rustbook", Mode::ToolBootstrap;
345349
ErrorIndex, "src/tools/error_index_generator", "error_index_generator", Mode::ToolRustc;
346-
UnstableBookGen, "src/tools/unstable-book-gen", "unstable-book-gen", Mode::ToolStd;
347-
Tidy, "src/tools/tidy", "tidy", Mode::ToolStd;
348-
Linkchecker, "src/tools/linkchecker", "linkchecker", Mode::ToolStd;
349-
CargoTest, "src/tools/cargotest", "cargotest", Mode::ToolStd;
350-
Compiletest, "src/tools/compiletest", "compiletest", Mode::ToolTest, llvm_tools = true;
351-
BuildManifest, "src/tools/build-manifest", "build-manifest", Mode::ToolStd;
352-
RemoteTestClient, "src/tools/remote-test-client", "remote-test-client", Mode::ToolStd;
353-
RustInstaller, "src/tools/rust-installer", "fabricate", Mode::ToolStd;
354-
RustdocTheme, "src/tools/rustdoc-themes", "rustdoc-themes", Mode::ToolStd;
350+
UnstableBookGen, "src/tools/unstable-book-gen", "unstable-book-gen", Mode::ToolBootstrap;
351+
Tidy, "src/tools/tidy", "tidy", Mode::ToolBootstrap;
352+
Linkchecker, "src/tools/linkchecker", "linkchecker", Mode::ToolBootstrap;
353+
CargoTest, "src/tools/cargotest", "cargotest", Mode::ToolBootstrap;
354+
Compiletest, "src/tools/compiletest", "compiletest", Mode::ToolBootstrap, llvm_tools = true;
355+
BuildManifest, "src/tools/build-manifest", "build-manifest", Mode::ToolBootstrap;
356+
RemoteTestClient, "src/tools/remote-test-client", "remote-test-client", Mode::ToolBootstrap;
357+
RustInstaller, "src/tools/rust-installer", "fabricate", Mode::ToolBootstrap;
358+
RustdocTheme, "src/tools/rustdoc-themes", "rustdoc-themes", Mode::ToolBootstrap;
355359
);
356360

357361
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
@@ -604,7 +608,11 @@ impl<'a> Builder<'a> {
604608
fn prepare_tool_cmd(&self, compiler: Compiler, tool: Tool, cmd: &mut Command) {
605609
let host = &compiler.host;
606610
let mut lib_paths: Vec<PathBuf> = vec![
607-
PathBuf::from(&self.sysroot_libdir(compiler, compiler.host)),
611+
if compiler.stage == 0 {
612+
self.build.rustc_snapshot_libdir()
613+
} else {
614+
PathBuf::from(&self.sysroot_libdir(compiler, compiler.host))
615+
},
608616
self.cargo_out(compiler, tool.get_mode(), *host).join("deps"),
609617
];
610618

0 commit comments

Comments
 (0)