fix(setup): unbreak desktop-client pre-flight on Debian/Ubuntu - #491
Merged
Conversation
The WebKitGTK/JavaScriptCore/libxdo gate required pkg-config files that Debian/Ubuntu does not provide: libxdo-dev ships no libxdo.pc at all (the build links plain -lxdo; libxdo-sys's build script never consults pkg-config), so setup aborted on machines where every required package was installed and cargo would have succeeded. - detect libxdo via pkg-config, falling back to asking cc whether -lxdo resolves — exactly what the build needs - report JavaScriptCore and libxdo failures separately, each with its own per-distro install line, instead of one lumped error - install libjavascriptcoregtk-4.1-dev explicitly on apt rather than relying on it arriving transitively via libwebkit2gtk-4.1-dev - Fedora: install the renamed dev package libxdo-devel, falling back to xdotool-devel on releases that predate the split
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.
Problem
On Ubuntu,
./scripts/setup.shaborted before building anything with:— even when every required package was correctly installed.
Root cause
The pre-flight gate required
pkg-config --exists javascriptcoregtk-4.1andpkg-config --exists libxdo. On Debian/Ubuntu neither assumption holds:libxdo-devships nolibxdo.pcat all (just/usr/include/xdo.h+libxdo.so; verified against the noble file list). And the build never consults pkg-config for xdo anyway:libxdo-sys(via dioxus → muda) ships a one-line build script,println!("cargo:rustc-link-lib=xdo")— plain-lxdo, resolved by the linker.javascriptcoregtk-4.1.pclives in the separatelibjavascriptcoregtk-4.1-devpackage, only pulled in transitively today as a Depends oflibwebkit2gtk-4.1-dev.xdotool-devel— the dev files are nowlibxdo-devel, so the old one-shotdnf install … xdotool-develfailed silently (|| true) and took the whole install down with it.Changes
have_libxdo(): try pkg-config first (Arch/Fedora/Alpine ship a pc file), then fall back to askingccwhether-lxdoresolves — precisely what the build requires.libjavascriptcoregtk-4.1-devexplicitly instead of hoping for the transitive Depends.libxdo-devel, falling back toxdotool-develon releases that predate the rename.Testing
Ran the real script end-to-end against stubbed system commands in four scenarios:
bash -nclean.