File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,9 @@ extern crate clap;
4
4
use clap:: Parser ;
5
5
use os_xtask_utils:: { BinUtil , Cargo , CommandExt , Qemu } ;
6
6
use std:: {
7
- fs,
7
+ fs, io ,
8
8
path:: { Path , PathBuf } ,
9
+ process,
9
10
} ;
10
11
11
12
#[ derive( Parser ) ]
@@ -176,7 +177,7 @@ impl QemuArgs {
176
177
if let Some ( p) = & self . qemu_dir {
177
178
Qemu :: search_at ( p) ;
178
179
}
179
- Qemu :: system ( self . build . arch ( ) )
180
+ let status = Qemu :: system ( self . build . arch ( ) )
180
181
. args ( [ "-machine" , "virt" ] )
181
182
. arg ( "-bios" )
182
183
. arg ( self . build . dir ( ) . join ( "rustsbi-qemu.bin" ) )
@@ -188,7 +189,17 @@ impl QemuArgs {
188
189
. optional ( & self . gdb , |qemu, gdb| {
189
190
qemu. args ( [ "-S" , "-gdb" , & format ! ( "tcp::{gdb}" ) ] ) ;
190
191
} )
191
- . invoke ( ) ;
192
+ . as_mut ( )
193
+ . status ( ) ;
194
+ if let Err ( e) = status {
195
+ if e. kind ( ) == io:: ErrorKind :: NotFound {
196
+ println ! ( "xtask: QEMU command not found. Does your system have QEMU installed and environment variable configured?" ) ;
197
+ println ! ( "xtask: error: {}" , e) ;
198
+ } else {
199
+ println ! ( "xtask: error: {}" , e) ;
200
+ }
201
+ process:: exit ( 1 ) ;
202
+ }
192
203
}
193
204
}
194
205
You can’t perform that action at this time.
0 commit comments