about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakub Beránek <jakub.beranek@vsb.cz>2024-07-04 10:10:30 +0200
committerJakub Beránek <jakub.beranek@vsb.cz>2024-07-04 10:10:30 +0200
commitc198c0e6d0556cec74d10aec998f4e229137c701 (patch)
tree17d7a825ce20a31db0bdf59cf006b8e450b877b7
parent54952b444566956b12058162eae383c692da0147 (diff)
downloadrust-c198c0e6d0556cec74d10aec998f4e229137c701.tar.gz
rust-c198c0e6d0556cec74d10aec998f4e229137c701.zip
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.
-rw-r--r--src/bootstrap/src/core/build_steps/test.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs
index 998e45848a1..dc53bd3cfa7 100644
--- a/src/bootstrap/src/core/build_steps/test.rs
+++ b/src/bootstrap/src/core/build_steps/test.rs
@@ -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