fix: sudo not intalled on runners

This commit is contained in:
Chance 2025-04-10 22:57:19 -04:00
parent 1bf9865062
commit f702cd91e0
9 changed files with 140 additions and 44 deletions

View file

@ -14,7 +14,7 @@ mod build_info {
include!(concat!(env!("OUT_DIR"), "/built.rs"));
}
static INIT: parking_lot::Once = Once::new();
static INIT: Once = Once::new();
pub fn set_panic_hook() {
INIT.call_once(|| {
@ -137,14 +137,14 @@ fn rust_version() -> Result<String, Box<dyn Error>> {
fn capture_backtrace() -> String {
let mut backtrace = String::new();
let sysinfo = crate::metadata::SystemMetadata::current();
let sysinfo = SystemMetadata::current();
backtrace.push_str(&format!(
"--- System Information ---\n{}\n",
sysinfo.verbose_summary()
));
let trace = std::backtrace::Backtrace::force_capture();
let message = format!("\n--- Backtrace ---\n\n");
let message = "\n--- Backtrace ---\n\n".to_string();
backtrace.push_str(&message);
backtrace.push_str(&format!("{trace:#}"));
@ -380,7 +380,7 @@ impl CPU {
let current_clock_speed = max_clock_speed;
let logical_cores = cpu_opt.map(|_| sys.cpus().len() as u8);
let physical_cores = sysinfo::System::physical_core_count().map(|pc| pc as u8);
let physical_cores = System::physical_core_count().map(|pc| pc as u8);
let cpuid = CpuId::new();
let mut l1_cache = None;
@ -420,7 +420,7 @@ impl CPU {
Self {
brand,
arch: std::env::consts::ARCH
arch: env::consts::ARCH
.parse()
.unwrap_or(CPUArch::Other("unknown".into())),
name,
@ -709,9 +709,9 @@ impl OSInfo {
let mut system = System::new();
system.refresh_all();
Self {
name: sysinfo::System::name().unwrap_or_else(|| build_info::TARGET.to_string()),
version: sysinfo::System::os_version(),
kernel_version: sysinfo::System::kernel_version(),
name: System::name().unwrap_or_else(|| build_info::TARGET.to_string()),
version: System::os_version(),
kernel_version: System::kernel_version(),
}
}