mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-16 17:03:35 +00:00
Rollup merge of #127830 - tgross35:archive-failure-message, r=BoxyUwU
When an archive fails to build, print the path Currently the output on failure is as follows: Compiling block-buffer v0.10.4 Compiling crypto-common v0.1.6 Compiling digest v0.10.7 Compiling sha2 v0.10.8 Compiling xz2 v0.1.7 error: failed to build archive: No such file or directory error: could not compile `bootstrap` (lib) due to 1 previous error Change this to print which file is being constructed, to give some hint about what is going on. error: failed to build archive at `path/to/output`: No such file or directory
This commit is contained in:
commit
75dfe1e63d
@ -97,7 +97,9 @@ impl<'a> ArchiveBuilder for LlvmArchiveBuilder<'a> {
|
|||||||
fn build(mut self: Box<Self>, output: &Path) -> bool {
|
fn build(mut self: Box<Self>, output: &Path) -> bool {
|
||||||
match self.build_with_llvm(output) {
|
match self.build_with_llvm(output) {
|
||||||
Ok(any_members) => any_members,
|
Ok(any_members) => any_members,
|
||||||
Err(e) => self.sess.dcx().emit_fatal(ArchiveBuildFailure { error: e }),
|
Err(error) => {
|
||||||
|
self.sess.dcx().emit_fatal(ArchiveBuildFailure { path: output.to_owned(), error })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,7 @@ codegen_ssa_add_native_library = failed to add native library {$library_path}: {
|
|||||||
|
|
||||||
codegen_ssa_apple_sdk_error_sdk_path = failed to get {$sdk_name} SDK path: {$error}
|
codegen_ssa_apple_sdk_error_sdk_path = failed to get {$sdk_name} SDK path: {$error}
|
||||||
|
|
||||||
codegen_ssa_archive_build_failure =
|
codegen_ssa_archive_build_failure = failed to build archive at `{$path}`: {$error}
|
||||||
failed to build archive: {$error}
|
|
||||||
|
|
||||||
codegen_ssa_atomic_compare_exchange = Atomic compare-exchange intrinsic missing failure memory ordering
|
codegen_ssa_atomic_compare_exchange = Atomic compare-exchange intrinsic missing failure memory ordering
|
||||||
|
|
||||||
@ -198,7 +197,7 @@ codegen_ssa_read_file = failed to read file: {$message}
|
|||||||
|
|
||||||
codegen_ssa_repair_vs_build_tools = the Visual Studio build tools may need to be repaired using the Visual Studio installer
|
codegen_ssa_repair_vs_build_tools = the Visual Studio build tools may need to be repaired using the Visual Studio installer
|
||||||
|
|
||||||
codegen_ssa_rlib_archive_build_failure = failed to build archive from rlib: {$error}
|
codegen_ssa_rlib_archive_build_failure = failed to build archive from rlib at `{$path}`: {$error}
|
||||||
|
|
||||||
codegen_ssa_rlib_incompatible_dependency_formats = `{$ty1}` and `{$ty2}` do not have equivalent dependency formats (`{$list1}` vs `{$list2}`)
|
codegen_ssa_rlib_incompatible_dependency_formats = `{$ty1}` and `{$ty2}` do not have equivalent dependency formats (`{$list1}` vs `{$list2}`)
|
||||||
|
|
||||||
|
@ -207,7 +207,9 @@ impl<'a> ArchiveBuilder for ArArchiveBuilder<'a> {
|
|||||||
let sess = self.sess;
|
let sess = self.sess;
|
||||||
match self.build_inner(output) {
|
match self.build_inner(output) {
|
||||||
Ok(any_members) => any_members,
|
Ok(any_members) => any_members,
|
||||||
Err(e) => sess.dcx().emit_fatal(ArchiveBuildFailure { error: e }),
|
Err(error) => {
|
||||||
|
sess.dcx().emit_fatal(ArchiveBuildFailure { path: output.to_owned(), error })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2911,7 +2911,8 @@ fn add_static_crate(
|
|||||||
false
|
false
|
||||||
}),
|
}),
|
||||||
) {
|
) {
|
||||||
sess.dcx().emit_fatal(errors::RlibArchiveBuildFailure { error });
|
sess.dcx()
|
||||||
|
.emit_fatal(errors::RlibArchiveBuildFailure { path: cratepath.clone(), error });
|
||||||
}
|
}
|
||||||
if archive.build(&dst) {
|
if archive.build(&dst) {
|
||||||
link_upstream(&dst);
|
link_upstream(&dst);
|
||||||
|
@ -500,6 +500,7 @@ pub struct UnableToWriteDebuggerVisualizer {
|
|||||||
#[derive(Diagnostic)]
|
#[derive(Diagnostic)]
|
||||||
#[diag(codegen_ssa_rlib_archive_build_failure)]
|
#[diag(codegen_ssa_rlib_archive_build_failure)]
|
||||||
pub struct RlibArchiveBuildFailure {
|
pub struct RlibArchiveBuildFailure {
|
||||||
|
pub path: PathBuf,
|
||||||
pub error: Error,
|
pub error: Error,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -557,6 +558,7 @@ pub struct UnsupportedLinkSelfContained;
|
|||||||
#[diag(codegen_ssa_archive_build_failure)]
|
#[diag(codegen_ssa_archive_build_failure)]
|
||||||
// Public for rustc_codegen_llvm::back::archive
|
// Public for rustc_codegen_llvm::back::archive
|
||||||
pub struct ArchiveBuildFailure {
|
pub struct ArchiveBuildFailure {
|
||||||
|
pub path: PathBuf,
|
||||||
pub error: std::io::Error,
|
pub error: std::io::Error,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user