From d5838f381aae22e3a76c8e9409d4a08e6988d9d5 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Sun, 16 Aug 2026 10:50:06 +0200 Subject: [PATCH] fix(client-core): a pipewire type in a `cfg(any(linux, test))` signature broke the Windows client leg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Main has been red on both Windows client jobs since the pad-audio work landed: error[E0433]: cannot find module or crate `pipewire` --> crates\pf-client-core\src\pad_audio.rs:368:39 error: could not compile `pf-client-core` (lib test) due to 1 previous error `pad_audio.rs` gates its pure-logic helpers `cfg(any(target_os = "linux", test))` so the sink-picking decisions stay unit-testable on every platform. `sink_from_props` was given the same gate, but it is not pure logic: it takes a `&pipewire::spa::utils::dict::DictRef`, and `pipewire` is declared under `[target.'cfg(target_os = "linux")'.dependencies]`. So on Windows the `test` arm pulls the item into the `lib test` target, where the crate does not exist. Nothing but `--all-targets` compiles that target, which is why no Linux gate could see it — including the container gate used to validate the original change, which lints pf-client-core for the host target only. The function's sole caller already lives inside a plain `cfg(target_os = "linux")` block and no test refers to it, so the `test` arm was only ever dead weight. Dropped it. Swept the rest of the crate for the same shape: of the 13 `cfg(any(target_os = "linux", test))` items in pad_audio.rs, this is the only one that names a Linux-only crate, and no other file in pf-client-core uses that gate. All 13 other pipewire references sit under a plain `cfg(target_os = "linux")`. Linux codegen is unchanged: `target_os = "linux"` was already true on that arm, so the item compiles exactly as before there. --- crates/pf-client-core/src/pad_audio.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/pf-client-core/src/pad_audio.rs b/crates/pf-client-core/src/pad_audio.rs index 5ad32638d..bb1757979 100644 --- a/crates/pf-client-core/src/pad_audio.rs +++ b/crates/pf-client-core/src/pad_audio.rs @@ -364,7 +364,12 @@ pub(crate) fn pick_pad_sink(sinks: &[SinkNode], cards: &[CardDevice]) -> Option< /// Read a sink node's facts out of a proplist. Split out because it has to run against the /// node's INFO props, not the registry's — see [`walk_graph`]. -#[cfg(any(target_os = "linux", test))] +/// +/// Linux-only, unlike its pure-logic neighbours: `DictRef` comes from `pipewire`, which is a +/// `cfg(target_os = "linux")` dependency. Widening this to `any(…, test)` the way the testable +/// helpers around it do puts the item into the Windows `lib test` target, where the crate does +/// not exist — E0433, visible only under `--all-targets`, and so only on the Windows CI leg. +#[cfg(target_os = "linux")] pub(crate) fn sink_from_props(props: &pipewire::spa::utils::dict::DictRef) -> Option { // Both spellings: PipeWire's own objects use the `device.`-prefixed keys, the pulse-facing // proplist GE reads uses the bare ones. Cheap to accept both. -- 2.54.0