feat: Add native Linux hardware sensor polling via sysfs hwmon - #23
Merged
Conversation
manupawickramasinghe
pushed a commit
that referenced
this pull request
Jul 30, 2026
Resolves the conflict with PR #23, which added a Linux sysfs/hwmon backend in the same two places this branch touched. Both changes had the identical shape — add a platform arm, narrow the fallback — so the resolution keeps both arms and widens each fallback to exclude all three platforms: source/mod.rs default_source() sysinfo.rs query() -> #[cfg(not(any(windows, target_os = "macos", target_os = "linux")))] Getting this wrong is silent: these are sequential exclusive cfg blocks, not else-if, so a platform named in an arm *and* left in the fallback compiles both and the last one wins. CI was failing on all three legs: - Windows and Linux failed at Clippy. sysinfo::query_for_test is a #[cfg(test)] helper consumed only by the macOS system-profile test, so on other platforms it tripped dead_code under -D warnings. Marked allow(dead_code) with the reason. - macOS failed at Run tests (exit 101). CI runs macOS virtualized, where the IOHID sensor plane, IOReport, an integrated GPU, an NVMe controller and the system fonts may all be absent. Several new tests still asserted that hardware into existence, including two that indexed services[0] and would panic on an empty list. Every environment-dependent assertion now reports "SKIP: ... not available" instead. Only *presence* is ever skipped — the range, uniqueness, stability and unit assertions still run wherever the hardware is real, which is where the coverage actually comes from. Verified by cross-checking the other two targets locally rather than guessing: cargo clippy --all-targets -D warnings is clean for x86_64-unknown-linux-gnu, x86_64-pc-windows-msvc and the macOS host, and cargo check --no-default-features passes for Linux too. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR implements native Linux hardware sensor polling using the Linux kernel
/sys/class/hwmonsysfs interface,/proc/stat,/proc/meminfo, and CPU frequency scaling interfaces.Features Added
k10temp,coretemp,amdgpu,nouveau,nvme,spd5118,nct6775, etc.) toHardwareType.SENSORVIEW_HEADLESSenvironment variable for server monitoring.