Skip to content

Commit a3d3f63

Browse files
chmanchesterfroydnj
authored andcommitted
Fail outright if a distributed toolchain archive can't be cached locally.
The failure mode in mozilla#629 seems to warrant failing the build: it's going to prevent useful work (nothing using that toolchain will be distributable), and it can be remedied by the user by increasing their toolchain cache size.
1 parent 072f8b2 commit a3d3f63

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/compiler/compiler.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use crate::mock_command::{exit_status, CommandChild, CommandCreatorSync, RunComm
2727
use crate::util::{fmt_duration_as_secs, ref_env, run_input_output};
2828
use futures::Future;
2929
use futures_cpupool::CpuPool;
30+
use lru_disk_cache::Error as LruError;
3031
use std::borrow::Cow;
3132
use std::collections::HashMap;
3233
use std::ffi::OsString;
@@ -466,6 +467,7 @@ where
466467
let compile_out_pretty3 = out_pretty.clone();
467468
let compile_out_pretty4 = out_pretty.clone();
468469
let local_executable = compile_cmd.executable.clone();
470+
let local_executable2 = local_executable.clone();
469471
// TODO: the number of map_errs is subideal, but there's no futures-based carrier trait AFAIK
470472
Box::new(future::result(dist_compile_cmd.ok_or_else(|| "Could not create distributed compile command".into()))
471473
.and_then(move |dist_compile_cmd| {
@@ -575,9 +577,12 @@ where
575577
errmsg.push_str(": ");
576578
errmsg.push_str(&cause.to_string());
577579
}
578-
// Client errors are considered fatal.
579580
match e {
580581
Error(ErrorKind::HttpClientError(_), _) => f_err(e),
582+
Error(ErrorKind::Lru(LruError::FileTooLarge), _) => f_err(format!(
583+
"Could not cache dist toolchain for {:?} locally.
584+
Increase `toolchain_cache_size` or decrease the toolchain archive size.",
585+
local_executable2)),
581586
_ => {
582587
warn!("[{}]: Could not perform distributed compile, falling back to local: {}", compile_out_pretty4, errmsg);
583588
Box::new(compile_cmd.execute(&creator).map(|o| (DistType::Error, o)))

0 commit comments

Comments
 (0)