From 6a9d259feccdec58e0b9c86207cbb621f47f991c Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Thu, 19 Feb 2026 21:38:40 +0100 Subject: [PATCH] gpui_linux: Fix headless build (#49652) Closes #ISSUE Before you mark this PR as ready for review, make sure that you have: - [ ] Added a solid test coverage and/or screenshots from doing manual testing - [ ] Done a self-review taking into account security and performance aspects - [ ] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - N/A --- crates/gpui/Cargo.toml | 1 - crates/gpui_linux/src/linux.rs | 2 +- crates/gpui_linux/src/linux/platform.rs | 6 +++--- crates/gpui_platform/Cargo.toml | 1 + nix/build.nix | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/gpui/Cargo.toml b/crates/gpui/Cargo.toml index 5a163c11ecccb76a0fe1cc4f3d08ed20f7dcafe0..ddb7373c2ed143b52775d187a52ee2d449ef25b2 100644 --- a/crates/gpui/Cargo.toml +++ b/crates/gpui/Cargo.toml @@ -28,7 +28,6 @@ test-support = [ ] inspector = ["gpui_macros/inspector"] leak-detection = ["backtrace"] -runtime_shaders = [] wayland = [ "bitflags", ] diff --git a/crates/gpui_linux/src/linux.rs b/crates/gpui_linux/src/linux.rs index 27fda08056fec9d38c4aadf6a8ec955b0e1066df..bafdc2e5241da1da45f74900555d65f59a4d1fc2 100644 --- a/crates/gpui_linux/src/linux.rs +++ b/crates/gpui_linux/src/linux.rs @@ -15,7 +15,7 @@ mod xdg_desktop_portal; pub use dispatcher::*; pub(crate) use headless::*; pub(crate) use keyboard::*; -pub use platform::*; +pub(crate) use platform::*; #[cfg(any(feature = "wayland", feature = "x11"))] pub(crate) use text_system::*; #[cfg(feature = "wayland")] diff --git a/crates/gpui_linux/src/linux/platform.rs b/crates/gpui_linux/src/linux/platform.rs index c3ee684ea290596685b43e6af7e7b14155766047..b3a08310ea419e55c91cd361a032e51163d1b2f3 100644 --- a/crates/gpui_linux/src/linux/platform.rs +++ b/crates/gpui_linux/src/linux/platform.rs @@ -98,11 +98,11 @@ pub(crate) trait LinuxClient { #[allow(unused)] fn display(&self, id: DisplayId) -> Option>; fn primary_display(&self) -> Option>; - #[cfg(feature = "screen-capture")] + fn is_screen_capture_supported(&self) -> bool { false } - #[cfg(feature = "screen-capture")] + fn screen_capture_sources( &self, ) -> oneshot::Receiver>>> { @@ -168,7 +168,7 @@ impl LinuxCommon { #[cfg(any(feature = "wayland", feature = "x11"))] let text_system = Arc::new(crate::linux::CosmicTextSystem::new()); #[cfg(not(any(feature = "wayland", feature = "x11")))] - let text_system = Arc::new(crate::NoopTextSystem::new()); + let text_system = Arc::new(gpui::NoopTextSystem::new()); let callbacks = PlatformHandlers::default(); diff --git a/crates/gpui_platform/Cargo.toml b/crates/gpui_platform/Cargo.toml index 5cf81c304283690f78871b830f6180c75ad6a34a..b29fc9477d1a5e06645f046aa9169f0fb9060af6 100644 --- a/crates/gpui_platform/Cargo.toml +++ b/crates/gpui_platform/Cargo.toml @@ -16,6 +16,7 @@ default = [] font-kit = ["gpui_macos/font-kit"] test-support = ["gpui/test-support"] screen-capture = ["gpui/screen-capture", "gpui_macos/screen-capture", "gpui_windows/screen-capture", "gpui_linux/screen-capture"] +runtime_shaders = ["gpui_macos/runtime_shaders"] wayland = ["gpui_linux/wayland"] x11 = ["gpui_linux/x11"] diff --git a/nix/build.nix b/nix/build.nix index 16b03e9a53bd2118c9b5bf45cf8fb7720ee5022b..28031337da6877cebda056e9cf2eab0f8f0d3ff7 100644 --- a/nix/build.nix +++ b/nix/build.nix @@ -172,7 +172,7 @@ let (darwinMinVersionHook "10.15") ]; - cargoExtraArgs = "-p zed -p cli --locked --features=gpui/runtime_shaders"; + cargoExtraArgs = "-p zed -p cli --locked --features=gpui_platform/runtime_shaders"; stdenv = pkgs: