Skip to content

Fix the Linux build broken by the gpui platform-crate extraction#19

Open
mark-ik wants to merge 2 commits into
Glass-HQ:mainfrom
mark-ik:fix-linux-build
Open

Fix the Linux build broken by the gpui platform-crate extraction#19
mark-ik wants to merge 2 commits into
Glass-HQ:mainfrom
mark-ik:fix-linux-build

Conversation

@mark-ik

@mark-ik mark-ik commented May 20, 2026

Copy link
Copy Markdown

Hi! I'm a hobbyist developer schmucking around with Rust GUIs for fun. I have a little library that embeds Servo in gpui (wgpu-graft), and I was testing it on Fedora 44 Workstation when I hit a Linux build break in gpui_linux. Tracked it down to two things the platform-crate extraction seems to have left behind:

1. Stale ashpd pin. gpui_linux is written against the ashpd 0.13 API:

  • ashpd::Uricrates/gpui_linux/src/linux/platform.rs:368, :431, :633
  • ashpd::desktop::file_chooserplatform.rs:342, :402
  • ashpd::desktop::open_uriplatform.rs:662, :689
  • ashpd::desktop::settingscrates/gpui_linux/src/linux/xdg_desktop_portal.rs:5

…but the workspace pins ashpd 0.12.1 (Cargo.toml:97), where ashpd::Uri doesn't exist and the portal modules are laid out differently — so gpui_linux won't compile. Looks like the pin just didn't get bumped when the code moved to the 0.13 API?

2. Missing LayerShellNotSupportedError. crates/gpui_linux/src/linux/wayland/window.rs:37 imports gpui::layer_shell::LayerShellNotSupportedError (used at :142), but the type isn't defined in crates/gpui/src/platform/layer_shell.rs anymore. It was in the pre-extraction monolith and looks like it didn't make the move.

Here's what I did to fix it:

Cargo.toml (workspace):

-ashpd = { version = "0.12.1", default-features = false, features = ["async-std"] }
+ashpd = { version = "0.13", default-features = false, features = ["async-io", "file_chooser", "open_uri", "settings"] }

(0.13 renamed the runtime feature async-stdasync-io and gates each portal behind its own feature, hence the extra three.)

crates/gpui/src/platform/layer_shell.rs (re-add the type):

/// An error indicating that an action failed because the compositor doesn't
/// support the required `zwlr_layer_shell_v1` protocol.
#[derive(Debug, thiserror::Error)]
#[error("Compositor doesn't support zwlr_layer_shell_v1")]
pub struct LayerShellNotSupportedError;

With both, gpui_linux builds with wayland,x11 and I get a real window rendering Servo on Fedora 44 (Mesa RADV, Vulkan). No new unit test since it's a build-breakage fix — the repro is just compiling gpui_linux on Linux.

Is this the right approach, or did you intend gpui_linux to stay on ashpd 0.12 (in which case the call sites are what's off)? What do y'all think?

Release Notes:

  • Fixed the Linux build broken by the platform-crate extraction (ashpd 0.13 API + missing LayerShellNotSupportedError)

mark-ik added 2 commits May 20, 2026 03:35
gpui_linux uses the ashpd 0.13 API (ashpd::Uri in
crates/gpui_linux/src/linux/platform.rs, the desktop::{file_chooser,
open_uri, settings} portals), but the workspace still pinned ashpd 0.12.1
where those don't resolve, so gpui_linux failed to build on Linux. 0.13 also
renamed the runtime feature async-std -> async-io and gates each portal
behind its own feature, so file_chooser/open_uri/settings are enabled
explicitly.
gpui_linux's wayland window code imports
gpui::layer_shell::LayerShellNotSupportedError
(crates/gpui_linux/src/linux/wayland/window.rs), but the type was not carried
into the extracted gpui::layer_shell module, breaking the wayland build. It
existed in the pre-extraction monolith; re-add the unit error struct.
@mark-ik mark-ik requested a review from naaiyy as a code owner May 20, 2026 07:36
Copilot AI review requested due to automatic review settings May 20, 2026 07:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a Linux build break introduced during the platform-crate extraction by aligning the workspace ashpd dependency with the API used by gpui_linux and restoring a missing layer-shell error type in gpui.

Changes:

  • Bumped workspace ashpd dependency to 0.13 and enabled the portal/runtime features required by gpui_linux.
  • Reintroduced LayerShellNotSupportedError in gpui’s layer-shell platform module to match gpui_linux’s Wayland layer-shell error handling.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Cargo.toml Updates the workspace ashpd version/features to match the API used by gpui_linux on Linux.
crates/gpui/src/platform/layer_shell.rs Restores LayerShellNotSupportedError so Wayland layer-shell window creation can fail with a typed error again.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants