From d6b88a5bb700311d0e8cfa2c3d63a2b12233ae33 Mon Sep 17 00:00:00 2001 From: Vladimir Makayev Date: Sun, 28 Apr 2024 15:26:38 -0700 Subject: [PATCH 1/2] add support to override lldb binary path for ./x test --- src/bootstrap/src/core/build_steps/test.rs | 7 ++++--- src/bootstrap/src/core/config/config.rs | 4 ++++ src/bootstrap/src/utils/change_tracker.rs | 5 +++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index d581987c29e..3ac829c3655 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -1927,15 +1927,16 @@ fn run(self, builder: &Builder<'_>) { .to_string() }) }; - let lldb_exe = "lldb"; - let lldb_version = Command::new(lldb_exe) + + let lldb_exe = builder.config.lldb.clone().unwrap_or_else(|| PathBuf::from("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/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 2acce627359..ef5ba2cc340 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -329,6 +329,7 @@ pub struct Config { pub nodejs: Option, pub npm: Option, pub gdb: Option, + pub lldb: Option, pub python: Option, pub reuse: Option, pub cargo_native_static: bool, @@ -832,6 +833,7 @@ struct Build { docs_minification: Option = "docs-minification", submodules: Option = "submodules", gdb: Option = "gdb", + lldb: Option = "lldb", nodejs: Option = "nodejs", npm: Option = "npm", python: Option = "python", @@ -1408,6 +1410,7 @@ fn get_table(option: &str) -> Result { docs_minification, submodules, gdb, + lldb, nodejs, npm, python, @@ -1500,6 +1503,7 @@ fn get_table(option: &str) -> Result { config.nodejs = nodejs.map(PathBuf::from); config.npm = npm.map(PathBuf::from); config.gdb = gdb.map(PathBuf::from); + config.lldb = lldb.map(PathBuf::from); config.python = python.map(PathBuf::from); config.reuse = reuse.map(PathBuf::from); config.submodules = submodules; diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index db3df598a0c..c3a03693f71 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs @@ -175,4 +175,9 @@ pub fn human_readable_changes(changes: &[ChangeInfo]) -> String { severity: ChangeSeverity::Warning, summary: "The deprecated field `changelog-seen` has been removed. Using that field in `config.toml` from now on will result in breakage.", }, + ChangeInfo { + change_id: 124501, + severity: ChangeSeverity::Info, + summary: "New option `build.lldb` that will override the default lldb binary path used in debuginfo tests", + }, ]; From 79e09a6fc551760379093cb482078f55530bd7af Mon Sep 17 00:00:00 2001 From: Vladimir Makaev Date: Sat, 4 May 2024 17:55:19 +0000 Subject: [PATCH 2/2] Added an entry for "lldb" in config.example.toml --- config.example.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config.example.toml b/config.example.toml index 5c1fac7672a..3b76952504f 100644 --- a/config.example.toml +++ b/config.example.toml @@ -254,6 +254,10 @@ # executing the debuginfo test suite. #gdb = "gdb" +# The path to (or name of) the LLDB executable to use. This is only used for +# executing the debuginfo test suite. +#lldb = "lldb" + # The node.js executable to use. Note that this is only used for the emscripten # target when running tests, otherwise this can be omitted. #nodejs = "node"