Skip to content

Commit a8b0e30

Browse files
Error earlier if the rustc host cannot be found
1 parent 9882d7c commit a8b0e30

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

build_system/src/config.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ impl ConfigInfo {
111111
Some(r) if !r.is_empty() => r.to_string(),
112112
_ => "rustc".to_string(),
113113
};
114-
self.host_triple = rustc_version_info(Some(&rustc))?.host.unwrap_or_default();
114+
self.host_triple = match rustc_version_info(Some(&rustc))?.host {
115+
Some(host) => host,
116+
None => return Err("no host found".to_string()),
117+
};
115118

116119
if self.target_triple.is_empty() {
117120
if let Some(overwrite) = env.get("OVERWRITE_TARGET_TRIPLE") {
@@ -216,6 +219,8 @@ impl ConfigInfo {
216219
));
217220
let ld_library_path = format!(
218221
"{target}:{sysroot}:{gcc_path}",
222+
// FIXME: It's possible to pick another out directory. Would be nice to have a command
223+
// line option to change it.
219224
target = current_dir.join("target/out").display(),
220225
sysroot = sysroot.display(),
221226
);

0 commit comments

Comments
 (0)