Skip to content

fix(setup): unbreak desktop-client pre-flight on Debian/Ubuntu - #491

Merged
rexlunae merged 1 commit into
mainfrom
fix/setup-libxdo-detection
Aug 25, 2026
Merged

fix(setup): unbreak desktop-client pre-flight on Debian/Ubuntu#491
rexlunae merged 1 commit into
mainfrom
fix/setup-libxdo-detection

Conversation

@rexlunae

@rexlunae rexlunae commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Problem

On Ubuntu, ./scripts/setup.sh aborted before building anything with:

[  OK]  webkit2gtk-4.1 development package detected
[FAIL]  WebKitGTK/JavaScriptCore 4.1 and libxdo dev packages not found

— even when every required package was correctly installed.

Root cause

The pre-flight gate required pkg-config --exists javascriptcoregtk-4.1 and pkg-config --exists libxdo. On Debian/Ubuntu neither assumption holds:

  1. Debian/Ubuntu's libxdo-dev ships no libxdo.pc at 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.
  2. javascriptcoregtk-4.1.pc lives in the separate libjavascriptcoregtk-4.1-dev package, only pulled in transitively today as a Depends of libwebkit2gtk-4.1-dev.
  3. Latent Fedora bug: current releases split xdotool and ship no xdotool-devel — the dev files are now libxdo-devel, so the old one-shot dnf install … xdotool-devel failed silently (|| true) and took the whole install down with it.

Changes

  • New have_libxdo(): try pkg-config first (Arch/Fedora/Alpine ship a pc file), then fall back to asking cc whether -lxdo resolves — precisely what the build requires.
  • Split the combined gate into two probes; failures now name the missing piece (JavaScriptCore 4.1 vs libxdo), each with its own per-distro install line.
  • apt line installs libjavascriptcoregtk-4.1-dev explicitly instead of hoping for the transitive Depends.
  • Fedora installs libxdo-devel, falling back to xdotool-devel on releases that predate the rename.

Testing

Ran the real script end-to-end against stubbed system commands in four scenarios:

Scenario Result
Ubuntu reality: jsc .pc present, no libxdo.pc, linker can link ✅ gate passes, proceeds to build all four clients
libxdo genuinely absent ✅ precise per-package error, exit 1
JavaScriptCore dev missing ✅ precise per-package error, exit 1
Arch/Fedora style: both .pc files present ✅ unchanged behavior via pkg-config

bash -n clean.


Open in Devin Review

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

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@rexlunae
rexlunae merged commit 75af623 into main Aug 25, 2026
17 checks passed
@rexlunae
rexlunae deleted the fix/setup-libxdo-detection branch August 25, 2026 02:06
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.

1 participant