diff --git a/config.toml.example b/config.toml.example index e32beb1c611..5447434143c 100644 --- a/config.toml.example +++ b/config.toml.example @@ -411,10 +411,6 @@ # sysroot. #llvm-tools = false -# Indicates whether LLDB will be made available in the sysroot. -# This is only built if LLVM is also being built. -#lldb = false - # Whether to deny warnings in crates #deny-warnings = true diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index b0e06731330..0a5f07c6895 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -439,7 +439,6 @@ impl<'a> Builder<'a> { dist::Clippy, dist::Miri, dist::LlvmTools, - dist::Lldb, dist::Extended, dist::HashSign ), diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 390630ee51b..13f88c185ae 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -85,7 +85,6 @@ pub struct Config { pub use_lld: bool, pub lld_enabled: bool, - pub lldb_enabled: bool, pub llvm_tools_enabled: bool, pub llvm_cflags: Option, @@ -337,7 +336,6 @@ struct Rust { lld: Option, use_lld: Option, llvm_tools: Option, - lldb: Option, deny_warnings: Option, backtrace_on_ice: Option, verify_llvm_ir: Option, @@ -585,7 +583,6 @@ impl Config { } set(&mut config.use_lld, rust.use_lld); set(&mut config.lld_enabled, rust.lld); - set(&mut config.lldb_enabled, rust.lldb); set(&mut config.llvm_tools_enabled, rust.llvm_tools); config.rustc_parallel = rust.parallel_compiler.unwrap_or(false); config.rustc_default_linker = rust.default_linker.clone(); diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py index 2a46c563d1f..d1e53db573e 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py @@ -57,7 +57,6 @@ o("cargo-native-static", "build.cargo-native-static", "static native libraries i o("profiler", "build.profiler", "build the profiler runtime") o("full-tools", None, "enable all tools") o("lld", "rust.lld", "build lld") -o("lldb", "rust.lldb", "build lldb") o("missing-tools", "dist.missing-tools", "allow failures when building tools") o("use-libcxx", "llvm.use-libcxx", "build LLVM with libc++") o("control-flow-guard", "rust.control-flow-guard", "Enable Control Flow Guard") diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index bae90411496..c4bca4a0040 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -38,8 +38,6 @@ pub fn pkgname(builder: &Builder<'_>, component: &str) -> String { format!("{}-{}", component, builder.rustfmt_package_vers()) } else if component == "llvm-tools" { format!("{}-{}", component, builder.llvm_tools_package_vers()) - } else if component == "lldb" { - format!("{}-{}", component, builder.lldb_package_vers()) } else { assert!(component.starts_with("rust")); format!("{}-{}", component, builder.rust_package_vers()) @@ -1645,7 +1643,6 @@ impl Step for Extended { let llvm_tools_installer = builder.ensure(LlvmTools { target }); let clippy_installer = builder.ensure(Clippy { compiler, target }); let miri_installer = builder.ensure(Miri { compiler, target }); - let lldb_installer = builder.ensure(Lldb { target }); let mingw_installer = builder.ensure(Mingw { host: target }); let analysis_installer = builder.ensure(Analysis { compiler, target }); @@ -1681,7 +1678,6 @@ impl Step for Extended { tarballs.extend(miri_installer.clone()); tarballs.extend(rustfmt_installer.clone()); tarballs.extend(llvm_tools_installer); - tarballs.extend(lldb_installer); tarballs.push(analysis_installer); tarballs.push(std_installer); if builder.config.docs { @@ -2222,7 +2218,6 @@ impl Step for HashSign { cmd.arg(builder.package_vers(&builder.release_num("miri"))); cmd.arg(builder.package_vers(&builder.release_num("rustfmt"))); cmd.arg(builder.llvm_tools_package_vers()); - cmd.arg(builder.lldb_package_vers()); builder.create_dir(&distdir(builder)); @@ -2349,119 +2344,3 @@ impl Step for LlvmTools { Some(distdir(builder).join(format!("{}-{}.tar.gz", name, target))) } } - -#[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct Lldb { - pub target: Interned, -} - -impl Step for Lldb { - type Output = Option; - const ONLY_HOSTS: bool = true; - const DEFAULT: bool = true; - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - run.path("src/llvm-project/lldb").path("src/tools/lldb") - } - - fn make_run(run: RunConfig<'_>) { - run.builder.ensure(Lldb { target: run.target }); - } - - fn run(self, builder: &Builder<'_>) -> Option { - let target = self.target; - - if builder.config.dry_run { - return None; - } - - let bindir = builder.llvm_out(target).join("bin"); - let lldb_exe = bindir.join(exe("lldb", &target)); - if !lldb_exe.exists() { - return None; - } - - builder.info(&format!("Dist Lldb ({})", target)); - let src = builder.src.join("src/llvm-project/lldb"); - let name = pkgname(builder, "lldb"); - - let tmp = tmpdir(builder); - let image = tmp.join("lldb-image"); - drop(fs::remove_dir_all(&image)); - - // Prepare the image directory - let root = image.join("lib/rustlib").join(&*target); - let dst = root.join("bin"); - t!(fs::create_dir_all(&dst)); - for program in &["lldb", "lldb-argdumper", "lldb-mi", "lldb-server"] { - let exe = bindir.join(exe(program, &target)); - builder.install(&exe, &dst, 0o755); - } - - // The libraries. - let libdir = builder.llvm_out(target).join("lib"); - let dst = root.join("lib"); - t!(fs::create_dir_all(&dst)); - for entry in t!(fs::read_dir(&libdir)) { - let entry = entry.unwrap(); - if let Ok(name) = entry.file_name().into_string() { - if name.starts_with("liblldb.") && !name.ends_with(".a") { - if t!(entry.file_type()).is_symlink() { - builder.copy_to_folder(&entry.path(), &dst); - } else { - builder.install(&entry.path(), &dst, 0o755); - } - } - } - } - - // The lldb scripts might be installed in lib/python$version - // or in lib64/python$version. If lib64 exists, use it; - // otherwise lib. - let libdir = builder.llvm_out(target).join("lib64"); - let (libdir, libdir_name) = if libdir.exists() { - (libdir, "lib64") - } else { - (builder.llvm_out(target).join("lib"), "lib") - }; - for entry in t!(fs::read_dir(&libdir)) { - let entry = t!(entry); - if let Ok(name) = entry.file_name().into_string() { - if name.starts_with("python") { - let dst = root.join(libdir_name).join(entry.file_name()); - t!(fs::create_dir_all(&dst)); - builder.cp_r(&entry.path(), &dst); - break; - } - } - } - - // Prepare the overlay - let overlay = tmp.join("lldb-overlay"); - drop(fs::remove_dir_all(&overlay)); - builder.create_dir(&overlay); - builder.install(&src.join("LICENSE.TXT"), &overlay, 0o644); - builder.create(&overlay.join("version"), &builder.lldb_vers()); - - // Generate the installer tarball - let mut cmd = rust_installer(builder); - cmd.arg("generate") - .arg("--product-name=Rust") - .arg("--rel-manifest-dir=rustlib") - .arg("--success-message=lldb-installed.") - .arg("--image-dir") - .arg(&image) - .arg("--work-dir") - .arg(&tmpdir(builder)) - .arg("--output-dir") - .arg(&distdir(builder)) - .arg("--non-installed-overlay") - .arg(&overlay) - .arg(format!("--package-name={}-{}", name, target)) - .arg("--legacy-manifest-dirs=rustlib,cargo") - .arg("--component-name=lldb-preview"); - - builder.run(&mut cmd); - Some(distdir(builder).join(format!("{}-{}.tar.gz", name, target))) - } -} diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 31bbd92cd62..15bf831a148 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -1029,14 +1029,6 @@ impl Build { self.rust_version() } - fn lldb_package_vers(&self) -> String { - self.package_vers(channel::CFG_RELEASE_NUM) - } - - fn lldb_vers(&self) -> String { - self.rust_version() - } - fn llvm_link_tools_dynamically(&self, target: Interned) -> bool { target.contains("linux-gnu") || target.contains("apple-darwin") } diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index bcd79a49ece..446017f1fab 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -184,7 +184,7 @@ impl Step for Llvm { } // For distribution we want the LLVM tools to be *statically* linked to libstdc++ - if builder.config.llvm_tools_enabled || builder.config.lldb_enabled { + if builder.config.llvm_tools_enabled { if !target.contains("msvc") { if target.contains("apple") { cfg.define("CMAKE_EXE_LINKER_FLAGS", "-static-libstdc++"); @@ -212,17 +212,9 @@ impl Step for Llvm { enabled_llvm_projects.push("compiler-rt"); } - if builder.config.lldb_enabled { - enabled_llvm_projects.push("clang"); - enabled_llvm_projects.push("lldb"); - // For the time being, disable code signing. - cfg.define("LLDB_CODESIGN_IDENTITY", ""); - cfg.define("LLDB_NO_DEBUGSERVER", "ON"); - } else { - // LLDB requires libxml2; but otherwise we want it to be disabled. - // See https://github.com/rust-lang/rust/pull/50104 - cfg.define("LLVM_ENABLE_LIBXML2", "OFF"); - } + // We want libxml to be disabled. + // See https://github.com/rust-lang/rust/pull/50104 + cfg.define("LLVM_ENABLE_LIBXML2", "OFF"); if !enabled_llvm_projects.is_empty() { enabled_llvm_projects.sort(); diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs index 1760d655b3b..74b47d07728 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs @@ -117,14 +117,6 @@ pub fn check(build: &mut Build) { build.config.ninja = true; } } - - if build.config.lldb_enabled { - cmd_finder.must_have("swig"); - let out = output(Command::new("swig").arg("-version")); - if !out.contains("SWIG Version 3") && !out.contains("SWIG Version 4") { - panic!("Ensure that Swig 3.x.x or 4.x.x is installed."); - } - } } build.config.python = build diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 97565013265..96196a80be4 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1096,20 +1096,15 @@ impl Step for Compiletest { .to_string() }) }; - let lldb_exe = if builder.config.lldb_enabled { - // Test against the lldb that was just built. - builder.llvm_out(target).join("bin").join("lldb") - } else { - PathBuf::from("lldb") - }; - let lldb_version = Command::new(&lldb_exe) + let lldb_exe = "lldb"; + let lldb_version = Command::new(lldb_exe) .arg("--version") .output() .map(|output| String::from_utf8_lossy(&output.stdout).to_string()) .ok(); if let Some(ref vers) = lldb_version { cmd.arg("--lldb-version").arg(vers); - let lldb_python_dir = run(Command::new(&lldb_exe).arg("-P")).ok(); + let lldb_python_dir = run(Command::new(lldb_exe).arg("-P")).ok(); if let Some(ref dir) = lldb_python_dir { cmd.arg("--lldb-python-dir").arg(dir); } diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index 6de07d3e5cf..39baa6b8540 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -228,7 +228,6 @@ struct Builder { clippy_release: String, rustfmt_release: String, llvm_tools_release: String, - lldb_release: String, miri_release: String, input: PathBuf, @@ -244,7 +243,6 @@ struct Builder { clippy_version: Option, rustfmt_version: Option, llvm_tools_version: Option, - lldb_version: Option, miri_version: Option, rust_git_commit_hash: Option, @@ -253,7 +251,6 @@ struct Builder { clippy_git_commit_hash: Option, rustfmt_git_commit_hash: Option, llvm_tools_git_commit_hash: Option, - lldb_git_commit_hash: Option, miri_git_commit_hash: Option, should_sign: bool, @@ -284,7 +281,6 @@ fn main() { let miri_release = args.next().unwrap(); let rustfmt_release = args.next().unwrap(); let llvm_tools_release = args.next().unwrap(); - let lldb_release = args.next().unwrap(); // Do not ask for a passphrase while manually testing let mut passphrase = String::new(); @@ -300,7 +296,6 @@ fn main() { clippy_release, rustfmt_release, llvm_tools_release, - lldb_release, miri_release, input, @@ -316,7 +311,6 @@ fn main() { clippy_version: None, rustfmt_version: None, llvm_tools_version: None, - lldb_version: None, miri_version: None, rust_git_commit_hash: None, @@ -325,7 +319,6 @@ fn main() { clippy_git_commit_hash: None, rustfmt_git_commit_hash: None, llvm_tools_git_commit_hash: None, - lldb_git_commit_hash: None, miri_git_commit_hash: None, should_sign, @@ -340,7 +333,6 @@ enum PkgType { Clippy, Rustfmt, LlvmTools, - Lldb, Miri, Other, } @@ -355,7 +347,6 @@ impl PkgType { "clippy" | "clippy-preview" => Clippy, "rustfmt" | "rustfmt-preview" => Rustfmt, "llvm-tools" | "llvm-tools-preview" => LlvmTools, - "lldb" | "lldb-preview" => Lldb, "miri" | "miri-preview" => Miri, _ => Other, } @@ -370,8 +361,6 @@ impl Builder { self.clippy_version = self.version("clippy", "x86_64-unknown-linux-gnu"); self.rustfmt_version = self.version("rustfmt", "x86_64-unknown-linux-gnu"); self.llvm_tools_version = self.version("llvm-tools", "x86_64-unknown-linux-gnu"); - // lldb is only built for macOS. - self.lldb_version = self.version("lldb", "x86_64-apple-darwin"); self.miri_version = self.version("miri", "x86_64-unknown-linux-gnu"); self.rust_git_commit_hash = self.git_commit_hash("rust", "x86_64-unknown-linux-gnu"); @@ -381,7 +370,6 @@ impl Builder { self.rustfmt_git_commit_hash = self.git_commit_hash("rustfmt", "x86_64-unknown-linux-gnu"); self.llvm_tools_git_commit_hash = self.git_commit_hash("llvm-tools", "x86_64-unknown-linux-gnu"); - self.lldb_git_commit_hash = self.git_commit_hash("lldb", "x86_64-unknown-linux-gnu"); self.miri_git_commit_hash = self.git_commit_hash("miri", "x86_64-unknown-linux-gnu"); self.check_toolstate(); @@ -456,7 +444,6 @@ impl Builder { package("rustfmt-preview", HOSTS); package("rust-analysis", TARGETS); package("llvm-tools-preview", TARGETS); - package("lldb-preview", TARGETS); } fn add_profiles_to(&mut self, manifest: &mut Manifest) { @@ -487,7 +474,6 @@ impl Builder { "rls-preview", "rust-src", "llvm-tools-preview", - "lldb-preview", "rust-analysis", "miri-preview", ], @@ -562,7 +548,6 @@ impl Builder { host_component("rls-preview"), host_component("rustfmt-preview"), host_component("llvm-tools-preview"), - host_component("lldb-preview"), host_component("rust-analysis"), ]); @@ -692,7 +677,6 @@ impl Builder { Clippy => format!("clippy-{}-{}.tar.gz", self.clippy_release, target), Rustfmt => format!("rustfmt-{}-{}.tar.gz", self.rustfmt_release, target), LlvmTools => format!("llvm-tools-{}-{}.tar.gz", self.llvm_tools_release, target), - Lldb => format!("lldb-{}-{}.tar.gz", self.lldb_release, target), Miri => format!("miri-{}-{}.tar.gz", self.miri_release, target), Other => format!("{}-{}-{}.tar.gz", component, self.rust_release, target), } @@ -706,7 +690,6 @@ impl Builder { Clippy => &self.clippy_version, Rustfmt => &self.rustfmt_version, LlvmTools => &self.llvm_tools_version, - Lldb => &self.lldb_version, Miri => &self.miri_version, _ => &self.rust_version, } @@ -720,7 +703,6 @@ impl Builder { Clippy => &self.clippy_git_commit_hash, Rustfmt => &self.rustfmt_git_commit_hash, LlvmTools => &self.llvm_tools_git_commit_hash, - Lldb => &self.lldb_git_commit_hash, Miri => &self.miri_git_commit_hash, _ => &self.rust_git_commit_hash, }