Skip to content

Commit 23ffeea

Browse files
committed
Auto merge of rust-lang#72058 - RalfJung:no-dist-lldb, r=Mark-Simulacrum
bootstrap: remove lldb dist packaging The lldb-preview rustup package is missing on every single target, and has never been shipped beyond x86_64-apple-darwin. It was removed in rust-lang#62592 which landed around a year ago, and there's not been demand that we re-enable it since, so we're now removing support entirely to cleanup the code a bit. The hope is that this will also kill the useless "lldb-preview" row on https://rust-lang.github.io/rustup-components-history/.
2 parents 94c0ab9 + dc7524b commit 23ffeea

File tree

10 files changed

+7
-184
lines changed

10 files changed

+7
-184
lines changed

config.toml.example

-4
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,6 @@
411411
# sysroot.
412412
#llvm-tools = false
413413

414-
# Indicates whether LLDB will be made available in the sysroot.
415-
# This is only built if LLVM is also being built.
416-
#lldb = false
417-
418414
# Whether to deny warnings in crates
419415
#deny-warnings = true
420416

src/bootstrap/builder.rs

-1
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,6 @@ impl<'a> Builder<'a> {
439439
dist::Clippy,
440440
dist::Miri,
441441
dist::LlvmTools,
442-
dist::Lldb,
443442
dist::Extended,
444443
dist::HashSign
445444
),

src/bootstrap/config.rs

