Skip to content

Commit

Permalink
Do not consider LLDB version to be valid if it is empty
Browse files Browse the repository at this point in the history
When dry run is enabled, the command for finding LLDB version would succeed, but return an empty string. This was inadvertently enabling a code path that should only be executed when the LLDB is actually present and its version is valid. This commit makes sure that if the version is empty, LLDB will be considered not found.
  • Loading branch information
Kobzol committed Jul 4, 2024
1 parent 54952b4 commit c198c0e
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1805,14 +1805,9 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the

let lldb_exe = builder.config.lldb.clone().unwrap_or_else(|| PathBuf::from("lldb"));
let lldb_version = builder
.run(
BootstrapCommand::new(&lldb_exe)
.capture()
.allow_failure()
.run_always()
.arg("--version"),
)
.stdout_if_ok();
.run(BootstrapCommand::new(&lldb_exe).capture().allow_failure().arg("--version"))
.stdout_if_ok()
.and_then(|v| if v.trim().is_empty() { None } else { Some(v) });
if let Some(ref vers) = lldb_version {
cmd.arg("--lldb-version").arg(vers);
let lldb_python_dir = builder
Expand Down

0 comments on commit c198c0e

Please sign in to comment.