mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
add --offline flag
this has become necessary because with the inclusion of a version number in a crate name, rustc always consults the on-line index on every build (even when it's not necessary), which can double the build time. Using --offline reduces that thrashing.
This commit is contained in:
parent
31efca3e9c
commit
886215c1b0
2 changed files with 14 additions and 0 deletions
|
|
@ -122,6 +122,7 @@ pub(crate) struct Builder {
|
||||||
/// services identically.
|
/// services identically.
|
||||||
apps: Vec<CrateSpec>,
|
apps: Vec<CrateSpec>,
|
||||||
features: Vec<String>,
|
features: Vec<String>,
|
||||||
|
global_flags: Vec<String>,
|
||||||
stream: BuildStream,
|
stream: BuildStream,
|
||||||
min_ver: String,
|
min_ver: String,
|
||||||
target: Option<String>,
|
target: Option<String>,
|
||||||
|
|
@ -149,6 +150,7 @@ impl Builder {
|
||||||
services: Vec::new(),
|
services: Vec::new(),
|
||||||
apps: Vec::new(),
|
apps: Vec::new(),
|
||||||
features: Vec::new(),
|
features: Vec::new(),
|
||||||
|
global_flags: Vec::new(),
|
||||||
stream: BuildStream::Release,
|
stream: BuildStream::Release,
|
||||||
min_ver: crate::MIN_XOUS_VERSION.to_string(),
|
min_ver: crate::MIN_XOUS_VERSION.to_string(),
|
||||||
target: Some(crate::TARGET_TRIPLE_RISCV32.to_string()),
|
target: Some(crate::TARGET_TRIPLE_RISCV32.to_string()),
|
||||||
|
|
@ -198,6 +200,11 @@ impl Builder {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn add_global_flag<'a>(&'a mut self, flag: &str) -> &'a mut Builder {
|
||||||
|
self.global_flags.push(flag.to_string());
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
/// Set a minimum xous version. This is the minimum Xous version necessary to read
|
/// Set a minimum xous version. This is the minimum Xous version necessary to read
|
||||||
/// the PDDB that is generated by this build. The purpose of this is so that we can
|
/// the PDDB that is generated by this build. The purpose of this is so that we can
|
||||||
/// trim migration code out of the PDDB: when we have a breaking change to the PDDB,
|
/// trim migration code out of the PDDB: when we have a breaking change to the PDDB,
|
||||||
|
|
@ -434,6 +441,10 @@ impl Builder {
|
||||||
);
|
);
|
||||||
remote_args.push(&output_root);
|
remote_args.push(&output_root);
|
||||||
|
|
||||||
|
for flag in self.global_flags.iter() {
|
||||||
|
local_args.push(flag);
|
||||||
|
}
|
||||||
|
|
||||||
// modify the stream if release (debug is the default for builds; release is the default for installs)
|
// 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 => {
|
||||||
|
|
|
||||||
|
|
@ -154,6 +154,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
if env::args().filter(|x| x == "--debug-loader").count() != 0 {
|
if env::args().filter(|x| x == "--debug-loader").count() != 0 {
|
||||||
builder.add_loader_feature("debug-print");
|
builder.add_loader_feature("debug-print");
|
||||||
}
|
}
|
||||||
|
if env::args().filter(|x| x == "--offline").count() != 0 {
|
||||||
|
builder.add_global_flag("--offline");
|
||||||
|
}
|
||||||
|
|
||||||
// ---- now process the verb plus position dependent arguments ----
|
// ---- now process the verb plus position dependent arguments ----
|
||||||
let mut args = env::args();
|
let mut args = env::args();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue