fix kernel test build in hosted-ci

This commit is contained in:
bunnie 2022-10-02 17:56:51 +08:00
parent b431059715
commit a303150687

View file

@ -492,11 +492,7 @@ impl Builder {
service.push_str(".exe") service.push_str(".exe")
} }
} }
let mut hosted_args = if self.dry_run { let mut hosted_args = vec!["run"];
vec!["build"]
} else {
vec!["run"]
};
match self.stream { match self.stream {
BuildStream::Release => hosted_args.push("--release"), BuildStream::Release => hosted_args.push("--release"),
_ => {} _ => {}
@ -510,20 +506,32 @@ impl Builder {
let mut binary_files: Vec<&str> = binary_files_string.iter().map(|s| s.as_ref()).collect(); let mut binary_files: Vec<&str> = binary_files_string.iter().map(|s| s.as_ref()).collect();
hosted_args.append(&mut binary_files); hosted_args.append(&mut binary_files);
let mut dir = project_root(); if !self.dry_run {
dir.push("kernel"); let mut dir = project_root();
println!("Starting hosted mode..."); dir.push("kernel");
print!(" Command: cargo"); println!("Starting hosted mode...");
for arg in &hosted_args { print!(" Command: cargo");
print!(" {}", arg); for arg in &hosted_args {
} print!(" {}", arg);
println!(); }
let status = Command::new(cargo()) println!();
.current_dir(dir) let status = Command::new(cargo())
.args(&hosted_args) .current_dir(dir)
.status()?; .args(&hosted_args)
if !status.success() { .status()?;
return Err("cargo run failed to launch hosted mode".into()); if !status.success() {
return Err("cargo run failed to launch hosted mode".into());
}
} else {
// confirm the kernel can build before quitting
let _ = self.builder(
&vec![CrateSpec::Local("xous-kernel".into())],
&self.features,
&target,
self.stream,
&vec![],
)?;
println!("Dry run requested: only building and not running");
} }
} else { } else {
// ------ build the kernel ------ // ------ build the kernel ------