ReviewOS

also looking at this

pantry-pm/pantry

feat(webkitgtk): add the GTK3 WebKit provider craft's Linux binary needs

#272
Merged glennmichael123 wants to merge feat/266-webkitgtk-provider into main
7 files +425 -4
6 hours ago

Refs #266.

craft-native.org's Linux artifact has never published. Its binary links seven libraries the recipe never provided, so ELF normalization correctly refused it. Two of those sonames belonged to a WebKit API with no owner in the catalog at all, which is why the issue says a dependency declaration alone cannot complete this repair — the provider had to be written first.

Why this specific API

Source/cmake/OptionsGTK.cmake in webkitgtk-2.54.2:

WEBKIT_OPTION_DEFINE(USE_GTK4 "... instead of GTK3." PUBLIC ON)
...
if (USE_GTK4)
    set(WEBKITGTK_API_INFIX "")      set(WEBKITGTK_API_VERSION "6.0")
else ()
    set(WEBKITGTK_API_INFIX "2")     set(WEBKITGTK_API_VERSION "4.1")

Upstream's default is GTK4 / webkitgtk-6.0. Only -DUSE_GTK4=OFF gives infix "2" and therefore libwebkit2gtk-4.1.so.0 and libjavascriptcoregtk-4.1.so.0 — craft's two unresolved WebKit libraries. wpewebkit.org is already in the catalog and is a different API; it provides neither, which is what the issue means by not substituting WPE/GTK4.

2.54 also calls find_package(Soup3 3.0.0 REQUIRED) unconditionally, so 4.1 is GTK3 + libsoup3 by construction and there is no libsoup2 variant left to pick. Our libsoup.org is 3.6.6.

The closure actually exists

Every one of the 29 declared runtime providers was checked against the registry for a published linux-x86-64 artifact before being named — a dependency on a provider that does not exist fails at install time rather than at publish time. 31/31 checked domains have one, including gtk.org/gtk3 3.24.38, gnome.org/glib 2.88.0, libsoup.org 3.6.6 and unicode.org 78.3.0.

runtimeResources carries libexec/webkit2gtk-4.1 and lib/webkit2gtk-4.1/injected-bundle. libwebkit2gtk does not render in-process — it execs WebKitWebProcess/WebKitNetworkProcess from PKGLIBEXECDIR and dlopens the injected bundle (Source/WebKit/PlatformGTK.cmake installs it under ${LIB_INSTALL_DIR}/webkit2gtk-4.1/injected-bundle). A consumer that bundles only the .so gets a library that loads and then fails the moment a page is created.

What this build does NOT do — stated plainly

<video>, <audio>, WebAudio and spellcheck do not work. That is a deliberate, reviewed choice, not an oversight.

GStreamer is not optional behind ENABLE_VIDEO. GStreamerChecks.cmake guards on USE_GSTREAMER and then runs:

set(GSTREAMER_COMPONENTS app pbutils)
if (ENABLE_VIDEO) ... endif ()
find_package(GStreamer 1.18.4 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS})

app and pbutils are listed unconditionally, so -DENABLE_VIDEO=OFF alone still fails configure. -DUSE_GSTREAMER=OFF is the real switch. Pantry's catalog has gstreamer.freedesktop.org/orc and no GStreamer core or gst-plugins-base — and neither does pkgx, so there is nothing to mirror and the subsystem waits on new recipes. Enchant, libhyphen, libmanette and libdrm/GBM are absent for the same reason, each with a find_package … FATAL_ERROR in OptionsGTK.cmake, so their features are off too. ENABLE_WEB_RTC is pinned off because the ENABLE_MEDIA_STREAM AND ENABLE_WEB_RTC branch sits outside the USE_GSTREAMER guard and would otherwise switch on the bundled libwebrtc.

Turning media back on is a follow-up that adds GStreamer core + gst-plugins-base; the flags are then a one-line flip.

Craft's declaration

Keyed under linux, so the Darwin binaries — which use the system WebKit framework — acquire nothing:

linux:gtk.org/gtk3^3.24   → libgtk-3, libgdk-3
linux:gnome.org/glib^2    → libglib-2.0, libgobject-2.0, libgio-2.0
linux:webkitgtk.org^2.54  → libwebkit2gtk-4.1, libjavascriptcoregtk-4.1

All seven unresolved libraries, each through its owning provider.

Verification

  • 11 new tests exercise both recipes through the maintained resolver (recipeDepsToSpecs), pinning the API selector, the GStreamer switch, the runtime resources, the libsoup3 requirement, Darwin staying empty, and that every declared domain resolves to a real catalog entry.
  • bun test on craft-recipe / dependency-platforms / resolve-build-version: 21 pass, 0 fail.
  • zig build test: 658 pass, 6 skip, 2 fail — the two pre-existing shell.install_route cases — confirming the regenerated generated.zig compiles.
  • Lint and typecheck clean.
  • Version discovery verified live: the tag pattern resolves 2.54.2 / 2.54.1 / 2.54.0, ignores 97 other WebKit monorepo tags, and rejects webkitgtk-2.54.0-rc1. The release tarball URL returns 200.

Scope

Nothing is published by this change, per the issue's instruction not to dispatch a publisher attempt before the provider exists. The recipe has not been built — a Linux source build cannot run on the development Mac, so the first CI build is its first real test, and the ELF closure validation and real Linux install the issue requires come after that. Refs, not Closes: the issue asks to stay open until delivery is actually qualified.

🤖 Generated with Claude Code

7 changed files on the files tab, with 0 review threads.

Sign in to comment on this pull request.