chore: restructure Cargo.toml files to use workspace-level dependencies

This commit is contained in:
Ilya Zlobintsev 2024-02-04 23:14:50 +02:00
parent 66c3f298c2
commit f90a817085
18 changed files with 77 additions and 71 deletions

3
Cargo.lock generated
View File

@ -1288,6 +1288,7 @@ dependencies = [
name = "lact-client"
version = "0.5.2"
dependencies = [
"amdgpu-sysfs",
"anyhow",
"lact-schema",
"nix 0.27.1",
@ -1300,6 +1301,7 @@ dependencies = [
name = "lact-daemon"
version = "0.5.2"
dependencies = [
"amdgpu-sysfs",
"anyhow",
"bincode",
"chrono",
@ -1325,6 +1327,7 @@ dependencies = [
name = "lact-gui"
version = "0.5.2"
dependencies = [
"amdgpu-sysfs",
"anyhow",
"gtk4",
"lact-client",

View File

@ -9,5 +9,17 @@ members = [
"lact-daemon",
]
[workspace.dependencies]
amdgpu-sysfs = { version = "0.14.0", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
serde_with = { version = "3.5.0", default-features = false, features = [
"macros",
] }
serde_json = "1.0.111"
anyhow = "1.0.79"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
nix = { version = "0.27.1", default-features = false }
[profile.release]
strip = "symbols"

View File

@ -5,8 +5,11 @@ edition = "2021"
[dependencies]
lact-schema = { path = "../lact-schema" }
anyhow = "1.0.79"
nix = { version = "0.27.1", default-features = false }
serde = "1.0.195"
tracing = "0.1.40"
serde_json = "1.0.111"
amdgpu-sysfs = { workspace = true }
anyhow = { workspace = true }
tracing = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
nix = { workspace = true }

View File

@ -3,12 +3,12 @@ mod macros;
pub use lact_schema as schema;
use amdgpu_sysfs::gpu_handle::{
power_profile_mode::PowerProfileModesTable, PerformanceLevel, PowerLevelKind,
};
use anyhow::{anyhow, Context};
use nix::unistd::getuid;
use schema::{
amdgpu_sysfs::gpu_handle::{
power_profile_mode::PowerProfileModesTable, PerformanceLevel, PowerLevelKind,
},
request::{ConfirmCommand, SetClocksCommand},
ClocksInfo, DeviceInfo, DeviceListEntry, DeviceStats, FanControlMode, FanCurveMap, PmfwOptions,
PowerStates, Request, Response, SystemInfo,

View File

@ -8,12 +8,19 @@ default = ["drm"]
drm = ["libdrm_amdgpu_sys"]
[dependencies]
anyhow = "1.0"
lact-schema = { path = "../lact-schema" }
amdgpu-sysfs = { workspace = true }
anyhow = { workspace = true }
tracing = { workspace = true }
serde = { workspace = true }
serde_with = { workspace = true }
serde_json = { workspace = true }
tracing-subscriber = { workspace = true }
nix = { workspace = true, features = ["user", "fs", "process"] }
bincode = "1.3"
nix = { version = "0.27", features = ["user", "fs", "process"] }
pciid-parser = { version = "0.7", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.9"
tokio = { version = "1.35.1", features = [
"rt",
@ -24,14 +31,8 @@ tokio = { version = "1.35.1", features = [
"signal",
"sync",
] }
tracing = "0.1"
tracing-subscriber = "0.3"
vulkano = { version = "0.34.1", default-features = false }
lact-schema = { path = "../lact-schema" }
futures = { version = "0.3.30", default-features = false }
serde_with = { version = "3.5.0", default-features = false, features = [
"macros",
] }
zbus = { version = "3.14.1", default-features = false, features = ["tokio"] }
libdrm_amdgpu_sys = { optional = true, version = "0.4.1" }
tar = "0.4.40"

View File

@ -1,11 +1,7 @@
use crate::server::gpu_controller::fan_control::FanCurve;
use amdgpu_sysfs::gpu_handle::{PerformanceLevel, PowerLevelKind};
use anyhow::Context;
use lact_schema::{
amdgpu_sysfs::gpu_handle::{PerformanceLevel, PowerLevelKind},
default_fan_curve,
request::SetClocksCommand,
FanControlMode, PmfwOptions,
};
use lact_schema::{default_fan_curve, request::SetClocksCommand, FanControlMode, PmfwOptions};
use nix::unistd::getuid;
use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;

View File

@ -1,10 +1,8 @@
use std::cmp;
use amdgpu_sysfs::{gpu_handle::fan_control::FanCurve as PmfwCurve, hw_mon::Temperature};
use anyhow::{anyhow, Context};
use lact_schema::{
amdgpu_sysfs::{gpu_handle::fan_control::FanCurve as PmfwCurve, hw_mon::Temperature},
default_fan_curve, FanCurveMap,
};
use lact_schema::{default_fan_curve, FanCurveMap};
use serde::{Deserialize, Serialize};
use tracing::warn;
@ -96,7 +94,7 @@ impl Default for FanCurve {
#[cfg(test)]
mod tests {
use super::{FanCurve, PmfwCurve};
use lact_schema::amdgpu_sysfs::{gpu_handle::fan_control::FanCurveRanges, hw_mon::Temperature};
use amdgpu_sysfs::{gpu_handle::fan_control::FanCurveRanges, hw_mon::Temperature};
fn simple_pwm(temp: f32) -> u8 {
let curve = FanCurve([(0, 0.0), (100, 1.0)].into());

View File

@ -6,18 +6,18 @@ use crate::{
config::{self, ClocksConfiguration},
fork::run_forked,
};
use amdgpu_sysfs::{
error::Error,
gpu_handle::{
fan_control::FanCurve as PmfwCurve,
overdrive::{ClocksTable, ClocksTableGen},
GpuHandle, PerformanceLevel, PowerLevelKind, PowerLevels,
},
hw_mon::{FanControlMethod, HwMon},
sysfs::SysFS,
};
use anyhow::{anyhow, Context};
use lact_schema::{
amdgpu_sysfs::{
error::Error,
gpu_handle::{
fan_control::FanCurve as PmfwCurve,
overdrive::{ClocksTable, ClocksTableGen},
GpuHandle, PerformanceLevel, PowerLevelKind, PowerLevels,
},
hw_mon::{FanControlMethod, HwMon},
sysfs::SysFS,
},
ClocksInfo, ClockspeedStats, DeviceInfo, DeviceStats, DrmInfo, FanStats, GpuPciInfo, LinkInfo,
PciInfo, PmfwInfo, PowerState, PowerStates, PowerStats, VoltageStats, VramStats,
};
@ -41,7 +41,7 @@ use tracing::{debug, error, trace, warn};
#[cfg(feature = "libdrm_amdgpu_sys")]
use {
lact_schema::DrmMemoryInfo,
libdrm_amdgpu_sys::AMDGPU::{DeviceHandle as DrmHandle, GPU_INFO, MetricsInfo},
libdrm_amdgpu_sys::AMDGPU::{DeviceHandle as DrmHandle, MetricsInfo, GPU_INFO},
std::{fs::File, os::fd::IntoRawFd},
};

View File

@ -3,14 +3,12 @@ use super::{
system::PP_FEATURE_MASK_PATH,
};
use crate::config::{self, default_fan_static_speed, Config, FanControlSettings};
use amdgpu_sysfs::{
gpu_handle::{power_profile_mode::PowerProfileModesTable, PerformanceLevel, PowerLevelKind},
sysfs::SysFS,
};
use anyhow::{anyhow, Context};
use lact_schema::{
amdgpu_sysfs::{
gpu_handle::{
power_profile_mode::PowerProfileModesTable, PerformanceLevel, PowerLevelKind,
},
sysfs::SysFS,
},
default_fan_curve,
request::{ConfirmCommand, SetClocksCommand},
ClocksInfo, DeviceInfo, DeviceListEntry, DeviceStats, FanControlMode, FanCurveMap, PmfwOptions,

View File

@ -11,10 +11,13 @@ gtk-tests = []
[dependencies]
lact-client = { path = "../lact-client" }
lact-daemon = { path = "../lact-daemon", default-features = false }
amdgpu-sysfs = { workspace = true }
tracing = { workspace = true }
anyhow = { workspace = true }
tracing-subscriber = { workspace = true }
gtk = { version = "0.7", package = "gtk4", features = ["v4_6", "blueprint"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
anyhow = "1.0"
adw = { package = "libadwaita", version = "0.5.3", features = [
"v1_4",
], optional = true }

View File

@ -1,9 +1,8 @@
use crate::app::page_section::PageSection;
use amdgpu_sysfs::gpu_handle::overdrive::{ClocksTable, ClocksTableGen};
use glib::clone;
use gtk::prelude::*;
use gtk::*;
use lact_client::schema::amdgpu_sysfs;
use lact_client::schema::amdgpu_sysfs::gpu_handle::overdrive::{ClocksTable, ClocksTableGen};
use std::rc::Rc;
use std::sync::atomic::{AtomicBool, Ordering};
use tracing::debug;

View File

@ -7,15 +7,12 @@ mod power_states;
use self::power_cap_section::PowerCapSection;
use self::power_states::power_states_frame::PowerStatesFrame;
use amdgpu_sysfs::gpu_handle::{overdrive::ClocksTableGen, PerformanceLevel, PowerLevelKind};
use clocks_frame::ClocksFrame;
use gpu_stats_section::GpuStatsSection;
use gtk::*;
use gtk::{glib::clone, prelude::*};
use lact_client::schema::amdgpu_sysfs::gpu_handle::PowerLevelKind;
use lact_client::schema::{
amdgpu_sysfs::gpu_handle::{overdrive::ClocksTableGen, PerformanceLevel},
DeviceStats, SystemInfo,
};
use lact_client::schema::{DeviceStats, SystemInfo};
use performance_frame::PerformanceFrame;
// use power_cap_frame::PowerCapFrame;
use std::collections::HashMap;

View File

@ -1,10 +1,8 @@
use crate::app::page_section::PageSection;
use amdgpu_sysfs::gpu_handle::{power_profile_mode::PowerProfileModesTable, PerformanceLevel};
use glib::clone;
use gtk::prelude::*;
use gtk::*;
use lact_client::schema::amdgpu_sysfs::gpu_handle::{
power_profile_mode::PowerProfileModesTable, PerformanceLevel,
};
use std::{cell::RefCell, rc::Rc, str::FromStr};
#[derive(Clone)]

View File

@ -1,10 +1,11 @@
use std::collections::HashMap;
use amdgpu_sysfs::gpu_handle::PowerLevelKind;
use gtk::{
glib::{self, subclass::types::ObjectSubclassIsExt, Object},
prelude::WidgetExt,
};
use lact_client::schema::{amdgpu_sysfs::gpu_handle::PowerLevelKind, DeviceStats, PowerStates};
use lact_client::schema::{DeviceStats, PowerStates};
glib::wrapper! {
pub struct PowerStatesFrame(ObjectSubclass<imp::PowerStatesFrame>)

View File

@ -1,10 +1,11 @@
use crate::app::root_stack::oc_adjustment::OcAdjustment;
use amdgpu_sysfs::gpu_handle::fan_control::FanInfo;
use gtk::{
glib::clone,
prelude::{AdjustmentExt, ButtonExt, GridExt, WidgetExt},
Align, Button, Grid, Label, MenuButton, Orientation, Popover, Scale, SpinButton,
};
use lact_client::schema::{amdgpu_sysfs::gpu_handle::fan_control::FanInfo, PmfwInfo, PmfwOptions};
use lact_client::schema::{PmfwInfo, PmfwOptions};
#[derive(Clone)]
pub struct PmfwFrame {

View File

@ -7,15 +7,12 @@ edition = "2021"
args = ["clap"]
[dependencies]
amdgpu-sysfs = { version = "0.14.0", features = [
"serde",
] }
serde = { version = "1.0", features = ["derive"] }
amdgpu-sysfs = { workspace = true }
serde = { workspace = true }
serde_with = { workspace = true }
indexmap = { version = "*", features = ["serde"] }
clap = { version = "4.4.18", features = ["derive"], optional = true }
serde_with = { version = "3.5.0", default-features = false, features = [
"macros",
] }
[dev-dependencies]
serde_json = "1.0"
serde_json = { workspace = true }

View File

@ -6,7 +6,6 @@ mod response;
#[cfg(test)]
mod tests;
pub use amdgpu_sysfs;
pub use request::Request;
pub use response::Response;

View File

@ -13,4 +13,4 @@ lact-daemon = { path = "../lact-daemon", default-features = false }
lact-schema = { path = "../lact-schema", features = ["args"] }
lact-cli = { path = "../lact-cli" }
lact-gui = { path = "../lact-gui", optional = true }
anyhow = "1.0.79"
anyhow = { workspace = true }