Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bootstrap.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,11 @@
# If you set this, you likely want to set `cargo` as well.
#build.rustc = "/path/to/rustc"

# Use this rustdoc binary as the stage0 snapshot rustdoc.
# If unspecified, then the binary "rustdoc" (with platform-specific extension, e.g. ".exe")
# in the same directory as "rustc" will be used.
#build.rustdoc = "/path/to/rustdoc"

# Instead of downloading the src/stage0 version of rustfmt specified,
# use this rustfmt binary instead as the stage0 snapshot rustfmt.
#build.rustfmt = "/path/to/rustfmt"
Expand Down
6 changes: 6 additions & 0 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ pub struct Config {
// These are either the stage0 downloaded binaries or the locally installed ones.
pub initial_cargo: PathBuf,
pub initial_rustc: PathBuf,
pub initial_rustdoc: PathBuf,
pub initial_cargo_clippy: Option<PathBuf>,
pub initial_sysroot: PathBuf,
pub initial_rustfmt: Option<PathBuf>,
Expand Down Expand Up @@ -456,6 +457,7 @@ impl Config {
build_dir: build_build_dir,
cargo: mut build_cargo,
rustc: mut build_rustc,
rustdoc: build_rustdoc,
rustfmt: build_rustfmt,
cargo_clippy: build_cargo_clippy,
docs: build_docs,
Expand Down Expand Up @@ -751,6 +753,9 @@ impl Config {
default_stage0_rustc_path(&out)
});

let initial_rustdoc = build_rustdoc
.unwrap_or_else(|| initial_rustc.with_file_name(exe("rustdoc", host_target)));

let initial_sysroot = t!(PathBuf::from_str(
command(&initial_rustc)
.args(["--print", "sysroot"])
Expand Down Expand Up @@ -1348,6 +1353,7 @@ impl Config {
initial_cargo,
initial_cargo_clippy: build_cargo_clippy,
initial_rustc,
initial_rustdoc,
initial_rustfmt,
initial_sysroot,
jemalloc: rust_jemalloc.unwrap_or(false),
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/src/core/config/toml/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ define_config! {
build_dir: Option<String> = "build-dir",
cargo: Option<PathBuf> = "cargo",
rustc: Option<PathBuf> = "rustc",
rustdoc: Option<PathBuf> = "rustdoc",
rustfmt: Option<PathBuf> = "rustfmt",
cargo_clippy: Option<PathBuf> = "cargo-clippy",
docs: Option<bool> = "docs",
Expand Down
4 changes: 1 addition & 3 deletions src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,7 @@ impl Build {
initial_lld,
initial_relative_libdir,
initial_rustc: config.initial_rustc.clone(),
initial_rustdoc: config
.initial_rustc
.with_file_name(exe("rustdoc", config.host_target)),
initial_rustdoc: config.initial_rustdoc.clone(),
initial_cargo: config.initial_cargo.clone(),
initial_sysroot: config.initial_sysroot.clone(),
local_rebuild: config.local_rebuild,
Expand Down
Loading