Skip to content

Native-only Linux host: compile out WebKitGTK when no web intent is declared#110

Merged
ctate merged 5 commits into
mainfrom
feat/native-only-host-b
Jul 11, 2026
Merged

Native-only Linux host: compile out WebKitGTK when no web intent is declared#110
ctate merged 5 commits into
mainfrom
feat/native-only-host-b

Conversation

@ctate

@ctate ctate commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Round B of the native-only desktop host. Round A (#107) inferred the web layer from app.zon and enforced it on Windows; this round delivers the Linux seam and the behavioral guarantees.

  • Compile the GTK host without WebKitGTK when the app declares no web intent: no include, no link, no symbol references; webview calls fail with the existing teaching error, and web-included builds are byte-identical
  • Audit Linux ELF executables (DT_NEEDED + dynsym) in tools/audit_web_layer.zig and refuse mismatched packages at package time, mirroring the PE guard
  • CI proves the seam from both directions: the canvas smoke job now builds without the WebKitGTK dev package and audits the binary, while the webkitgtk job audits a web app as present and a native-only app as absent
  • Pin native-only behavior end to end: automation session with the teaching error, record→replay round trip, and a macOS assertion that no WebKit XPC helpers spawn across a two-launch session

Native-only apps on Linux no longer need libwebkitgtk-6.0-dev to build and no longer need libwebkitgtk installed on user machines to run.

ctate and others added 4 commits July 11, 2026 12:21
- NATIVE_SDK_ALLOW_WEBKITGTK_STUB mirrors the Windows WebView2 seam: the define wins over header visibility, compiles out every WebKit-touching path (opaque never-non-NULL web-view pointers keep the GTK-only bookkeeping shape), and stubs the exported webview entry points
- Both Linux build graphs (build/app.zig and the generated template) compile gtk_host.c with the stub and drop the webkitgtk-6.0 link when the web layer is excluded; the native scaffold's generated CI stops installing libwebkitgtk-6.0-dev

Co-authored-by: WhiteHades <44260523+WhiteHades@users.noreply.github.com>
- tools/audit_web_layer.zig auto-detects PE vs ELF and hand-rolls an ELF64 reader over the section headers: DT_NEEDED entries naming libwebkitgtk/libjavascriptcoregtk and webkit_/jsc_ dynamic symbols are the evidence, refusal (never a pass) for anything it cannot parse
- native package grows the ELF twin of the PE guard: a WebKitGTK-linking binary packaged under a native-only decision is refused with the same teaching message, pinned by synthetic-ELF tests covering both evidence channels

Co-authored-by: WhiteHades <44260523+WhiteHades@users.noreply.github.com>
- linux-webkitgtk gains test-linux-web-layer-audit (seam under webkit-PRESENT conditions: native-only ELF scans clean, web ELF keeps its references) and linux-canvas-smoke drops libwebkitgtk-6.0-dev so the build itself is the native-only link test, with the ELF audit run on the real binary
- vendor pins keep the stub define wired through gtk_host.c and both build graphs; the macOS gpu-dashboard smoke asserts a native-only session spawns zero new WebKit helper processes

Co-authored-by: WhiteHades <44260523+WhiteHades@users.noreply.github.com>
- An automation-driven session on a native-only canvas app proves normal command dispatch plus the WebViewLayerNotBuilt teaching error on a webview attempt, with zero webviews reaching the platform host
- The session record/replay reference journal round-trips identically under web_layer=false; the capabilities and app.zon pages note the user-visible Linux consequence (no WebKitGTK to build or run)

Co-authored-by: WhiteHades <44260523+WhiteHades@users.noreply.github.com>
@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
native-sdk Ready Ready Preview, Comment Jul 11, 2026 5:38pm

- A Chromium exe packaged through zig build package shipped no CEF runtime because the CLI defaults to the system engine; forward --web-engine, --cef-dir, and --cef-auto-install exactly as the generated build graph already does
@ctate ctate merged commit 49aa5e7 into main Jul 11, 2026
21 checks passed
ctate added a commit that referenced this pull request Jul 11, 2026
- Bump the CLI, platform packages, and runtime version to 0.4.4.

- Fold the v0.4.4 release notes for #105, #106, #107, and #110 into the marked changelog entry.

- Credit co-authors in the v0.4.4 release notes and repair the v0.4.3 contributor list.
@ctate ctate mentioned this pull request Jul 11, 2026
ctate added a commit that referenced this pull request Jul 11, 2026
- Bump the CLI, platform packages, and runtime version to 0.4.4.

- Fold the v0.4.4 release notes for #105, #106, #107, and #110 into the marked changelog entry.

- Credit co-authors in the v0.4.4 release notes and repair the v0.4.3 contributor list.
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