`packaging/windows/drivers/*` has run `deny(unsafe_op_in_unsafe_fn)` +
`deny(clippy::undocumented_unsafe_blocks)` for a while, with `forbid(unsafe_code)`
on the modules that need no unsafe at all. The main workspace had no lint config
whatsoever, so nothing stopped a clean crate from quietly growing an `unsafe`, and
nothing distinguished the handful of genuinely-unsafe lines inside a 600-line
`unsafe fn` from the safe ones surrounding them.
Three things, all mechanical:
* `#![forbid(unsafe_code)]` on the eight crates that already contain zero unsafe
(`pf-driver-proto`, `pf-host-config`, `pf-paths`, the three clean clients, both
tools). These were clean by accident, not by contract; now they are clean by
contract.
* `unsafe_op_in_unsafe_fn = "warn"` workspace-wide. `unsafe fn` states a contract
the CALLER must uphold — it was never meant to switch off checking for the whole
body. Measured fallout is 300 sites on Linux, and they are concentrated: six
files carry all of them, while `punktfunk-core`, `pf-frame`, `pf-clipboard` and
`pf-vdisplay` are already at zero. `warn` (not `deny`) so the build stays green
while those six are worked down; it flips to `deny` once they are. This is also
the Rust 2024 default, so it pays off the edition migration early.
* `proc::current_uid()` replaces eight `unsafe { libc::getuid() }` blocks. Each
site had copied out the same SAFETY note verbatim, which is the tell: `getuid()`
is parameterless, always succeeds and touches no memory, so there is no contract
for a caller to uphold and no reason for the unsafe to be visible eight times.
One `unsafe` behind a safe wrapper, none at the call sites.
Verified: `pf-vdisplay` builds clean on Linux (Nobara) at zero E0133; the
macOS-buildable crates build clean locally. No behaviour change.
51 lines
2.3 KiB
TOML
51 lines
2.3 KiB
TOML
[package]
|
|
name = "punktfunk-client-session"
|
|
description = "punktfunk/1 Vulkan session binary — SDL3 window, ash presenter, terminal stats; the power-user / gamescope stream client"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
authors.workspace = true
|
|
repository.workspace = true
|
|
|
|
[[bin]]
|
|
name = "punktfunk-session"
|
|
path = "src/main.rs"
|
|
|
|
[features]
|
|
default = ["ui", "pyrowave"]
|
|
# PyroWave client decode (the wired-LAN wavelet codec) — enables the decode backend + the
|
|
# planar present path. ON by default; each session still opts in explicitly (the Settings
|
|
# codec pick, or PUNKTFUNK_PREFER_PYROWAVE=1). The Windows ARM64 leg builds
|
|
# --no-default-features and so skips it (video decode is Linux-only anyway).
|
|
pyrowave = ["pf-client-core/pyrowave", "pf-presenter/pyrowave"]
|
|
# The Skia console UI (stats OSD, capture HUD, later the gamepad library). Dropping it
|
|
# (`--no-default-features`) is the ~15 MB-smaller power-user build: same streaming,
|
|
# stats on stdout only.
|
|
ui = ["dep:pf-console-ui", "dep:serde_json"]
|
|
|
|
# Same Linux+Windows gating as the rest of the client stack; elsewhere this is a stub
|
|
# binary.
|
|
[target.'cfg(any(target_os = "linux", windows))'.dependencies]
|
|
# `default-features = false` on both: THIS crate's `pyrowave` feature (above) is the single
|
|
# switch that turns the wavelet codec on, and it enables it explicitly on each. Inheriting their
|
|
# defaults instead would make `--no-default-features` a lie — the Windows ARM64 leg builds that
|
|
# way precisely to skip the vendored PyroWave C++, which has no ARM64 SIMD path.
|
|
pf-presenter = { path = "../../crates/pf-presenter", default-features = false }
|
|
pf-console-ui = { path = "../../crates/pf-console-ui", optional = true }
|
|
pf-client-core = { path = "../../crates/pf-client-core", default-features = false }
|
|
punktfunk-core = { path = "../../crates/punktfunk-core", features = ["quic"] }
|
|
# The fake-library dev hook (`PUNKTFUNK_FAKE_LIBRARY`, browse mode) parses GameEntry JSON.
|
|
serde_json = { version = "1", optional = true }
|
|
anyhow = "1"
|
|
tracing = "0.1"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
|
|
# Embeds the app icon as an exe resource (build.rs) — Windows hosts only (rc.exe from
|
|
# the SDK); same pattern as clients/windows.
|
|
[target.'cfg(windows)'.build-dependencies]
|
|
winresource = "0.1"
|
|
|
|
[lints]
|
|
workspace = true
|