Split into workspaces, move proxy module into its own crate

This commit is contained in:
Vicki Pfau 2025-07-04 16:02:38 -07:00
parent 9ddfde23e6
commit 46dc187b34
56 changed files with 127 additions and 106 deletions

8
Cargo.lock generated
View file

@ -1196,6 +1196,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"speech-dispatcher", "speech-dispatcher",
"steamos-manager-proxy",
"strum", "strum",
"sysinfo", "sysinfo",
"tempfile", "tempfile",
@ -1211,6 +1212,13 @@ dependencies = [
"zbus_xml", "zbus_xml",
] ]
[[package]]
name = "steamos-manager-proxy"
version = "25.6.1"
dependencies = [
"zbus",
]
[[package]] [[package]]
name = "strum" name = "strum"
version = "0.27.1" version = "0.27.1"

View file

@ -1,39 +1,6 @@
[package] [workspace]
name = "steamos-manager" resolver = "2"
version = "25.6.1" members = ["steamos-manager", "steamos-manager-proxy"]
edition = "2021"
repository = "https://gitlab.steamos.cloud/holo/steamos-manager/"
[profile.release] [profile.release]
strip="symbols" strip="symbols"
[dependencies]
anyhow = "1"
async-trait = "0.1"
clap = { version = "4.5", default-features = false, features = ["derive", "help", "std", "usage"] }
config = { version = "0.15", default-features = false, features = ["async", "ini", "toml"] }
gio = "0.20"
inotify = { version = "0.11", default-features = false, features = ["stream"] }
input-linux = "0.7"
itertools = "0.14"
lazy_static = "1"
libc = "0.2"
nix = { version = "0.30", default-features = false, features = ["fs", "poll", "signal", "time", "user"] }
num_enum = "0.7"
regex = "1"
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_json = "1.0"
speech-dispatcher = "0.16"
strum = { version = "0.27", features = ["derive"] }
sysinfo = "0.35"
tempfile = "3"
tokio = { version = "1", default-features = false, features = ["fs", "io-std", "io-util", "macros", "process", "rt-multi-thread", "signal", "sync"] }
tokio-stream = { version = "0.1", default-features = false }
tokio-util = { version = "0.7", default-features = false }
toml = "0.8"
tracing = { version = "0.1", default-features = false }
tracing-subscriber = { version = "0.3", default-features = false, features = ["env-filter", "fmt"] }
udev = { version = "^0.9.3", features = ["send", "sync"] }
xdg = "3.0"
zbus = { version = "5", default-features = false, features = ["tokio"] }
zbus_xml = "5"

View file

@ -1,62 +0,0 @@
/*
* Copyright © 2023 Collabora Ltd.
* Copyright © 2024 Valve Software
*
* SPDX-License-Identifier: MIT
*/
#![allow(clippy::module_name_repetitions)]
// Re-export relevant proxies
// Deprecated interface
mod manager;
pub use crate::proxy::manager::ManagerProxy;
// Optional interfaces
mod ambient_light_sensor1;
mod battery_charge_limit1;
mod cpu_scaling1;
mod factory_reset1;
mod fan_control1;
mod gpu_performance_level1;
mod gpu_power_profile1;
mod hdmi_cec1;
mod low_power_mode1;
mod manager2;
mod performance_profile1;
mod screenreader0;
mod storage1;
mod tdp_limit1;
mod update_bios1;
mod update_dock1;
mod wifi_debug1;
mod wifi_debug_dump1;
mod wifi_power_management1;
pub use crate::proxy::ambient_light_sensor1::AmbientLightSensor1Proxy;
pub use crate::proxy::battery_charge_limit1::BatteryChargeLimit1Proxy;
pub use crate::proxy::cpu_scaling1::CpuScaling1Proxy;
pub use crate::proxy::factory_reset1::FactoryReset1Proxy;
pub use crate::proxy::fan_control1::FanControl1Proxy;
pub use crate::proxy::gpu_performance_level1::GpuPerformanceLevel1Proxy;
pub use crate::proxy::gpu_power_profile1::GpuPowerProfile1Proxy;
pub use crate::proxy::hdmi_cec1::HdmiCec1Proxy;
pub use crate::proxy::low_power_mode1::LowPowerMode1Proxy;
pub use crate::proxy::manager2::Manager2Proxy;
pub use crate::proxy::performance_profile1::PerformanceProfile1Proxy;
pub use crate::proxy::screenreader0::ScreenReader0Proxy;
pub use crate::proxy::storage1::Storage1Proxy;
pub use crate::proxy::tdp_limit1::TdpLimit1Proxy;
pub use crate::proxy::update_bios1::UpdateBios1Proxy;
pub use crate::proxy::update_dock1::UpdateDock1Proxy;
pub use crate::proxy::wifi_debug1::WifiDebug1Proxy;
pub use crate::proxy::wifi_debug_dump1::WifiDebugDump1Proxy;
pub use crate::proxy::wifi_power_management1::WifiPowerManagement1Proxy;
// Sub-interfaces
mod job1;
mod job_manager1;
mod udev_events1;
pub use crate::proxy::job1::Job1Proxy;
pub use crate::proxy::job_manager1::JobManager1Proxy;
pub use crate::proxy::udev_events1::UdevEvents1Proxy;

