summaryrefslogtreecommitdiffstats
path: root/src/bootstrap/dist.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:41 +0000
commit4f9fe856a25ab29345b90e7725509e9ee38a37be (patch)
treee4ffd8a9374cae7b21f7cbfb352927e0e074aff6 /src/bootstrap/dist.rs
parentAdding upstream version 1.68.2+dfsg1. (diff)
downloadrustc-upstream/1.69.0+dfsg1.tar.xz
rustc-upstream/1.69.0+dfsg1.zip
Adding upstream version 1.69.0+dfsg1.upstream/1.69.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/bootstrap/dist.rs33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index 6594b23c5..9b2b54961 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -12,6 +12,7 @@ use std::collections::HashSet;
use std::env;
use std::ffi::OsStr;
use std::fs;
+use std::io::Write;
use std::path::{Path, PathBuf};
use std::process::Command;
@@ -392,19 +393,29 @@ impl Step for Rustc {
t!(fs::create_dir_all(image.join("bin")));
builder.cp_r(&src.join("bin"), &image.join("bin"));
- builder.install(&builder.rustdoc(compiler), &image.join("bin"), 0o755);
+ if builder
+ .config
+ .tools
+ .as_ref()
+ .map_or(true, |tools| tools.iter().any(|tool| tool == "rustdoc"))
+ {
+ let rustdoc = builder.rustdoc(compiler);
+ builder.install(&rustdoc, &image.join("bin"), 0o755);
+ }
- let ra_proc_macro_srv = builder
- .ensure(tool::RustAnalyzerProcMacroSrv {
+ if let Some(ra_proc_macro_srv) = builder.ensure_if_default(
+ tool::RustAnalyzerProcMacroSrv {
compiler: builder.compiler_for(
compiler.stage,
builder.config.build,
compiler.host,
),
target: compiler.host,
- })
- .expect("rust-analyzer-proc-macro-server always builds");
- builder.install(&ra_proc_macro_srv, &image.join("libexec"), 0o755);
+ },
+ builder.kind,
+ ) {
+ builder.install(&ra_proc_macro_srv, &image.join("libexec"), 0o755);
+ }
let libdir_relative = builder.libdir_relative(compiler);
@@ -743,7 +754,7 @@ impl Step for Analysis {
});
}
- /// Creates a tarball of save-analysis metadata, if available.
+ /// Creates a tarball of (degenerate) save-analysis metadata, if available.
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
let compiler = self.compiler;
let target = self.target;
@@ -751,7 +762,6 @@ impl Step for Analysis {
return None;
}
- builder.ensure(compile::Std::new(compiler, target));
let src = builder
.stage_out(compiler, Mode::Std)
.join(target.triple)
@@ -759,6 +769,13 @@ impl Step for Analysis {
.join("deps")
.join("save-analysis");
+ // Write a file indicating that this component has been removed.
+ t!(std::fs::create_dir_all(&src));
+ let mut removed = src.clone();
+ removed.push("removed.json");
+ let mut f = t!(std::fs::File::create(removed));
+ t!(write!(f, r#"{{ "warning": "The `rust-analysis` component has been removed." }}"#));
+
let mut tarball = Tarball::new(builder, "rust-analysis", &target.triple);
tarball.include_target_in_component_name(true);
tarball.add_dir(src, format!("lib/rustlib/{}/analysis", target.triple));