fix some bugs in the remote build process

This commit is contained in:
bunnie 2022-10-03 00:25:15 +08:00
parent ae079cf504
commit 359d234971
2 changed files with 26 additions and 12 deletions

View file

@ -300,13 +300,14 @@ impl Builder {
); );
remote_args.push(&output_root); remote_args.push(&output_root);
// modify the stream if release (debug is the default) // modify the stream if release (debug is the default for builds; release is the default for installs)
match stream { match stream {
BuildStream::Release => { BuildStream::Release => {
local_args.push("--release"); local_args.push("--release");
remote_args.push("--release");
} }
_ => {} BuildStream::Debug => {
remote_args.push("--debug");
}
} }
// add any extra args. These are cargo-specific args, such as "--no-default-features" // add any extra args. These are cargo-specific args, such as "--no-default-features"
@ -365,9 +366,6 @@ impl Builder {
} }
if remote_pkgs.len() > 0 { if remote_pkgs.len() > 0 {
// remote packages are installed one at a time // remote packages are installed one at a time
// TODO: check registry if the package is already installed with the correct version, and don't rebuild it if it is!
if features.len() > 0 { if features.len() > 0 {
for feature in features { for feature in features {
remote_args.push("--features"); remote_args.push("--features");
@ -379,9 +377,9 @@ impl Builder {
// emit debug // emit debug
print!(" Command: cargo"); print!(" Command: cargo");
for &arg in remote_args.iter() { for &arg in remote_args.iter() {
print!(" {} {} --version {}", arg, name, version); print!(" {}", arg);
} }
println!(); println!(" {} {}", name, version);
// build // build
let status = Command::new(cargo()) let status = Command::new(cargo())
.current_dir(project_root()) .current_dir(project_root())

View file

@ -30,10 +30,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// A base set of packages. This is all you need for a normal // A base set of packages. This is all you need for a normal
// operating system that can run libstd // operating system that can run libstd
let base_pkgs = [ let base_pkgs = [
"ticktimer-server", // "well known" server: thread scheduling "xous-ticktimer", // "well known" service: thread scheduling
"log-server", // "well known" server: debug logging "xous-log", // "well known" service: debug logging
"xous-names", // "well known" server: manage inter-server connection lookup "xous-names", // "well known" service: manage inter-server connection lookup
"susres", // ticktimer registers with susres to coordinate time continuity across sleeps "xous-susres", // ticktimer registers with susres to coordinate time continuity across sleeps
].to_vec(); ].to_vec();
// minimal set of packages to do bare-iron graphical I/O // minimal set of packages to do bare-iron graphical I/O
let gfx_base_pkgs = [ let gfx_base_pkgs = [
@ -85,6 +85,16 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// for fast checking of AES hardware accelerator // for fast checking of AES hardware accelerator
let aestest_pkgs = ["ticktimer-server", "log-server", "aes-test"].to_vec(); let aestest_pkgs = ["ticktimer-server", "log-server", "aes-test"].to_vec();
// packages located on crates.io. For testing non-local build configs that are less
// concerned about software supply chain and more focused on developer convenience.
let base_pkgs_remote = [
"xous-ticktimer", // "well known" service: thread scheduling
"xous-log@0.1.0", // "well known" service: debug logging
"xous-names", // "well known" service: manage inter-server connection lookup
"xous-susres", // ticktimer registers with susres to coordinate time continuity across sleeps
].to_vec();
let xous_kernel_remote = "xous-kernel@0.9.2";
// ---- extract position independent args ---- // ---- extract position independent args ----
let lkey = get_flag("--lkey")?; let lkey = get_flag("--lkey")?;
if lkey.len() != 0 { if lkey.len() != 0 {
@ -158,6 +168,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
builder.add_service("ffi-test"); builder.add_service("ffi-test");
builder.add_loader_feature("renode-bypass"); builder.add_loader_feature("renode-bypass");
} }
Some("renode-remote") => {
builder.target_renode()
.add_services(&base_pkgs_remote.into_iter().map(String::from).collect())
.use_kernel(xous_kernel_remote);
}
// ------- hosted mode configs ------- // ------- hosted mode configs -------
Some("run") => { Some("run") => {
@ -338,6 +353,7 @@ Renode emulation:
libstd-net Renode test image for testing network functions. Bypasses sig checks, keys locked out. libstd-net Renode test image for testing network functions. Bypasses sig checks, keys locked out.
ffi-test builds an image for testing C-FFI bindings and integration. [cratespecs] are services ffi-test builds an image for testing C-FFI bindings and integration. [cratespecs] are services
renode-aes-test Renode image for AES emulation development. Extremely minimal. renode-aes-test Renode image for AES emulation development. Extremely minimal.
renode-remote Renode test image that pulls its crates from crates.io
Other commands: Other commands:
generate-locales (re)generate the locales include for the language selected in xous-rs/src/locale.rs generate-locales (re)generate the locales include for the language selected in xous-rs/src/locale.rs