@@ -410,7 +410,11 @@ impl fmt::Display for BuildKernelError {
410
410
Run `cargo install cargo-xbuild` to install it.")
411
411
}
412
412
BuildKernelError :: XbuildFailed { stderr} => {
413
- writeln ! ( f, "Kernel build failed:\n {}" , String :: from_utf8_lossy( stderr) )
413
+ writeln ! ( f, "Kernel build failed" ) ?;
414
+ if !stderr. is_empty ( ) {
415
+ writeln ! ( f, "\n {}" , String :: from_utf8_lossy( stderr) ) ?;
416
+ }
417
+ Ok ( ( ) )
414
418
}
415
419
BuildKernelError :: XbuildJsonOutputInvalidUtf8 ( err) => {
416
420
writeln ! ( f, "Output of kernel build with --message-format=json is not valid UTF-8:\n {}" , err)
@@ -481,11 +485,13 @@ impl fmt::Display for CreateBootimageError {
481
485
"The `bootloader` dependency has not the right format: {}" ,
482
486
err
483
487
) ,
484
- CreateBootimageError :: BootloaderBuildFailed { stderr } => writeln ! (
485
- f,
486
- "Bootloader build failed:\n \n {}" ,
487
- String :: from_utf8_lossy( stderr)
488
- ) ,
488
+ CreateBootimageError :: BootloaderBuildFailed { stderr } => {
489
+ writeln ! ( f, "Bootloader build failed" ) ?;
490
+ if !stderr. is_empty ( ) {
491
+ writeln ! ( f, "\n {}" , String :: from_utf8_lossy( stderr) ) ?;
492
+ }
493
+ Ok ( ( ) )
494
+ }
489
495
CreateBootimageError :: Io { message, error } => {
490
496
writeln ! ( f, "I/O error: {}: {}" , message, error)
491
497
}
0 commit comments