Skip to content

Commit 43a5e3f

Browse files
authored
Rollup merge of #124501 - VladimirMakaev:add-lldb-to-config-toml, r=Mark-Simulacrum
add support to override lldb binary path for ./x test When running debuginfo tests I couldn't set custom build of lldb. The `src/bootstrap/src/core/build_steps/test.rs` has "lldb" hardcoded. I ended up hacking `src/bootstrap/src/core/build_steps/test.rs` just to get the tests running the way I wanted. Then I've found out that we can override `gdb` under [build] section. This PR enables the same for `lldb`
2 parents d568423 + 79e09a6 commit 43a5e3f

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

config.example.toml

+4
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@
254254
# executing the debuginfo test suite.
255255
#gdb = "gdb"
256256

257+
# The path to (or name of) the LLDB executable to use. This is only used for
258+
# executing the debuginfo test suite.
259+
#lldb = "lldb"
260+
257261
# The node.js executable to use. Note that this is only used for the emscripten
258262
# target when running tests, otherwise this can be omitted.
259263
#nodejs = "node"

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -1892,15 +1892,16 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
18921892
.to_string()
18931893
})
18941894
};
1895-
let lldb_exe = "lldb";
1896-
let lldb_version = Command::new(lldb_exe)
1895+
1896+
let lldb_exe = builder.config.lldb.clone().unwrap_or_else(|| PathBuf::from("lldb"));
1897+
let lldb_version = Command::new(&lldb_exe)
18971898
.arg("--version")
18981899
.output()
18991900
.map(|output| String::from_utf8_lossy(&output.stdout).to_string())
19001901
.ok();
19011902
if let Some(ref vers) = lldb_version {
19021903
cmd.arg("--lldb-version").arg(vers);
1903-
let lldb_python_dir = run(Command::new(lldb_exe).arg("-P")).ok();
1904+
let lldb_python_dir = run(Command::new(&lldb_exe).arg("-P")).ok();
19041905
if let Some(ref dir) = lldb_python_dir {
19051906
cmd.arg("--lldb-python-dir").arg(dir);
19061907
}

src/bootstrap/src/core/config/config.rs

+4
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ pub struct Config {
329329
pub nodejs: Option<PathBuf>,
330330
pub npm: Option<PathBuf>,
331331
pub gdb: Option<PathBuf>,
332+
pub lldb: Option<PathBuf>,
332333
pub python: Option<PathBuf>,
333334
pub reuse: Option<PathBuf>,
334335
pub cargo_native_static: bool,
@@ -834,6 +835,7 @@ define_config! {
834835
docs_minification: Option<bool> = "docs-minification",
835836
submodules: Option<bool> = "submodules",
836837
gdb: Option<String> = "gdb",
838+
lldb: Option<String> = "lldb",
837839
nodejs: Option<String> = "nodejs",
838840
npm: Option<String> = "npm",
839841
python: Option<String> = "python",
@@ -1410,6 +1412,7 @@ impl Config {
14101412
docs_minification,
14111413
submodules,
14121414
gdb,
1415+
lldb,
14131416
nodejs,
14141417
npm,
14151418
python,
@@ -1502,6 +1505,7 @@ impl Config {
15021505
config.nodejs = nodejs.map(PathBuf::from);
15031506
config.npm = npm.map(PathBuf::from);
15041507
config.gdb = gdb.map(PathBuf::from);
1508+
config.lldb = lldb.map(PathBuf::from);
15051509
config.python = python.map(PathBuf::from);
15061510
config.reuse = reuse.map(PathBuf::from);
15071511
config.submodules = submodules;

src/bootstrap/src/utils/change_tracker.rs

+5
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
175175
severity: ChangeSeverity::Warning,
176176
summary: "The deprecated field `changelog-seen` has been removed. Using that field in `config.toml` from now on will result in breakage.",
177177
},
178+
ChangeInfo {
179+
change_id: 124501,
180+
severity: ChangeSeverity::Info,
181+
summary: "New option `build.lldb` that will override the default lldb binary path used in debuginfo tests",
182+
},
178183
];

0 commit comments

Comments
 (0)