Skip to content

Commit c198c0e

Browse files
committed
Do not consider LLDB version to be valid if it is empty
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.
1 parent 54952b4 commit c198c0e

File tree

1 file changed

+3
-8
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+3
-8
lines changed

src/bootstrap/src/core/build_steps/test.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -1805,14 +1805,9 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
18051805

18061806
let lldb_exe = builder.config.lldb.clone().unwrap_or_else(|| PathBuf::from("lldb"));
18071807
let lldb_version = builder
1808-
.run(
1809-
BootstrapCommand::new(&lldb_exe)
1810-
.capture()
1811-
.allow_failure()
1812-
.run_always()
1813-
.arg("--version"),
1814-
)
1815-
.stdout_if_ok();
1808+
.run(BootstrapCommand::new(&lldb_exe).capture().allow_failure().arg("--version"))
1809+
.stdout_if_ok()
1810+
.and_then(|v| if v.trim().is_empty() { None } else { Some(v) });
18161811
if let Some(ref vers) = lldb_version {
18171812
cmd.arg("--lldb-version").arg(vers);
18181813
let lldb_python_dir = builder

0 commit comments

Comments
 (0)