Fix the Linux build broken by the gpui platform-crate extraction#19
Open
mark-ik wants to merge 2 commits into
Open
Fix the Linux build broken by the gpui platform-crate extraction#19mark-ik wants to merge 2 commits into
mark-ik wants to merge 2 commits into
Conversation
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.
There was a problem hiding this comment.
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
ashpddependency to0.13and enabled the portal/runtime features required bygpui_linux. - Reintroduced
LayerShellNotSupportedErroringpui’s layer-shell platform module to matchgpui_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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ashpdpin.gpui_linuxis written against the ashpd 0.13 API:ashpd::Uri—crates/gpui_linux/src/linux/platform.rs:368,:431,:633ashpd::desktop::file_chooser—platform.rs:342,:402ashpd::desktop::open_uri—platform.rs:662,:689ashpd::desktop::settings—crates/gpui_linux/src/linux/xdg_desktop_portal.rs:5…but the workspace pins ashpd 0.12.1 (
Cargo.toml:97), whereashpd::Uridoesn't exist and the portal modules are laid out differently — sogpui_linuxwon'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:37importsgpui::layer_shell::LayerShellNotSupportedError(used at:142), but the type isn't defined incrates/gpui/src/platform/layer_shell.rsanymore. 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):(0.13 renamed the runtime feature
async-std→async-ioand gates each portal behind its own feature, hence the extra three.)crates/gpui/src/platform/layer_shell.rs(re-add the type):With both,
gpui_linuxbuilds withwayland,x11and 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 compilinggpui_linuxon Linux.Is this the right approach, or did you intend
gpui_linuxto stay on ashpd 0.12 (in which case the call sites are what's off)? What do y'all think?Release Notes:
LayerShellNotSupportedError)