Skip to content

fix(headless): no Tauri, and so no GTK, in a browser with no window - #40

Merged
pathscale merged 2 commits into
masterfrom
fix/headless-without-tauri
Sep 9, 2026
Merged

fix(headless): no Tauri, and so no GTK, in a browser with no window#40
pathscale merged 2 commits into
masterfrom
fix/headless-without-tauri

Conversation

@pathscale

Copy link
Copy Markdown
Owner

Every site's QA job dies building the host on Linux:

The system library `glib-2.0` required by crate `glib-sys` was not found.

Dependencies are per package, not per binary, so --bin chuzz-headless compiled all of chuzz-gui's graph. default-features = false on tauri never helped, because the path is not the webview:

glib-sys <- atk <- gtk <- muda <- tauri
                   gtk <- webkit2gtk <- tauri-runtime

muda is the menu crate and tauri-runtime names WKWebView types in its public API. Both unconditional.

tauri-runtime-blitz already had the answer. Its runtime feature gates Tauri and its comment says off it a headless consumer gets the inspection surface "with no Tauri in its graph, which on Linux is the difference between a build and GTK development headers". We were taking defaults.

Change: gui feature = dep:tauri + tauri-runtime-blitz/runtime, with browser, frontend, the chuzz-gui bin and tauri_build::build() behind it. On by default, so an ordinary build is unchanged. source_html moved to a new internal_pages module, since it was the only thing keeping browser in the headless graph.

Verified on the Linux target: cargo tree -i glib-sys and -i tauri both report no such package; GUI binary still builds; fmt and clippy clean.

Includes the 0.1.37 bump rather than a follow-up PR.

meh added 2 commits September 9, 2026 17:01
`cargo build --bin chuzz-headless` failed on a Linux runner with

    The system library `glib-2.0` required by crate `glib-sys` was not found.

Dependencies are per package, not per binary, so the headless binary compiled
the whole of `chuzz-gui`'s graph. `default-features = false` on `tauri` was
not enough, and could not be: the path is not the webview.

    glib-sys <- atk <- gtk <- muda <- tauri
                       gtk <- webkit2gtk <- tauri-runtime

`muda` is Tauri's menu crate and `tauri-runtime` names WKWebView types in its
public API, so both are unconditional. Same shape as the `objc2-web-kit` note
in build.rs, which is about the macOS end of the same fact.

`tauri-runtime-blitz` already anticipated this: its `runtime` feature gates
Tauri, and its own comment says that off it, "a headless consumer gets the
inspection and activation surface with no Tauri in its graph, which on Linux is
the difference between a build and GTK development headers for a binary that
never opens a window". This workspace was taking it with defaults and getting
the window stack it does not use.

So `gui` is now a feature: `dep:tauri` and `tauri-runtime-blitz/runtime`, with
`browser`, `frontend` and the `chuzz-gui` binary behind it, and `tauri_build`
gated in build.rs because the context it generates has nothing to describe
without them. Default keeps it on, so an ordinary build is unchanged.

`source_html` moved to a new `internal_pages` module. It is a pure string
function that `document_loader` and `capture` both call, and it was the only
thing keeping `browser` in the headless graph. View source and the error page
are pages rather than chrome, so that is where they belonged anyway.

Verified against the Linux target: `cargo tree -i glib-sys` and `-i tauri` both
report no such package in the headless graph, and the GUI binary still builds.

0.1.37 rather than a second pull request: the action changes how consumers
build the host and the feature split changes what ships, so they are one
release.
The lockfile commit removed a comment paragraph above the frontend install
step and took the step's indentation with it, leaving

          - name: Install frontend dependencies

twelve spaces deep inside a six-space block. GitHub rejects the file before
running anything:

    This run likely failed because of a workflow file issue.

So 0.1.36 was merged, tagged in the manifest, and never published: the release
job could not start. A bump with a broken workflow is not a release, and the
failure names the file rather than the line, which is why it read as an
infrastructure problem rather than a typo.

Every workflow and action in this repository now parses.
@pathscale
pathscale merged commit 1b0fd71 into master Sep 9, 2026
4 checks passed
@pathscale
pathscale deleted the fix/headless-without-tauri branch September 9, 2026 10:07
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