-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ pub struct Config {
8585

8686
pub use_lld: bool,
8787
pub lld_enabled: bool,
88-
pub lldb_enabled: bool,
8988
pub llvm_tools_enabled: bool,
9089

9190
pub llvm_cflags: Option<String>,
@@ -337,7 +336,6 @@ struct Rust {
337336
lld: Option<bool>,
338337
use_lld: Option<bool>,
339338
llvm_tools: Option<bool>,
340-
lldb: Option<bool>,
341339
deny_warnings: Option<bool>,
342340
backtrace_on_ice: Option<bool>,
343341
verify_llvm_ir: Option<bool>,
@@ -585,7 +583,6 @@ impl Config {
585583
}
586584
set(&mut config.use_lld, rust.use_lld);
587585
set(&mut config.lld_enabled, rust.lld);
588-
set(&mut config.lldb_enabled, rust.lldb);
589586
set(&mut config.llvm_tools_enabled, rust.llvm_tools);
590587
config.rustc_parallel = rust.parallel_compiler.unwrap_or(false);
591588
config.rustc_default_linker = rust.default_linker.clone();

src/bootstrap/configure.py

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ def v(*args):
5757
o("profiler", "build.profiler", "build the profiler runtime")
5858
o("full-tools", None, "enable all tools")
5959
o("lld", "rust.lld", "build lld")
60-
o("lldb", "rust.lldb", "build lldb")
6160
o("missing-tools", "dist.missing-tools", "allow failures when building tools")
6261
o("use-libcxx", "llvm.use-libcxx", "build LLVM with libc++")
6362
o("control-flow-guard", "rust.control-flow-guard", "Enable Control Flow Guard")

src/bootstrap/dist.rs

-121
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ pub fn pkgname(builder: &Builder<'_>, component: &str) -> String {
3838
format!("{}-{}", component, builder.rustfmt_package_vers())
3939
} else if component == "llvm-tools" {
4040
format!("{}-{}", component, builder.llvm_tools_package_vers())
41-
} else if component == "lldb" {
42-
format!("{}-{}", component, builder.lldb_package_vers())
4341
} else {
4442
assert!(component.starts_with("rust"));
4543
format!("{}-{}", component, builder.rust_package_vers())
@@ -1645,7 +1643,6 @@ impl Step for Extended {
16451643
let llvm_tools_installer = builder.ensure(LlvmTools { target });
16461644
let clippy_installer = builder.ensure(Clippy { compiler, target });
16471645
let miri_installer = builder.ensure(Miri { compiler, target });
1648-
let lldb_installer = builder.ensure(Lldb { target });
16491646
let mingw_installer = builder.ensure(Mingw { host: target });
16501647
let analysis_installer = builder.ensure(Analysis { compiler, target });
16511648

@@ -1681,7 +1678,6 @@ impl Step for Extended {
16811678
tarballs.extend(miri_installer.clone());
16821679
tarballs.extend(rustfmt_installer.clone());
16831680
tarballs.extend(llvm_tools_installer);
1684-
tarballs.extend(lldb_installer);
16851681
tarballs.push(analysis_installer);
16861682
tarballs.push(std_installer);
16871683
if builder.config.docs {
@@ -2222,7 +2218,6 @@ impl Step for HashSign {
22222218
cmd.arg(builder.package_vers(&builder.release_num("miri")));
22232219
cmd.arg(builder.package_vers(&builder.release_num("rustfmt")));
22242220
cmd.arg(builder.llvm_tools_package_vers());
2225-
cmd.arg(builder.lldb_package_vers());
22262221

22272222
builder.create_dir(&distdir(builder));
22282223

@@ -2349,119 +2344,3 @@ impl Step for LlvmTools {
23492344
Some(distdir(builder).join(format!("{}-{}.tar.gz", name, target)))
23502345
}
23512346
}
2352-
2353-
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
2354-
pub struct Lldb {
2355-
pub target: Interned<String>,
2356-
}
2357-
2358-
impl Step for Lldb {
2359-
type Output = Option<PathBuf>;
2360-
const ONLY_HOSTS: bool = true;
2361-
const DEFAULT: bool = true;
2362-
2363-
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
2364-
run.path("src/llvm-project/lldb").path("src/tools/lldb")
2365-
}
2366-
2367-
fn make_run(run: RunConfig<'_>) {
2368-
run.builder.ensure(Lldb { target: run.target });
2369-
}
2370-
2371-
fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {
2372-
let target = self.target;
2373-
2374-
if builder.config.dry_run {
2375-
return None;
2376-
}
2377-
2378-
let bindir = builder.llvm_out(target).join("bin");
2379-
let lldb_exe = bindir.join(exe("lldb", &target));
2380-
if !lldb_exe.exists() {
2381-
return None;
2382-
}
2383-
2384-
builder.info(&format!("Dist Lldb ({})", target));
2385-
let src = builder.src.join("src/llvm-project/lldb");
2386-
let name = pkgname(builder, "lldb");
2387-
2388-
let tmp = tmpdir(builder);
2389-
let image = tmp.join("lldb-image");
2390-
drop(fs::remove_dir_all(&image));
2391-
2392-
// Prepare the image directory
2393-
let root = image.join("lib/rustlib").join(&*target);
2394-
let dst = root.join("bin");
2395-
t!(fs::create_dir_all(&dst));
2396-
for program in &["lldb", "lldb-argdumper", "lldb-mi", "lldb-server"] {
2397-
let exe = bindir.join(exe(program, &target));
2398-
builder.install(&exe, &dst, 0o755);
2399-
}
2400-
2401-
// The libraries.
2402-
let libdir = builder.llvm_out(target).join("lib");
2403-
let dst = root.join("lib");
2404-
t!(fs::create_dir_all(&dst));
2405-
for entry in t!(fs::read_dir(&libdir)) {
2406-
let entry = entry.unwrap();
2407-
if let Ok(name) = entry.file_name().into_string() {
2408-
if name.starts_with("liblldb.") && !name.ends_with(".a") {
2409-
if t!(entry.file_type()).is_symlink() {
2410-
builder.copy_to_folder(&entry.path(), &dst);
2411-
} else {
2412-
builder.install(&entry.path(), &dst, 0o755);
2413-
}
2414-
}
2415-
}
2416-
}
2417-
2418-
// The lldb scripts might be installed in lib/python$version
2419-
// or in lib64/python$version. If lib64 exists, use it;
2420-
// otherwise lib.
2421-
let libdir = builder.llvm_out(target).join("lib64");
2422-
let (libdir, libdir_name) = if libdir.exists() {
2423-
(libdir, "lib64")
2424-
} else {
2425-
(builder.llvm_out(target).join("lib"), "lib")
2426-
};
2427-
for entry in t!(fs::read_dir(&libdir)) {
2428-
let entry = t!(entry);
2429-
if let Ok(name) = entry.file_name().into_string() {
2430-
if name.starts_with("python") {
2431-
let dst = root.join(libdir_name).join(entry.file_name());
2432-
t!(fs::create_dir_all(&dst));
2433-
builder.cp_r(&entry.path(), &dst);
2434-
break;
2435-
}
2436-
}
2437-
}
2438-
2439-
// Prepare the overlay
2440-
let overlay = tmp.join("lldb-overlay");
2441-
drop(fs::remove_dir_all(&overlay));
2442-
builder.create_dir(&overlay);
2443-
builder.install(&src.join("LICENSE.TXT"), &overlay, 0o644);
2444-
builder.create(&overlay.join("version"), &builder.lldb_vers());
2445-
2446-
// Generate the installer tarball
2447-
let mut cmd = rust_installer(builder);
2448-
cmd.arg("generate")
2449-
.arg("--product-name=Rust")
2450-
.arg("--rel-manifest-dir=rustlib")
2451-
.arg("--success-message=lldb-installed.")
2452-
.arg("--image-dir")
2453-
.arg(&image)
2454-
.arg("--work-dir")
2455-
.arg(&tmpdir(builder))
2456-
.arg("--output-dir")
2457-
.arg(&distdir(builder))
2458-
.arg("--non-installed-overlay")
2459-
.arg(&overlay)
2460-
.arg(format!("--package-name={}-{}", name, target))
2461-
.arg("--legacy-manifest-dirs=rustlib,cargo")
2462-
.arg("--component-name=lldb-preview");
2463-
2464-
builder.run(&mut cmd);
2465-
Some(distdir(builder).join(format!("{}-{}.tar.gz", name, target)))
2466-
}
2467-
}

src/bootstrap/lib.rs

-8
Original file line numberDiff line numberDiff line change
@@ -1029,14 +1029,6 @@ impl Build {
10291029
self.rust_version()
10301030
}
10311031

1032-
fn lldb_package_vers(&self) -> String {
1033-
self.package_vers(channel::CFG_RELEASE_NUM)
1034-
}
1035-
1036-
fn lldb_vers(&self) -> String {
1037-
self.rust_version()
1038-
}
1039-
10401032
fn llvm_link_tools_dynamically(&self, target: Interned<String>) -> bool {
10411033
target.contains("linux-gnu") || target.contains("apple-darwin")
10421034
}

src/bootstrap/native.rs

+4-12
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl Step for Llvm {
184184
}
185185

186186
// For distribution we want the LLVM tools to be *statically* linked to libstdc++
187-
if builder.config.llvm_tools_enabled || builder.config.lldb_enabled {
187+
if builder.config.llvm_tools_enabled {
188188
if !target.contains("msvc") {
189189
if target.contains("apple") {
190190
cfg.define("CMAKE_EXE_LINKER_FLAGS", "-static-libstdc++");
@@ -212,17 +212,9 @@ impl Step for Llvm {
212212
enabled_llvm_projects.push("compiler-rt");
213213
}
214214

215-
if builder.config.lldb_enabled {
216-
enabled_llvm_projects.push("clang");
217-
enabled_llvm_projects.push("lldb");
218-
// For the time being, disable code signing.
219-
cfg.define("LLDB_CODESIGN_IDENTITY", "");
220-
cfg.define("LLDB_NO_DEBUGSERVER", "ON");
221-
} else {
222-
// LLDB requires libxml2; but otherwise we want it to be disabled.
223-
// See https://github.com/rust-lang/rust/pull/50104
224-
cfg.define("LLVM_ENABLE_LIBXML2", "OFF");
225-
}
215+
// We want libxml to be disabled.
216+
// See https://github.com/rust-lang/rust/pull/50104
217+
cfg.define("LLVM_ENABLE_LIBXML2", "OFF");
226218

227219
if !enabled_llvm_projects.is_empty() {
228220
enabled_llvm_projects.sort();

src/bootstrap/sanity.rs

-8
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,6 @@ pub fn check(build: &mut Build) {
117117
build.config.ninja = true;
118118
}
119119
}
120-
121-
if build.config.lldb_enabled {
122-
cmd_finder.must_have("swig");
123-
let out = output(Command::new("swig").arg("-version"));
124-
if !out.contains("SWIG Version 3") && !out.contains("SWIG Version 4") {
125-
panic!("Ensure that Swig 3.x.x or 4.x.x is installed.");
126-
}
127-
}
128120
}
129121

130122
build.config.python = build

src/bootstrap/test.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -1096,20 +1096,15 @@ impl Step for Compiletest {
10961096
.to_string()
10971097
})
10981098
};
1099-
let lldb_exe = if builder.config.lldb_enabled {
1100-
// Test against the lldb that was just built.
1101-
builder.llvm_out(target).join("bin").join("lldb")
1102-
} else {
1103-
PathBuf::from("lldb")
1104-
};
1105-
let lldb_version = Command::new(&lldb_exe)
1099+
let lldb_exe = "lldb";
1100+
let lldb_version = Command::new(lldb_exe)
11061101
.arg("--version")
11071102
.output()
11081103
.map(|output| String::from_utf8_lossy(&output.stdout).to_string())
11091104
.ok();
11101105
if let Some(ref vers) = lldb_version {
11111106
cmd.arg("--lldb-version").arg(vers);
1112-
let lldb_python_dir = run(Command::new(&lldb_exe).arg("-P")).ok();
1107+
let lldb_python_dir = run(Command::new(lldb_exe).arg("-P")).ok();
11131108
if let Some(ref dir) = lldb_python_dir {
11141109
cmd.arg("--lldb-python-dir").arg(dir);
11151110
}

0 commit comments

Comments
 (0)