View file

@ -0,0 +1,8 @@
[package]
name = "steamos-manager-proxy"
version = "25.6.1"
edition = "2021"
repository = "https://gitlab.steamos.cloud/holo/steamos-manager/"
[dependencies]
zbus = { version = "5", default-features = false, features = ["tokio"] }

View file

@ -0,0 +1,62 @@
/*
* Copyright © 2023 Collabora Ltd.
* Copyright © 2024 Valve Software
*
* SPDX-License-Identifier: MIT
*/
#![allow(clippy::module_name_repetitions)]
// Re-export relevant proxies
// Deprecated interface
mod manager;
pub use crate::manager::ManagerProxy;
// Optional interfaces
mod ambient_light_sensor1;
mod battery_charge_limit1;
mod cpu_scaling1;
mod factory_reset1;
mod fan_control1;
mod gpu_performance_level1;
mod gpu_power_profile1;
mod hdmi_cec1;
mod low_power_mode1;
mod manager2;
mod performance_profile1;
mod screenreader0;
mod storage1;
mod tdp_limit1;
mod update_bios1;
mod update_dock1;
mod wifi_debug1;
mod wifi_debug_dump1;
mod wifi_power_management1;
pub use crate::ambient_light_sensor1::AmbientLightSensor1Proxy;
pub use crate::battery_charge_limit1::BatteryChargeLimit1Proxy;
pub use crate::cpu_scaling1::CpuScaling1Proxy;
pub use crate::factory_reset1::FactoryReset1Proxy;
pub use crate::fan_control1::FanControl1Proxy;
pub use crate::gpu_performance_level1::GpuPerformanceLevel1Proxy;
pub use crate::gpu_power_profile1::GpuPowerProfile1Proxy;
pub use crate::hdmi_cec1::HdmiCec1Proxy;
pub use crate::low_power_mode1::LowPowerMode1Proxy;
pub use crate::manager2::Manager2Proxy;
pub use crate::performance_profile1::PerformanceProfile1Proxy;
pub use crate::screenreader0::ScreenReader0Proxy;
pub use crate::storage1::Storage1Proxy;
pub use crate::tdp_limit1::TdpLimit1Proxy;
pub use crate::update_bios1::UpdateBios1Proxy;
pub use crate::update_dock1::UpdateDock1Proxy;
pub use crate::wifi_debug1::WifiDebug1Proxy;
pub use crate::wifi_debug_dump1::WifiDebugDump1Proxy;
pub use crate::wifi_power_management1::WifiPowerManagement1Proxy;
// Sub-interfaces
mod job1;
mod job_manager1;
mod udev_events1;
pub use crate::job1::Job1Proxy;
pub use crate::job_manager1::JobManager1Proxy;
pub use crate::udev_events1::UdevEvents1Proxy;

View file

@ -0,0 +1,37 @@
[package]
name = "steamos-manager"
version = "25.6.1"
edition = "2021"
repository = "https://gitlab.steamos.cloud/holo/steamos-manager/"
[dependencies]
anyhow = "1"
async-trait = "0.1"
clap = { version = "4.5", default-features = false, features = ["derive", "help", "std", "usage"] }
config = { version = "0.15", default-features = false, features = ["async", "ini", "toml"] }
gio = "0.20"
inotify = { version = "0.11", default-features = false, features = ["stream"] }
input-linux = "0.7"
itertools = "0.14"
lazy_static = "1"
libc = "0.2"
nix = { version = "0.30", default-features = false, features = ["fs", "poll", "signal", "time", "user"] }
num_enum = "0.7"
regex = "1"
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_json = "1.0"
speech-dispatcher = "0.16"
steamos-manager-proxy = { path = "../steamos-manager-proxy" }
strum = { version = "0.27", features = ["derive"] }
sysinfo = "0.35"
tempfile = "3"
tokio = { version = "1", default-features = false, features = ["fs", "io-std", "io-util", "macros", "process", "rt-multi-thread", "signal", "sync"] }
tokio-stream = { version = "0.1", default-features = false }
tokio-util = { version = "0.7", default-features = false }
toml = "0.8"
tracing = { version = "0.1", default-features = false }
tracing-subscriber = { version = "0.3", default-features = false, features = ["env-filter", "fmt"] }
udev = { version = "^0.9.3", features = ["send", "sync"] }
xdg = "3.0"
zbus = { version = "5", default-features = false, features = ["tokio"] }
zbus_xml = "5"

