add support to override lldb binary path for ./x test

This commit is contained in:
Vladimir Makayev 2024-04-28 15:26:38 -07:00
parent aed2187d53
commit d6b88a5bb7
3 changed files with 13 additions and 3 deletions
src/bootstrap/src
core
build_steps
config
utils

View file

@ -1927,15 +1927,16 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
.to_string() .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") .arg("--version")
.output() .output()
.map(|output| String::from_utf8_lossy(&output.stdout).to_string()) .map(|output| String::from_utf8_lossy(&output.stdout).to_string())
.ok(); .ok();
if let Some(ref vers) = lldb_version { if let Some(ref vers) = lldb_version {
cmd.arg("--lldb-version").arg(vers); 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 { if let Some(ref dir) = lldb_python_dir {
cmd.arg("--lldb-python-dir").arg(dir); cmd.arg("--lldb-python-dir").arg(dir);
} }

View file

@ -329,6 +329,7 @@ pub struct Config {
pub nodejs: Option<PathBuf>, pub nodejs: Option<PathBuf>,
pub npm: Option<PathBuf>, pub npm: Option<PathBuf>,
pub gdb: Option<PathBuf>, pub gdb: Option<PathBuf>,
pub lldb: Option<PathBuf>,
pub python: Option<PathBuf>, pub python: Option<PathBuf>,
pub reuse: Option<PathBuf>, pub reuse: Option<PathBuf>,
pub cargo_native_static: bool, pub cargo_native_static: bool,
@ -832,6 +833,7 @@ define_config! {
docs_minification: Option<bool> = "docs-minification", docs_minification: Option<bool> = "docs-minification",
submodules: Option<bool> = "submodules", submodules: Option<bool> = "submodules",
gdb: Option<String> = "gdb", gdb: Option<String> = "gdb",
lldb: Option<String> = "lldb",
nodejs: Option<String> = "nodejs", nodejs: Option<String> = "nodejs",
npm: Option<String> = "npm", npm: Option<String> = "npm",
python: Option<String> = "python", python: Option<String> = "python",
@ -1408,6 +1410,7 @@ impl Config {
docs_minification, docs_minification,
submodules, submodules,
gdb, gdb,
lldb,
nodejs, nodejs,
npm, npm,
python, python,
@ -1500,6 +1503,7 @@ impl Config {
config.nodejs = nodejs.map(PathBuf::from); config.nodejs = nodejs.map(PathBuf::from);
config.npm = npm.map(PathBuf::from); config.npm = npm.map(PathBuf::from);
config.gdb = gdb.map(PathBuf::from); config.gdb = gdb.map(PathBuf::from);
config.lldb = lldb.map(PathBuf::from);
config.python = python.map(PathBuf::from); config.python = python.map(PathBuf::from);
config.reuse = reuse.map(PathBuf::from); config.reuse = reuse.map(PathBuf::from);
config.submodules = submodules; config.submodules = submodules;

View file

@ -175,4 +175,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
severity: ChangeSeverity::Warning, 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.", 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",
},
]; ];