From a1918edeabaac47e149ac55e5d1a0e2580b981e9 Mon Sep 17 00:00:00 2001 From: paravozz Date: Fri, 24 Apr 2026 22:48:54 +0100 Subject: [PATCH] ci: register cargo-clippy cfg to silence objc 0.2.7 macro warnings The `objc` 0.2.7 crate emits `#[cfg(feature = "cargo-clippy")]` inside the body of its `msg_send!` / `class!` / `sel_impl!` macros. Because macros expand at the call site, the cfg lands in baseview's own compilation unit (and any consumer's), where `cargo`'s default `--cap-lints=allow` for registry dependencies does not apply. CI's `RUSTFLAGS=-D warnings` then promotes the resulting `unexpected_cfgs` lint to a hard error, breaking macOS builds with 100+ identical errors per `msg_send!` site. Register the cfg as expected via `cargo:rustc-check-cfg` from a new `build.rs` so rustc no longer flags it during baseview's lint pass. Verified locally: with the build script in place, `RUSTFLAGS=-D warnings cargo build --workspace --all-targets --all-features` (and the equivalent test / doc invocations) all exit 0 on macOS; without it, the same commands fail with the upstream errors. Refs #229. --- build.rs | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 build.rs diff --git a/build.rs b/build.rs new file mode 100644 index 00000000..7d0ac555 --- /dev/null +++ b/build.rs @@ -0,0 +1,3 @@ +fn main() { + println!("cargo:rustc-check-cfg=cfg(feature, values(\"cargo-clippy\"))"); +}