From 5f097d530d2bf43d28934b85101bb2176270bb60 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Tue, 11 Aug 2026 23:39:52 +0200 Subject: [PATCH] chore(safety): exempt the two bindings-only sys crates from the hoisted deny MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Linux fallout from the hoist the mac could not see: bindgen emits unsafe blocks (layout tests/accessors) into OUT_DIR, where nobody hand-writes SAFETY proofs — pyrowave-sys failed clippy on .25 with 17 of them, and libvpl-sys would do the same on the Windows leg. Both crates are bindings-only by charter (the safe wrapper lives with the consumer), so the allow is crate-wide with the rationale at the crate root; the hand-written link-sanity tests keep their proofs by convention. --- .gitea/workflows/ci.yml | 4 ++-- crates/libvpl-sys/src/lib.rs | 5 +++++ crates/pyrowave-sys/src/lib.rs | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 8e281324..6a824cc6 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -146,8 +146,8 @@ jobs: # `nvenc` gates enc/linux/nvenc_cuda.rs (+ nvenc_core/nvenc_status) and `vulkan-encode` gates # enc/linux/vulkan_video.rs (+ the vendored vk_av1_encode/vk_valve_rgb bindings) — ~8,150 # lines carrying ~70 `unsafe` blocks. Their ONLY prior CI coverage was deb.yml's - # `cargo build`, where warnings are not errors, so pf-encode's own - # `#![deny(clippy::undocumented_unsafe_blocks)]` — the crate's stated unsafe-proof gate — + # `cargo build`, where warnings are not errors, so the `undocumented_unsafe_blocks` deny + # (now hoisted into [workspace.lints]) — pf-encode's stated unsafe-proof gate — # was never actually enforced on them. (`pyrowave` needs no extra step: punktfunk-host has # `default = ["pyrowave"]`, so the steps above already cover it.) # diff --git a/crates/libvpl-sys/src/lib.rs b/crates/libvpl-sys/src/lib.rs index 3b460301..db12ddca 100644 --- a/crates/libvpl-sys/src/lib.rs +++ b/crates/libvpl-sys/src/lib.rs @@ -10,6 +10,11 @@ #![allow(non_snake_case)] // Bindgen output for a C API: u128 layout warnings and the like are upstream's concern. #![allow(improper_ctypes)] +// The workspace-wide undocumented_unsafe_blocks deny cannot apply to GENERATED code: bindgen +// emits `unsafe {}` in layout tests/accessors and nobody hand-writes proofs into OUT_DIR. This +// crate is bindings-only by charter (the safe wrapper lives with the consumer), so the allow is +// crate-wide; the hand-written link-sanity test below still carries its proof by convention. +#![allow(clippy::undocumented_unsafe_blocks)] // Generated code — clippy findings in it (missing safety docs on generated unsafe fns, style // nits across 14k lines) are bindgen's shape, not ours; the safe wrapper in pf-encode is the // linted surface. diff --git a/crates/pyrowave-sys/src/lib.rs b/crates/pyrowave-sys/src/lib.rs index df5f68b3..bf79abfc 100644 --- a/crates/pyrowave-sys/src/lib.rs +++ b/crates/pyrowave-sys/src/lib.rs @@ -9,6 +9,11 @@ #![allow(non_snake_case)] // Bindgen output for a C API: u128 layout warnings and the like are upstream's concern. #![allow(improper_ctypes)] +// The workspace-wide undocumented_unsafe_blocks deny cannot apply to GENERATED code: bindgen +// emits `unsafe {}` in layout tests/accessors and nobody hand-writes proofs into OUT_DIR. This +// crate is bindings-only by charter (the safe wrapper lives with the consumer), so the allow is +// crate-wide; the hand-written link-sanity test below still carries its proof by convention. +#![allow(clippy::undocumented_unsafe_blocks)] #[cfg(any(target_os = "linux", target_os = "windows"))] include!(concat!(env!("OUT_DIR"), "/bindings.rs"));