From 5fddaac6af3b7e7a00db48fe010716b5b293a8a8 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Sun, 14 Jun 2026 23:30:24 +0000 Subject: [PATCH] fix(host): compile punktfunk-host on windows (x86_64-pc-windows-msvc) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gate the Linux-only bits so the host crate builds on MSVC (it already built on Linux + macOS): drm_sync/dmabuf_fence use DRM ioctls + libc (a linux-only target dep) and have no non-Linux callers; VirtualOutput.remote_fd is a PipeWire concept. The full dep tree (aws-lc-rs, quinn, rusty_enet, axum) builds clean on MSVC and the binary runs (openapi emits the spec) — only these 3 cfg-gates were needed. First step of the Windows host port (docs/windows-host.md). Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/punktfunk-host/src/main.rs | 2 ++ crates/punktfunk-host/src/vdisplay.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/crates/punktfunk-host/src/main.rs b/crates/punktfunk-host/src/main.rs index 66685f7..fd742c1 100644 --- a/crates/punktfunk-host/src/main.rs +++ b/crates/punktfunk-host/src/main.rs @@ -16,7 +16,9 @@ mod audio; mod capture; mod discovery; +#[cfg(target_os = "linux")] mod dmabuf_fence; +#[cfg(target_os = "linux")] mod drm_sync; mod encode; mod gamestream; diff --git a/crates/punktfunk-host/src/vdisplay.rs b/crates/punktfunk-host/src/vdisplay.rs index d512c48..933aaa0 100644 --- a/crates/punktfunk-host/src/vdisplay.rs +++ b/crates/punktfunk-host/src/vdisplay.rs @@ -15,6 +15,7 @@ use anyhow::Result; pub use punktfunk_core::Mode; +#[cfg(target_os = "linux")] use std::os::fd::OwnedFd; /// A created virtual output: a PipeWire source to capture, plus an owned keepalive whose drop @@ -28,6 +29,7 @@ pub struct VirtualOutput { /// Portal/remote PipeWire fd when the node lives on a sandboxed remote (e.g. Mutter's /// RemoteDesktop+ScreenCast). `None` means the node is on the user's default PipeWire daemon /// (KWin `zkde_screencast`), captured by connecting to that daemon directly. + #[cfg(target_os = "linux")] pub remote_fd: Option, /// `(width, height, refresh_hz)` to prefer in the PipeWire format negotiation. KWin and /// gamescope outputs are created at the exact size, so this just confirms it; **Mutter sizes