`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.
28 lines
1.1 KiB
TOML
28 lines
1.1 KiB
TOML
[package]
|
|
name = "punktfunk-probe"
|
|
description = "punktfunk reference/probe client: headless punktfunk/1 client for testing + latency measurement"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
authors.workspace = true
|
|
repository.workspace = true
|
|
|
|
[dependencies]
|
|
punktfunk-core = { path = "../../crates/punktfunk-core", features = ["quic"] }
|
|
quinn = "0.11"
|
|
tokio = { version = "1", features = ["rt-multi-thread", "net", "time", "macros"] }
|
|
anyhow = "1"
|
|
tracing = "0.1"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
# LAN host discovery (`--discover`): browse the native `_punktfunk._udp` mDNS service the host
|
|
# advertises (same crate/version the host advertises with).
|
|
mdns-sd = "0.20"
|
|
# Opus: multistream DECODE of the host's audio plane (the surround validator) + `--mic-test`'s
|
|
# encoder. libopus is already in the graph via `punktfunk-core`'s quic feature; this exposes the
|
|
# name directly. Cross-platform (cmake-vendored), so the probe builds + validates everywhere.
|
|
opus = "0.3"
|
|
|
|
[lints]
|
|
workspace = true
|