Gate the GPU renderer behind the runtime feature - #53
Merged
Merged
Conversation
`anyrender_vello` was a hard dependency. `mod runtime` is the only thing that names `VelloWindowRenderer`, and that module is already behind the `runtime` feature, so the renderer was reachable by exactly the consumers who could never use it: a headless build linked wgpu, wgpu-hal, wgpu-core, naga and two versions of vello to serve a socket that reads a semantic tree. `qa-inspect-host` did everything a consumer can do -- `default-features = false`, `features = ["agent-control"]` -- and still got a GPU stack, because no feature governed the dependency. Same shape as `system-fonts` sitting in `blitz-dom`'s default list. The intent was written down, in this feature's own comment: "a headless consumer gets the inspection and activation surface with no Tauri in its graph ... for a binary that never opens a window". Nothing enforced it, so it was not true. Optional, and added to `runtime`. No code changes: every use site was already gated. Measured on x86_64-unknown-linux-gnu, matching wgpu, naga and the GPU vello: --no-default-features --features agent-control 0 --features runtime 58 The graph check is why this survived. It looked for `tauri v|gtk|glib|webkit| soup` and passed a build carrying wgpu, so it now looks for renderers as well, and pins the target rather than inheriting the runner's. `ps-anyrender-vello-cpu` is deliberately still allowed. It arrives through `blitz-script` behind `debug-control`, which serves the `screenshot` endpoint, and rasterising is what that endpoint is for. Whether a pure inspection host should offer screenshots at all is a separate question and not one a grep should decide. Breaking for anyone depending on this crate with `default-features = false` and relying on the renderer being present regardless; they enable `runtime`. Headless clippy clean, `--all-features` checks. Releases 0.3.5.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
anyrender_vellowas a hard dependency.mod runtimeis the only thing that namesVelloWindowRenderer, and that module is already behind theruntimefeature — so the renderer was reachable by exactly the consumers who could never use it.A headless build linked
wgpu,wgpu-hal,wgpu-core,nagaand two versions of vello to serve a socket that reads a semantic tree.qa-inspect-hostdid everything a consumer can do —default-features = false,features = ["agent-control"]— and still got a GPU stack, because no feature governed the dependency.Same shape as
system-fontsThe intent was written down, in this feature's own comment:
Nothing enforced it, so it was not true.
system-fontssat inblitz-dom's default list the same way.The change
anyrender_vellobecomesoptionaland joinsruntime. No code changes — every use site was already gated.Measured on
x86_64-unknown-linux-gnu, matchingwgpu,nagaand the GPU vello:--no-default-features --features agent-control--features runtimeThe gate that should have caught it
"No window stack in the graph" looked for
tauri v|gtk|glib|webkit|soupand passed a build carrying wgpu. It now looks for renderers too, and pins the target rather than inheriting the runner's. Verified to discriminate: 0 headless, 58 withruntime.Deliberately still allowed:
ps-anyrender-vello-cpuIt arrives through
blitz-scriptbehinddebug-control, which serves thescreenshotendpoint. Splittingscreenshotout ofdebug-controlin ps-blitz is the follow-up that lets this be banned too; it is a ps-blitz change and needs a release before this repository can tighten the grep.Verified
Headless clippy clean,
--all-featureschecks (which is what crates.io verifies with). Releases 0.3.5.