mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-20 09:03:28 +00:00
Merge remote-tracking branch 'origin' into out_of_tree_issue
This commit is contained in:
commit
86c041beba
2 changed files with 38 additions and 2 deletions
|
|
@ -54,7 +54,7 @@ impl<'a> TokenManager {
|
||||||
// throw a bone to the dev who has to debug this error. This typically only triggers after a major
|
// throw a bone to the dev who has to debug this error. This typically only triggers after a major
|
||||||
// refactor and some UX element was removed and we forgot to update it in this table here.
|
// refactor and some UX element was removed and we forgot to update it in this table here.
|
||||||
let now = self.tt.elapsed_ms();
|
let now = self.tt.elapsed_ms();
|
||||||
if *self.last_time.borrow() < now - REPEAT_MSG_INTERVAL_MS {
|
if *self.last_time.borrow() + REPEAT_MSG_INTERVAL_MS < now {
|
||||||
log::info!("Occupied token slots: ***");
|
log::info!("Occupied token slots: ***");
|
||||||
for t in self.tokens.iter() {
|
for t in self.tokens.iter() {
|
||||||
log::info!(" {}", t.name);
|
log::info!(" {}", t.name);
|
||||||
|
|
|
||||||
|
|
@ -306,6 +306,24 @@ impl Builder {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Check if a file exists and is executable
|
||||||
|
pub fn executable_exists(&self, file: &str) -> bool {
|
||||||
|
if let Ok(_metadata) = std::fs::metadata(file) {
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
if file.to_lowercase().ends_with("exe") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#[cfg(not(target_os = "windows"))]
|
||||||
|
if _metadata.is_file() {
|
||||||
|
use std::os::unix::fs::PermissionsExt;
|
||||||
|
if _metadata.permissions().mode() & 0o100 != 0 {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
/// Add just one service
|
/// Add just one service
|
||||||
pub fn add_service<'a>(&'a mut self, service_spec: &str, xip: bool) -> &'a mut Builder {
|
pub fn add_service<'a>(&'a mut self, service_spec: &str, xip: bool) -> &'a mut Builder {
|
||||||
let mut spec: CrateSpec = service_spec.into();
|
let mut spec: CrateSpec = service_spec.into();
|
||||||
|
|
@ -667,7 +685,25 @@ impl Builder {
|
||||||
}
|
}
|
||||||
// jam in any pre-built local binary files that were specified
|
// jam in any pre-built local binary files that were specified
|
||||||
let binary_files_string = self.enumerate_binary_files()?;
|
let binary_files_string = self.enumerate_binary_files()?;
|
||||||
let mut binary_files: Vec<&str> = binary_files_string.iter().map(|s| s.as_ref()).collect();
|
let mut canonicalized_paths = Vec::new();
|
||||||
|
let mut binary_files_storage = Vec::<String>::new();
|
||||||
|
for f in binary_files_string {
|
||||||
|
if !self.executable_exists(&f) {
|
||||||
|
panic!("FATAL ERROR: App '{}' does not exist or is not executable.", f);
|
||||||
|
}
|
||||||
|
canonicalized_paths
|
||||||
|
.push(std::fs::canonicalize(f).expect("Couldn't canonicalize executable target"));
|
||||||
|
}
|
||||||
|
for f in canonicalized_paths {
|
||||||
|
let path_as_str = f.to_str().expect("Couldn't canonicalize executable target").to_string();
|
||||||
|
let windows_clean_path = if path_as_str.starts_with("\\\\?\\") {
|
||||||
|
path_as_str[4..].to_owned()
|
||||||
|
} else {
|
||||||
|
path_as_str
|
||||||
|
};
|
||||||
|
binary_files_storage.push(windows_clean_path);
|
||||||
|
}
|
||||||
|
let mut binary_files: Vec<&str> = binary_files_storage.iter().map(|s| s.as_ref()).collect();
|
||||||
hosted_args.append(&mut binary_files);
|
hosted_args.append(&mut binary_files);
|
||||||
|
|
||||||
if !self.dry_run {
|
if !self.dry_run {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue