Skip to content

fix(desktop): stop bundling glib in the Linux libmpv slice - #2359

Open
chrisdebian wants to merge 1 commit into
maxrave-dev:devfrom
chrisdebian:fix/linux-desktop-bundled-glib
Open

fix(desktop): stop bundling glib in the Linux libmpv slice#2359
chrisdebian wants to merge 1 commit into
maxrave-dev:devfrom
chrisdebian:fix/linux-desktop-bundled-glib

Conversation

@chrisdebian

Copy link
Copy Markdown

What

scripts/mpv-linux/stage.sh bundles libglib-2.0.so.0 (2.72, from the Ubuntu 22.04 stage container) into the Linux libmpv slice because it wasn't in SYSTEM_LIBS. On a newer glib host (e.g. Ubuntu 24.04, glib 2.80), the bundled glib claims the soname before AWT's XDesktopPeer.init() can dlopen the system libgio-2.0.so.0, which then fails with an undefined symbol and disables java.awt.Desktop for the rest of the process — breaking all 23 external-link call sites via LocalUriHandler.

This is the root cause already documented in CLAUDE.md's 2026-07-31 entry ("Bundled glib disabled java.awt.Desktop on Linux"), which also names the cure directly: "The actual cure is to stop bundling glib — add it to SYSTEM_LIBS, which needs the Linux tarball rebuilt, republished and re-pinned in mpvNativesChecksums." This PR is that first half.

Adding libglib-2.0.so.0 to SYSTEM_LIBS excludes it from the bundle, so the loader falls through to the host's own glib — same mechanism as every other libc-family exclusion already in that list.

What this does NOT do

  • Doesn't touch the Desktop.isDesktopSupported() workaround in DesktopApp.kt — still needed for anyone on the currently-published tarball, and removing it here would break them.
  • Doesn't rebuild/republish the actual tarball or re-pin mpvNativesChecksums — per CLAUDE.md, that only happens through mpvBundleAll, which I don't have access to.

Verification

I don't have the mpvBundleAll pipeline available, so this hasn't been tested against a real staged build. bash -n and shellcheck both clean on the modified script — no new warnings introduced. Happy to help however's useful once it's staged on your end (e.g. confirming the fix against a built artifact, if you can share one).

AI disclosure

This PR was drafted with Claude Code's help — it traced the fix against your own CLAUDE.md root-cause entry, and I reviewed and confirmed the change before opening this.

libglib-2.0.so.0 (2.72, built on the Ubuntu 22.04 stage container) was
missing from SYSTEM_LIBS, so it shipped in the bundle and claimed the
glib soname the moment JNA loaded libmpv. On a newer glib host (e.g.
Ubuntu 24.04, glib 2.80) AWT's XDesktopPeer.init() could then no
longer dlopen the system libgio-2.0.so.0, dying with an undefined
symbol and disabling java.awt.Desktop for the rest of the process --
the root cause already documented in CLAUDE.md's 2026-07-31 entry.

Adding it to SYSTEM_LIBS excludes it from the bundle so the loader
falls through to the host's own glib, matching every other libc-family
exclusion already in this list.

Does not touch the DesktopApp.kt isDesktopSupported() workaround --
still needed for anyone on the currently-published tarball.

Note: this only changes the staging script. Taking effect requires
rebuilding the Linux tarball, republishing it to
maxrave-dev/simpmusic-files, and re-pinning mpvNativesChecksums --
steps only doable through the existing mpvBundleAll pipeline. I don't
have that pipeline available to verify end-to-end; this matches the
root cause and fix already documented in CLAUDE.md, but hasn't been
tested against a real staged build.
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