From 756bdc356c277f4c7ef0f372684dcaef138bcbec Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Mon, 23 Nov 2026 03:15:12 -0600 Subject: [PATCH] feat(id-native-shell): target-gate the Bevy x11/wayland features to Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The base Bevy dependency enabled the x11 and wayland features unconditionally, so they resolved active for every target — including the macOS target #12817 adds next. Move both features into the existing cfg(target_os = "linux") dependency table (features are additive across target tables, so the Linux resolution is unchanged: bevy and bevy_winit still resolve with wayland,x11 and the Linux system-library wiring in nix-common.nix still applies). For aarch64-apple-darwin, bevy/bevy_winit now resolve with no wayland/x11 features at all. Refs #12817 (slice 1 of Lane LS's breakdown on that issue). --- pkgs/id/crates/id-native-shell/Cargo.toml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/id/crates/id-native-shell/Cargo.toml b/pkgs/id/crates/id-native-shell/Cargo.toml index 8226618910..2afc633876 100644 --- a/pkgs/id/crates/id-native-shell/Cargo.toml +++ b/pkgs/id/crates/id-native-shell/Cargo.toml @@ -26,8 +26,6 @@ bevy = { version = "0.19", default-features = false, features = [ "bevy_window", "bevy_winit", "default_font", - "x11", - "wayland", ] } id = { path = "../..", default-features = false, features = ["world"] } iroh = "1" @@ -35,6 +33,15 @@ serde_json = "1" tokio = { version = "1", features = ["full"] } [target.'cfg(target_os = "linux")'.dependencies] +# The X11/Wayland windowing backends are Linux-only: gate them to this +# target table (features are additive across target tables, so Linux +# resolves the same Bevy feature set as before) so the crate's +# dependency graph for other targets — macOS next (#12817) — carries +# no wayland-sys/x11 crates at all. +bevy = { version = "0.19", default-features = false, features = [ + "x11", + "wayland", +] } # Linux `openat2(2)` with RESOLVE_BENEATH for the file-read open (#11420). libc = "0.2"