IOReport meters: the two clippy warnings each macOS reader carried #244

Merged
dcharlot merged 1 commit from fix/ioreport-meter-lints into main 2026-10-14 09:09:23 -04:00
Owner

What was wrong

Three crates carry the same IOReport energy reader: proof-cascade, eoc-meter and jouleclaw-energy. Clippy warned twice in each of them. The code only builds on macOS, so a Linux run never sees these warnings.

  • duplicated_attributes fires on the empty extern block that links IOReport, IOKit and CoreFoundation. Two of those links use kind = "framework", and the lint reads the repeated key as a duplicate. They are three distinct libraries, so the lint is allowed with that reason, as jcp-energy has done since June.
  • manual_c_str_literals: b"IOReportChannels\0" becomes c"IOReportChannels", the form these files already use for their other keys. The pointer passed to CFStringCreateWithCString is unchanged.

Checked

A macOS sweep of every workspace (cargo clippy --all-targets --keep-going, on main with #241 merged in) found no deny-level error in any workspace. The 6 warnings here were the only instances of either lint.

On the build host, after the change:

  • clippy no longer reports either lint for the three crates;
  • the meter tests pass with live IOReport readings: proof-cascade 111, eoc-meter 86, jouleclaw-energy (--features ioreport) 129.

No file overlaps #241.

🤖 Generated with Claude Code

## What was wrong Three crates carry the same IOReport energy reader: proof-cascade, eoc-meter and jouleclaw-energy. Clippy warned twice in each of them. The code only builds on macOS, so a Linux run never sees these warnings. - **`duplicated_attributes`** fires on the empty `extern` block that links IOReport, IOKit and CoreFoundation. Two of those links use `kind = "framework"`, and the lint reads the repeated key as a duplicate. They are three distinct libraries, so the lint is allowed with that reason, as jcp-energy has done since June. - **`manual_c_str_literals`**: `b"IOReportChannels\0"` becomes `c"IOReportChannels"`, the form these files already use for their other keys. The pointer passed to `CFStringCreateWithCString` is unchanged. ## Checked A macOS sweep of every workspace (`cargo clippy --all-targets --keep-going`, on main with #241 merged in) found no deny-level error in any workspace. The 6 warnings here were the only instances of either lint. On the build host, after the change: - clippy no longer reports either lint for the three crates; - the meter tests pass with live IOReport readings: proof-cascade 111, eoc-meter 86, jouleclaw-energy (`--features ioreport`) 129. No file overlaps #241. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
IOReport meters: the two clippy warnings each macOS reader carried
All checks were successful
energy meters on real hardware / RAPL and NVML on jetson-hub (pull_request) Successful in 42s
wai-quantum WebGPU member / member · discrete GPU, Vulkan (jetson-hub) (pull_request) Successful in 10m41s
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 2m57s
standards workspaces build + test / aac-rs (pull_request) Successful in 3m0s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 1m29s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 58s
standards workspaces build + test / map-rs (pull_request) Successful in 1m1s
standards workspaces build + test / mesh-rs (pull_request) Successful in 57s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 1m2s
standards workspaces build + test / openpay (pull_request) Successful in 3m33s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 5m0s
wai-quantum WebGPU member / member · browser WebGPU (macos) (pull_request) Successful in 1m41s
jouleclaw public surface must stay documented / Public-surface audit (jouleclaw-rs) (pull_request) Successful in 1m2s
spec citations resolve / Code cites no section its SPEC lacks (pull_request) Successful in 6s
lockfiles / every Cargo.lock is current (pull_request) Successful in 36s
standards workspaces build + test / arl-rs (pull_request) Successful in 1m9s
standards workspaces build + test / eoc-rs (pull_request) Successful in 2m5s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m47s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 1m11s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 1m10s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m28s
standards workspaces build + test / sense-rs (pull_request) Successful in 1m11s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m23s
tests in CI / every test file is run by a job or listed with its reason (pull_request) Successful in 5s
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness · MSRV (pull_request) Successful in 3m16s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 3m59s
wai-quantum WebGPU member / member · software Vulkan (linux) (pull_request) Successful in 2m22s
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Successful in 1h26m5s
c597406838
proof-cascade, eoc-meter and jouleclaw-energy share an IOReport reader, and
clippy warned twice in each, only on macOS (the code is gated there):

- duplicated_attributes on the empty extern block that links IOReport,
  IOKit and CoreFoundation. The lint reads the repeated `kind` key across
  separate `#[link]`s as a duplicate. The links are three distinct libraries,
  so it is allowed with that reason, as jcp-energy already does.
- manual_c_str_literals: `b"IOReportChannels\0"` is now `c"IOReportChannels"`,
  as the other keys in these files already are.

A macOS sweep of every workspace (`cargo clippy --all-targets --keep-going`)
found no deny-level error anywhere; these six were the only instances of
either lint. Meter tests pass on the build host: proof-cascade 111,
eoc-meter 86, jouleclaw-energy (ioreport) 129.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Transaction-Science/open-standards!244
No description provided.