Skip to content

Commit f7adec9

Browse files
authored
chore(deps): cargo update (#9)
1 parent 56913be commit f7adec9

File tree

13 files changed

+519
-424
lines changed

13 files changed

+519
-424
lines changed

Cargo.lock

Lines changed: 453 additions & 387 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ anyhow = "1.0.75"
3737
appkit-nsworkspace-bindings = { path = "lib/macos-utils/appkit-nsworkspace-bindings" }
3838
async-trait = "0.1.74"
3939
aws-types = "1.2.0"
40-
base64 = "0.22.0"
40+
base64 = "0.22.1"
4141
bytes = "1.5.0"
42-
bitflags = { version = "2.4.0", features = ["serde"] }
42+
bitflags = { version = "2.6.0", features = ["serde"] }
4343
bstr = "1.1.0"
4444
camino = { version = "1.1.3", features = ["serde1"] }
4545
cfg-if = "1.0.0"
@@ -50,7 +50,7 @@ clap = { version = "4.4.0", features = [
5050
"unicode",
5151
"wrap_help",
5252
] }
53-
crossterm = "0.27.0"
53+
crossterm = "0.28.1"
5454
dashmap = "6.0.1"
5555
dirs = "5.0.0"
5656
fig_api_client = { path = "lib/fig_api_client" }
@@ -108,8 +108,8 @@ semver = { version = "1.0.16", features = ["serde"] }
108108
serde = { version = "1.0.197", features = ["derive", "rc"] }
109109
serde_json = "1.0.115"
110110
sha2 = "0.10.6"
111-
strum = { version = "0.26.1", features = ["derive"] }
112-
sysinfo = "0.30.11"
111+
strum = { version = "0.26.3", features = ["derive"] }
112+
sysinfo = "0.32.0"
113113
thiserror = "1.0.58"
114114
tempfile = "3.10.1"
115115
time = { version = "0.3.34", features = [
@@ -129,7 +129,7 @@ tracing-subscriber = { version = "0.3.17", features = [
129129
"time",
130130
] }
131131
uuid = { version = "1.8.0", features = ["v4", "serde"] }
132-
which = "6.0.0"
132+
which = "6.0.3"
133133
whoami = "1.5.1"
134134

135135
[workspace.lints.rust]

deny.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ db-path = "~/.cargo/advisory-db"
44
db-urls = ["https://github.com/rustsec/advisory-db"]
55
yanked = "deny"
66

7+
ignore = [
8+
# proc-macro-error is a transitive dependency of a number of dependencies,
9+
# this is allowed for now til the ecosystem migrates away
10+
"RUSTSEC-2024-0370",
11+
]
12+
713
[licenses]
814
version = 2
915
private = { ignore = true }

fig_desktop/src/install.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,8 @@ async fn launch_systemd_user_service(service: SystemdUserService) -> anyhow::Res
694694
#[cfg(target_os = "linux")]
695695
#[allow(dead_code)]
696696
async fn launch_ibus(ctx: &Context) {
697+
use std::ffi::OsString;
698+
697699
use sysinfo::{
698700
ProcessRefreshKind,
699701
RefreshKind,
@@ -704,7 +706,8 @@ async fn launch_ibus(ctx: &Context) {
704706
let system = tokio::task::block_in_place(|| {
705707
System::new_with_specifics(RefreshKind::new().with_processes(ProcessRefreshKind::new()))
706708
});
707-
if system.processes_by_name("ibus-daemon").next().is_none() {
709+
let ibus_daemon = OsString::from("ibus-daemon");
710+
if system.processes_by_name(&ibus_daemon).next().is_none() {
708711
info!("Launching ibus via systemd");
709712

710713
match Command::new("systemctl")
@@ -1014,7 +1017,6 @@ echo "{binary_name} {version}"
10141017
mod linux_desktop_entry_tests {
10151018
use fig_integrations::desktop_entry::{
10161019
AutostartIntegration,
1017-
global_entry_path,
10181020
local_entry_path,
10191021
local_icon_path,
10201022
};

fig_desktop/src/main.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ async fn main() {
238238

239239
#[cfg(target_os = "linux")]
240240
async fn allow_multiple_running_check(current_pid: sysinfo::Pid, kill_old: bool, page: Option<String>) {
241+
use std::ffi::OsString;
242+
241243
use tracing::debug;
242244

243245
if kill_old {
@@ -249,7 +251,8 @@ async fn allow_multiple_running_check(current_pid: sysinfo::Pid, kill_old: bool,
249251
let system = System::new_with_specifics(
250252
RefreshKind::new().with_processes(ProcessRefreshKind::new().with_user(sysinfo::UpdateKind::Always)),
251253
);
252-
let processes = system.processes_by_exact_name(APP_PROCESS_NAME);
254+
let app_process_name = OsString::from(APP_PROCESS_NAME);
255+
let processes = system.processes_by_exact_name(&app_process_name);
253256

254257
let processes = processes.collect::<Vec<_>>();
255258
debug!("Checking for already running desktop instance: {:?}", processes);
@@ -293,8 +296,11 @@ async fn allow_multiple_running_check(current_pid: sysinfo::Pid, kill_old: bool,
293296

294297
#[cfg(target_os = "macos")]
295298
async fn allow_multiple_running_check(current_pid: sysinfo::Pid, kill_old: bool, page: Option<String>) {
299+
use std::ffi::OsString;
300+
301+
let app_process_name = OsString::from(APP_PROCESS_NAME);
296302
let system = System::new_with_specifics(RefreshKind::new().with_processes(ProcessRefreshKind::new()));
297-
let processes = system.processes_by_name(APP_PROCESS_NAME);
303+
let processes = system.processes_by_name(&app_process_name);
298304

299305
cfg_if::cfg_if! {
300306
if #[cfg(unix)] {

lib/fig_diagnostic/src/lib.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ use fig_util::{
1818
Terminal,
1919
};
2020
use serde::Serialize;
21+
use sysinfo::{
22+
CpuRefreshKind,
23+
MemoryRefreshKind,
24+
RefreshKind,
25+
};
2126
use time::OffsetDateTime;
2227
use time::format_description::well_known::Rfc3339;
2328

@@ -97,20 +102,20 @@ pub struct SystemInfo {
97102

98103
impl SystemInfo {
99104
fn new() -> SystemInfo {
100-
use sysinfo::System;
101-
102-
let mut sys = System::new();
103-
sys.refresh_cpu();
104-
sys.refresh_memory();
105+
let system = sysinfo::System::new_with_specifics(
106+
RefreshKind::new()
107+
.with_cpu(CpuRefreshKind::everything())
108+
.with_memory(MemoryRefreshKind::everything()),
109+
);
105110

106111
let mut hardware_info = SystemInfo {
107112
os: os_version(),
108113
chip: None,
109-
total_cores: sys.physical_core_count(),
110-
memory: Some(format!("{:0.2} GB", sys.total_memory() as f32 / 2.0_f32.powi(30))),
114+
total_cores: system.physical_core_count(),
115+
memory: Some(format!("{:0.2} GB", system.total_memory() as f32 / 2.0_f32.powi(30))),
111116
};
112117

113-
if let Some(processor) = sys.cpus().first() {
118+
if let Some(processor) = system.cpus().first() {
114119
hardware_info.chip = Some(processor.brand().into());
115120
}
116121

lib/fig_os_shim/src/sysinfo.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use std::ffi::OsString;
12
use std::sync::{
23
Arc,
34
Mutex,
@@ -38,13 +39,9 @@ impl SysInfo {
3839
use inner::Inner;
3940
match &self.0 {
4041
Inner::Real => {
41-
use sysinfo::ProcessRefreshKind;
42-
43-
let mut s = sysinfo::System::new();
44-
s.refresh_processes_specifics(ProcessRefreshKind::new());
45-
46-
let x = s.processes_by_name(name).next().is_some();
47-
x
42+
let system = sysinfo::System::new_all();
43+
let is_running = system.processes_by_name(&OsString::from(name)).next().is_some();
44+
is_running
4845
},
4946
Inner::Fake(fake) => fake.lock().unwrap().process_names.contains(name),
5047
}

lib/fig_util/src/directories.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,11 +527,10 @@ mod tests {
527527
}
528528

529529
macro_rules! assert_directory {
530-
($value:expr, @ $snapshot:literal) => {
530+
($value:expr, @$snapshot:literal) => {
531531
insta::assert_snapshot!(
532-
insta::_macro_support::ReferenceValue::Inline($snapshot),
533532
sanitized_directory_path($value),
534-
stringify!(sanitized_directory_path($value))
533+
@$snapshot,
535534
)
536535
};
537536
}

packages/api-bindings-wrappers/src/executeCommand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import logger from "loglevel";
1111
export const cleanOutput = (output: string) =>
1212
output
1313
.replace(/\r\n/g, "\n") // Replace carriage returns with just a normal return
14-
.replace(/\033\[\?25h/g, "") // removes cursor character if present
14+
// eslint-disable-next-line no-control-regex
15+
.replace(/\x1b\[\?25h/g, "") // removes cursor character if present
1516
.replace(/^\n+/, "") // strips new lines from start of output
1617
.replace(/\n+$/, ""); // strips new lines from end of output
1718

q_cli/src/cli/doctor/checks/linux.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,17 @@ impl DoctorCheck<LinuxContext> for IBusCheck {
256256
}
257257

258258
async fn check(&self, _: &LinuxContext) -> Result<(), DoctorError> {
259+
use std::ffi::OsString;
260+
259261
use sysinfo::{
260262
ProcessRefreshKind,
261263
RefreshKind,
262264
};
263265

264266
let system = sysinfo::System::new_with_specifics(RefreshKind::new().with_processes(ProcessRefreshKind::new()));
267+
let ibus_daemon = OsString::from("ibus-daemon");
265268

266-
if system.processes_by_exact_name("ibus-daemon").next().is_none() {
269+
if system.processes_by_exact_name(&ibus_daemon).next().is_none() {
267270
return Err(doctor_fix!({
268271
reason: "ibus-daemon is not running",
269272
fix: || {

0 commit comments

Comments
 (0)