mirror of
https://github.com/marcoallegretti/WEFT_OS.git
synced 2026-03-26 17:03:09 +00:00
fix(ci): clippy lints in weft-appd, remove unused sd-notify dep, add missing apt packages
This commit is contained in:
parent
2beebf13d2
commit
51eccc30de
3 changed files with 17 additions and 20 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -62,6 +62,7 @@ jobs:
|
||||||
libseat-dev \
|
libseat-dev \
|
||||||
libudev-dev \
|
libudev-dev \
|
||||||
libsystemd-dev \
|
libsystemd-dev \
|
||||||
|
libdisplay-info-dev \
|
||||||
pkg-config
|
pkg-config
|
||||||
- name: cargo clippy (linux-only crates)
|
- name: cargo clippy (linux-only crates)
|
||||||
run: >
|
run: >
|
||||||
|
|
@ -97,6 +98,7 @@ jobs:
|
||||||
libgles2-mesa-dev \
|
libgles2-mesa-dev \
|
||||||
libgbm-dev \
|
libgbm-dev \
|
||||||
libdrm-dev \
|
libdrm-dev \
|
||||||
|
libfontconfig-dev \
|
||||||
pkg-config
|
pkg-config
|
||||||
- name: cargo check servo-embed (weft-servo-shell)
|
- name: cargo check servo-embed (weft-servo-shell)
|
||||||
run: >
|
run: >
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
sd-notify = "0.4"
|
|
||||||
weft-ipc-types = { path = "../weft-ipc-types" }
|
weft-ipc-types = { path = "../weft-ipc-types" }
|
||||||
toml = "0.8"
|
toml = "0.8"
|
||||||
tokio = { version = "1", features = ["rt-multi-thread", "macros", "net", "io-util", "signal", "sync", "process", "time"] }
|
tokio = { version = "1", features = ["rt-multi-thread", "macros", "net", "io-util", "signal", "sync", "process", "time"] }
|
||||||
|
|
|
||||||
|
|
@ -334,12 +334,11 @@ pub(crate) async fn dispatch(req: Request, registry: &Registry) -> Response {
|
||||||
let compositor_tx = registry.lock().await.compositor_tx.clone();
|
let compositor_tx = registry.lock().await.compositor_tx.clone();
|
||||||
let ipc_socket = session_ipc_socket_path(session_id);
|
let ipc_socket = session_ipc_socket_path(session_id);
|
||||||
let broadcast = registry.lock().await.broadcast().clone();
|
let broadcast = registry.lock().await.broadcast().clone();
|
||||||
if let Some(ref sock_path) = ipc_socket {
|
if let Some(ref sock_path) = ipc_socket
|
||||||
if let Some(tx) =
|
&& let Some(tx) =
|
||||||
runtime::spawn_ipc_relay(session_id, sock_path.clone(), broadcast).await
|
runtime::spawn_ipc_relay(session_id, sock_path.clone(), broadcast).await
|
||||||
{
|
{
|
||||||
registry.lock().await.register_ipc_sender(session_id, tx);
|
registry.lock().await.register_ipc_sender(session_id, tx);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
let reg = Arc::clone(registry);
|
let reg = Arc::clone(registry);
|
||||||
let aid = app_id.clone();
|
let aid = app_id.clone();
|
||||||
|
|
@ -388,11 +387,11 @@ pub(crate) async fn dispatch(req: Request, registry: &Registry) -> Response {
|
||||||
session_id,
|
session_id,
|
||||||
payload,
|
payload,
|
||||||
} => {
|
} => {
|
||||||
if let Some(tx) = registry.lock().await.ipc_sender_for(session_id) {
|
if let Some(tx) = registry.lock().await.ipc_sender_for(session_id)
|
||||||
if tx.send(payload).await.is_err() {
|
&& tx.send(payload).await.is_err()
|
||||||
tracing::warn!(session_id, "IPC relay sender closed");
|
{
|
||||||
registry.lock().await.remove_ipc_sender(session_id);
|
tracing::warn!(session_id, "IPC relay sender closed");
|
||||||
}
|
registry.lock().await.remove_ipc_sender(session_id);
|
||||||
}
|
}
|
||||||
Response::AppState {
|
Response::AppState {
|
||||||
session_id,
|
session_id,
|
||||||
|
|
@ -499,9 +498,8 @@ mod tests {
|
||||||
unsafe { std::env::remove_var("WEFT_APPD_WS_PORT") };
|
unsafe { std::env::remove_var("WEFT_APPD_WS_PORT") };
|
||||||
let port = ws_port();
|
let port = ws_port();
|
||||||
unsafe {
|
unsafe {
|
||||||
match prior {
|
if let Some(v) = prior {
|
||||||
Some(v) => std::env::set_var("WEFT_APPD_WS_PORT", v),
|
std::env::set_var("WEFT_APPD_WS_PORT", v)
|
||||||
None => {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert_eq!(port, 7410);
|
assert_eq!(port, 7410);
|
||||||
|
|
@ -545,13 +543,11 @@ mod tests {
|
||||||
}
|
}
|
||||||
let result = appd_socket_path();
|
let result = appd_socket_path();
|
||||||
unsafe {
|
unsafe {
|
||||||
match prior_sock {
|
if let Some(v) = prior_sock {
|
||||||
Some(v) => std::env::set_var("WEFT_APPD_SOCKET", v),
|
std::env::set_var("WEFT_APPD_SOCKET", v)
|
||||||
None => {}
|
|
||||||
}
|
}
|
||||||
match prior_xdg {
|
if let Some(v) = prior_xdg {
|
||||||
Some(v) => std::env::set_var("XDG_RUNTIME_DIR", v),
|
std::env::set_var("XDG_RUNTIME_DIR", v)
|
||||||
None => {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert!(result.is_err());
|
assert!(result.is_err());
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue