Skip to content

Commit

Permalink
add support to override lldb binary path for ./x test
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Makayev committed Apr 28, 2024
1 parent aed2187 commit 0aee267
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
};
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);
}
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ pub struct Config {
pub nodejs: Option<PathBuf>,
pub npm: Option<PathBuf>,
pub gdb: Option<PathBuf>,
pub lldb: Option<PathBuf>,
pub python: Option<PathBuf>,
pub reuse: Option<PathBuf>,
pub cargo_native_static: bool,
Expand Down Expand Up @@ -832,6 +833,7 @@ define_config! {
docs_minification: Option<bool> = "docs-minification",
submodules: Option<bool> = "submodules",
gdb: Option<String> = "gdb",
lldb: Option<String> = "lldb",
nodejs: Option<String> = "nodejs",
npm: Option<String> = "npm",
python: Option<String> = "python",
Expand Down Expand Up @@ -1408,6 +1410,7 @@ impl Config {
docs_minification,
submodules,
gdb,
lldb,
nodejs,
npm,
python,
Expand Down Expand Up @@ -1500,6 +1503,7 @@ impl Config {
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;
Expand Down

0 comments on commit 0aee267

Please sign in to comment.