Skip to content
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

distribute tool documentations and avoid file conflicts on x install #121079

Merged
merged 2 commits into from
Feb 19, 2024
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
3 changes: 2 additions & 1 deletion src/bootstrap/src/core/build_steps/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,11 @@ impl Step for Rustc {
let host = compiler.host;
let src = builder.sysroot(compiler);

// Copy rustc/rustdoc binaries
// Copy rustc binary
t!(fs::create_dir_all(image.join("bin")));
builder.cp_r(&src.join("bin"), &image.join("bin"));

// If enabled, copy rustdoc binary
if builder
.config
.tools
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fn install_sh(
}

let datadir = prefix.join(default_path(&builder.config.datadir, "share"));
let docdir = prefix.join(default_path(&builder.config.docdir, "share/doc/rust"));
let docdir = prefix.join(default_path(&builder.config.docdir, &format!("share/doc/{package}")));
let mandir = prefix.join(default_path(&builder.config.mandir, "share/man"));
let libdir = prefix.join(default_path(&builder.config.libdir, "lib"));
let bindir = prefix.join(&builder.config.bindir); // Default in config.rs
Expand Down
6 changes: 5 additions & 1 deletion src/bootstrap/src/core/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,11 @@ impl<'a> Builder<'a> {
Kind::Install => describe!(
install::Docs,
install::Std,
// During the Rust compiler (rustc) installation process, we copy the entire sysroot binary
// path (build/host/stage2/bin). Since the building tools also make their copy in the sysroot
// binary path, we must install rustc before the tools. Otherwise, the rust-installer will
// install the same binaries twice for each tool, leaving backup files (*.old) as a result.
install::Rustc,
install::Cargo,
install::RustAnalyzer,
install::Rustfmt,
Expand All @@ -866,7 +871,6 @@ impl<'a> Builder<'a> {
install::Miri,
install::LlvmTools,
install::Src,
install::Rustc,
),
Kind::Run => describe!(
run::ExpandYamlAnchors,
Expand Down
Loading