Repository navigation
[CTX-1605] build: vendor winit 0.30.13 for Wayland Occluded - #2726
Merged
Merged
Conversation
Vendor the exact crates.io winit 0.30.13 source (release commit e9809ef5) into vendor/winit and apply the upstream rust-windowing/winit#4710 v0.30.x backport (head e2cb6c08) unmodified: 5 files, +65/-10, zero fuzz, verified against the registry tree file by file. Wire the tree through [patch.crates-io] with exclude = ["vendor/winit"], so the path crate never becomes an implicit workspace member and cargo fmt --all / clippy --workspace stay off upstream code. The Wayland backend now emits Occluded(true) when the xdg-shell v6 suspended state is set and Occluded(false) when it clears, which is the native edge the surface-visibility gate consumes for issue #2570. No other backend, public API, feature, or dependency changes; Cargo.lock keeps winit 0.30.13 and only loses the registry source and checksum. No test is added inside the vendored tree: exercising the edge needs a live WlSurface and WindowConfigure, and any harness there would diverge the source from the upstream PR this record pins. The app-side Occluded gate test covers the consumed edge. Provenance, hunks, the upstream review caveat, the supply-chain result, and the update/exit plan live in vendor/winit/PATCHES.md.
Ignore the exact upstream winit Markdown paths in markdownlint (README, FEATURES.md, docs/, src/changelog/) instead of reformatting vendored source; PATCHES.md stays linted. Tell Dependabot that winit is a patched path dependency it cannot bump, pointing at the PATCHES.md update procedure. Update the #2570 occlusion comments and the one-shot Wayland triage line: the probe is now the fallback for compositors that never set xdg-shell v6 suspended, not the only Wayland source.
The vendored winit now delivers native Wayland `Occluded` edges. A redraw request that was outstanding when the surface suspended stayed in the probe, so the first `about_to_wait` after the native reveal re-read it as starvation and closed the gate again until the resume frame callback. Record a reveal by clearing `last_request` too; `redraw_seen` stays untouched because a reveal is not proof of a delivered frame. Add the reviewer failing test (before the fix `starvation_edge` returned `Some(true)` after the native reveal). Dedupe the crash-report `Revealed` mark: a `Resized`/focus-driven synthetic reveal can precede the native `Occluded(false)` for the same transition, so the mark now follows the gate transition instead of the edge count.
A requirement bump re-resolves winit to the registry and cargo only warns that the patch was not used: the build stays green and the Wayland Occluded edge disappears. Add `just vendored-winit` (offline, no build) to `just check` and a shard-1 CI step: the lock must carry no source/checksum for winit, cargo metadata --locked must resolve it to vendor/winit, and the whole tree must match the digest pinned in PATCHES.md. The fixture test proves the registry-lock, out-of-tree-manifest, checksum-only, stale-digest, missing-digest, and missing-tree cases fail while the production state and a synthetic path-resolved graph pass. Ignore winit in the Dependabot cargo update so the monthly grouped bump cannot silently undo the patch, and keep the actionable note in PATCHES.md. PATCHES.md now records the tree digest and the exact recompute command, and the advisory coverage gap: path packages carry no registry source, so neither cargo audit nor cargo deny advisories matches RustSec ranges against the vendored tree (control test: a synthetic time 0.1.44 entry matches RUSTSEC-2020-0071 with a registry source and does not without one). It carries the deny.toml-aligned 2027-03-31 re-audit bound and a synthetic-lock audit snippet, corrects the cargo update wording, and points the update procedure at the digest and the gate. deny.toml points auditors at the same compensating controls.
…e checks The recorded #4710 diff must stay byte-identical to upstream (its SHA-256 is pinned in PATCHES.md); empty diff context lines carry a trailing space by definition, so `git diff --check` reports them if the file is ever touched. Mark the patch file with `-whitespace` and say why.
|
Important Review skippedToo many files! This PR contains 227 files, which is 127 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.
|
F9: the tree digest deliberately excludes patches/, so editing the recorded diff alone passed the gate. `just vendored-winit` now also hashes the file named by the `Patch` row against `Patch SHA-256` and fails with both values; the fixture test mutates the diff and proves the failure while the tree digest still matches (and keeps the intact fixture passing). F8: add the deterministic dedupe test next to the occlusion gate test: a sentinel Resized followed by Occluded(false) on an open gate leaves the lifecycle mark untouched, while the real Occluded(true) -> Occluded(false) transition still records revealed. It fails without the dedupe (left: revealed, right: resized) and passes with it. F7: the exit plan now also removes the gate wiring (justfile recipes and the check entry, the CI step, the script with its test and fixtures, the .gitattributes line, and the dependabot ignore). F6: the supply-chain bullet no longer claims no deny.toml edit: there is no policy change, only the CTX-1605 comment pointing at the advisory section. F10: the gate is no longer described as offline (it needs the local cargo index/cache), and the advisory snippet records that --no-fetch needs a populated ~/.cargo/advisory-db.
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.
Priority: P1 | Area: platform | Labels: fix,P1,area:platform | Milestone: v0.0.30 | RFC: OQ-WAYLAND-SUSPENDED | Task: CTX-1605
Summary
Vendors
winit 0.30.13with upstream PR #4710 soWindowEvent::Occludedis emitted on Wayland when the compositor sets the xdg-shell v6suspendedstate. This is the local fix for bitty#2715: Hyprland 0.56.2 sendssuspendedbut keeps serving frame callbacks, winit 0.30.13 never constructsOccluded, so the surface gate and the starvation probe both stay blind.The vendored tree is the published 0.30.13 crate plus exactly the recorded patch (5 files, +65/−10);
PATCHES.mdrecords the base/head SHAs, fetch date and hash, patch surface, sync strategy, exit plan and maintenance owner.Why vendoring
Occludedon Wayland, and the upgrade is +358/−308 lock churn, 91 compile errors and MSRV 1.86.CHANGES_REQUESTEDthat predates the current cut-down shape.Hardening in this PR
scripts/check-vendored-winit.sh+just vendored-winit(injust check, and a CI step) fail if the lock records asource/checksum, ifcargo metadataresolves winit outsidevendor/winit, or if the vendored-tree digest drifts. Dependabot ignoreswinit(a bump would otherwise drop the patch with only a Cargo warning).crates/bitty-platform/src/app.rs): a nativeOccluded(false)now clearslast_request, so the probe cannot synthesise a stale occlusion immediately after a reveal. Regression test fails before, passes after. The duplicateRevealedlifecycle mark is deduped.PATCHES.md): path packages are outside RustSec matching in bothcargo auditandcargo deny; the record states the 2027-03-31 bound, a compensating synthetic-lockcargo audit --fileprocedure, and pointsdeny.tomlat it.PATCHES.md) is enforced by the gate.event.rs/app.rsnow sayOccludedis native on iOS, X11, and Wayland-with-suspended, probe otherwise.Gates
cargo test -p bitty-platform --lib217 passed (216 + the new reveal test)--features input-vm-test-support1 passedcargo test -p bitty-terminal --bin bitty --test-threads=11318 passedcargo check --workspace --all-targets --locked, fmt, clippy-D warningscleancargo deny checkadvisories/bans/licenses/sources ok (control-tested: a GPL vendored manifest fails)just vendored-winit/-testpassMerge order
The ADR-0004 amendment (bitty-docs CTX-0295) merges after this, citing the merge commit. The exit plan is to drop the vendor tree, patch, exclude, lint ignores and the resolution gate once a released winit carries #4709/#4710.
Closes #2715.