Give better errors when build-manifest fails
This commit is contained in:
parent
513fc80bbd
commit
d44e14225a
@ -193,6 +193,12 @@ macro_rules! t {
|
||||
Err(e) => panic!("{} failed with {}", stringify!($e), e),
|
||||
}
|
||||
};
|
||||
($e:expr, $extra:expr) => {
|
||||
match $e {
|
||||
Ok(e) => e,
|
||||
Err(e) => panic!("{} failed with {}: {}", stringify!($e), e, $extra),
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
struct Builder {
|
||||
@ -584,7 +590,7 @@ impl Builder {
|
||||
self.shipped_files.insert(name.clone());
|
||||
|
||||
let dst = self.output.join(name);
|
||||
t!(fs::write(&dst, contents));
|
||||
t!(fs::write(&dst, contents), format!("failed to create manifest {}", dst.display()));
|
||||
}
|
||||
|
||||
fn write_shipped_files(&self, path: &Path) {
|
||||
|
@ -117,6 +117,9 @@ impl Versions {
|
||||
Some(version) => Ok(version.clone()),
|
||||
None => {
|
||||
let version_info = self.load_version_from_tarball(package)?;
|
||||
if *package == PkgType::Rust && version_info.version.is_none() {
|
||||
panic!("missing version info for toolchain");
|
||||
}
|
||||
self.versions.insert(package.clone(), version_info.clone());
|
||||
Ok(version_info)
|
||||
}
|
||||
@ -131,6 +134,7 @@ impl Versions {
|
||||
Ok(file) => file,
|
||||
Err(err) if err.kind() == std::io::ErrorKind::NotFound => {
|
||||
// Missing tarballs do not return an error, but return empty data.
|
||||
println!("warning: missing tarball {}", tarball.display());
|
||||
return Ok(VersionInfo::default());
|
||||
}
|
||||
Err(err) => return Err(err.into()),
|
||||
|
Loading…
x
Reference in New Issue
Block a user