View file

@ -33,7 +33,7 @@ const PRODUCT_NAME_PATH: &str = "/sys/class/dmi/id/product_name";
#[cfg(not(test))] #[cfg(not(test))]
const DEVICE_CONFIG_PATH: &str = "/usr/share/steamos-manager/devices"; const DEVICE_CONFIG_PATH: &str = "/usr/share/steamos-manager/devices";
#[cfg(test)] #[cfg(test)]
const DEVICE_CONFIG_PATH: &str = "data/devices"; const DEVICE_CONFIG_PATH: &str = "../data/devices";
#[derive(Display, EnumString, PartialEq, Debug, Default, Copy, Clone)] #[derive(Display, EnumString, PartialEq, Debug, Default, Copy, Clone)]
#[strum(serialize_all = "snake_case", ascii_case_insensitive)] #[strum(serialize_all = "snake_case", ascii_case_insensitive)]

View file

@ -18,6 +18,8 @@ use tokio::io::AsyncWriteExt;
use tokio_util::sync::CancellationToken; use tokio_util::sync::CancellationToken;
use tracing::{debug, error, info, warn}; use tracing::{debug, error, info, warn};
pub use steamos_manager_proxy as proxy;
mod ds_inhibit; mod ds_inhibit;
mod error; mod error;
mod inputplumber; mod inputplumber;
@ -34,7 +36,6 @@ pub mod cec;
pub mod daemon; pub mod daemon;
pub mod hardware; pub mod hardware;
pub mod power; pub mod power;
pub mod proxy;
pub mod screenreader; pub mod screenreader;
pub mod wifi; pub mod wifi;

View file

@ -1345,7 +1345,7 @@ mod test {
.await .await
.expect("remote"); .expect("remote");
let local = testing::InterfaceIntrospection::from_local( let local = testing::InterfaceIntrospection::from_local(
"com.steampowered.SteamOSManager1.Manager.xml", "../com.steampowered.SteamOSManager1.Manager.xml",
"com.steampowered.SteamOSManager1.Manager", "com.steampowered.SteamOSManager1.Manager",
) )
.await .await
@ -1357,7 +1357,7 @@ mod test {
let remote = let remote =
testing::InterfaceIntrospection::from_remote::<I, _>(connection, MANAGER_PATH).await?; testing::InterfaceIntrospection::from_remote::<I, _>(connection, MANAGER_PATH).await?;
let local = testing::InterfaceIntrospection::from_local( let local = testing::InterfaceIntrospection::from_local(
"com.steampowered.SteamOSManager1.xml", "../com.steampowered.SteamOSManager1.xml",
I::name().to_string(), I::name().to_string(),
) )
.await?; .await?;

View file

@ -341,7 +341,7 @@ mod test {
#[tokio::test] #[tokio::test]
async fn jupiter_valid() { async fn jupiter_valid() {
let config = read_to_string("data/devices/jupiter.toml") let config = read_to_string("../data/devices/jupiter.toml")
.await .await
.expect("read_to_string"); .expect("read_to_string");
let res = toml::from_str::<PlatformConfig>(config.as_ref()); let res = toml::from_str::<PlatformConfig>(config.as_ref());

View file

@ -36,7 +36,7 @@ use crate::systemd::SystemdUnit;
use crate::uinput::UInputDevice; use crate::uinput::UInputDevice;
#[cfg(test)] #[cfg(test)]
const TEST_ORCA_SETTINGS: &str = "data/test-orca-settings.conf"; const TEST_ORCA_SETTINGS: &str = "../data/test-orca-settings.conf";
#[cfg(test)] #[cfg(test)]
const ORCA_SETTINGS: &str = "orca-settings.conf"; const ORCA_SETTINGS: &str = "orca-settings.conf";
#[cfg(test)] #[cfg(test)]

View file

@ -118,7 +118,7 @@ impl MockDBus {
.args([ .args([
"--nofork", "--nofork",
"--print-address", "--print-address",
"--config-file=data/test-dbus.conf", "--config-file=../data/test-dbus.conf",
]) ])
.stdout(Stdio::piped()) .stdout(Stdio::piped())
.spawn()?; .spawn()?;

View file

@ -213,7 +213,7 @@ mod test {
.await .await
.expect("remove"); .expect("remove");
let local = testing::InterfaceIntrospection::from_local( let local = testing::InterfaceIntrospection::from_local(
"com.steampowered.SteamOSManager1.xml", "../com.steampowered.SteamOSManager1.xml",
UdevDbusObject::name().to_string(), UdevDbusObject::name().to_string(),
) )
.await .await