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,6 +506,7 @@ 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);
if !self.dry_run {
let mut dir = project_root(); let mut dir = project_root();
dir.push("kernel"); dir.push("kernel");
println!("Starting hosted mode..."); println!("Starting hosted mode...");
@ -525,6 +522,17 @@ impl Builder {
if !status.success() { if !status.success() {
return Err("cargo run failed to launch hosted mode".into()); 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 ------
let mut kernel_extra = vec![]; let mut kernel_extra = vec![];