Three fixes to build sddm on Redox (Wayland-only, Qt6):
- KeyboardModel.cpp: guard the XcbKeyboardBackend include + its runtime branch
with #ifndef __redox__ (platformName is never 'xcb' on Redox, but the dead
branch still pulled in <xcb/xkb.h> -> fatal error). Wayland backend kept.
- XAuth.h: declare ~XAuth() (the recipe's XAuth.cpp defines it, but the header
only declared the ctor -> 'definition of implicitly-declared destructor').
- wayland-patch.sh XAuth.cpp heredoc: add <QFileInfo> + <QRandomGenerator>
includes and replace Qt5 qrand() with QRandomGenerator (removed in Qt6).
Converting [source] git=/tar= to path="source" removed the URL cookbook parsed
the package version from, so non-Cargo recipes without an explicit
[package].version failed at packaging ('cannot guess version', hit on
ninja-build). Add version = "0.3.1" (the branch version, matching the vendored
convention e.g. brush) to the 3 affected recipes, and make vendor-recipe.sh add
it automatically on future conversions.
verify-patch-sanity.py validates every active recipe .patch has internally-
consistent hunk line counts — catching the 'malformed patch at line N' failure
at commit/CI/preflight time instead of hours into a cook. This cycle hit that
class three times (qtwaylandscanner, sddm, xwayland), each only discovered when
cookbook tried to apply the patch.
Running it across the repo found 29 latent malformed patches (validated against
GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22').
They were harmless only because they sit in vendored recipes (baked, not re-
applied) — but would fail on any version-bump re-derivation. --fix recounts the
hunk headers (body untouched) and repaired all 29.
Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test
(test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats
(empty placeholders, bare-@@ git hunks).
qt6-sensors provides Qt6::Sensors (needed by KWin) but its source/ (436 files)
was only present on disk, never git-tracked — not reproducible. Commit it as a
proper vendored tree for the full-fork build.
Root cause of the recurring line-duplication corruption (duplicate #include
<sys/ioctl.h>, nested #if QT_CONFIG(opengl), duplicate assert.h): several of the
recipe's in-place source-munging steps were NOT guarded, so on a committed
(vendored) source/ they re-applied every cook and accumulated. Guard the four
unguarded ones (qwaylandclientbufferintegration opengl-wrap, qnet_unix ioctl
include, corelib CMakeLists REDOX storageinfo block) with grep/marker checks so
re-running on an already-patched tree is a no-op. The rest were already guarded
or naturally idempotent (text.replace consuming its needle).
vendor-recipe.sh converts a transient recipe to the vendored full-fork model
(repo fetch -> strip .git -> [source] path=source with provenance comment ->
un-ignore -> stamp). Used to vendor 23 of the 26 transients. xwayland deferred
(corrupt redox.patch needs regeneration; X11-compat, not login-critical);
smallvil + seatd-redox not in the full set.
Convert the transient git-fetch sddm recipe to the vendored model: commit the
source/ tree (pristine sddm @63780fcd + the two Redox patches baked in), switch
[source] to path="source" so the build never reaches github at cook time, and
keep the .patch files tracked for re-application on a version bump. Also fixes
the malformed redox-helper-utmpx-stub.patch (wrong hunk line-counts -> 'malformed
patch at line 24') by regenerating it with correct headers. First of the 26
transient recipes being vendored for an offline, reproducible full-fork build.
Proves build-redbear.sh's vendored source/ staleness loop: seeds on first sight
(no spurious rebuild), stays quiet unchanged, and invalidates target/ on
committed/uncommitted/untracked source/ changes. Keeps the loop body in sync.
The staleness gap behind the qtshadertools failure: cookbook keys its build
cache on the source.tar hash, but the actual build input for a vendored recipe
is the git-committed source/ tree. A version bump that propagates into source/
without changing source.tar (Qt's source.tar was already 6.11.1 while source/
was a 6.11.0 muddle) leaves cookbook reusing a stale stage — the desktop then
builds the old version. New loop fingerprints each vendored source/ by its git
tree hash (+ dirty flag) and rm's target/ on change; first observation only
seeds the fingerprint so it never forces a spurious full rebuild.
The 6 Plasma modules (breeze/kdecoration/kf6-kwayland/kglobalacceld/kwin) and
konsole were 'no-marker(skip)' because src_version/the validator only knew KF's
KF_VERSION. Now both also read set(PROJECT_VERSION) (Plasma) and the split
RELEASE_SERVICE_VERSION_MAJOR/MINOR/MICRO (KDE Gear), so these vendored modules
are version-checked and rebasable. Test E23.
Redo of the earlier lossy rebase with the added-file-preserving engine. 38
modules rebased to their declared upstream (KF 6.28.0 / Plasma 6.7.2 / Gear /
plasma-wayland-protocols 1.21.0) with every RedBear-added file kept (verified:
kglobalacceld5-wrapper.sh, utmp_compat.h, notifications_interface.cpp, kpty
shims) and blake3/source.tar reconciled. Deletion audit vs the pre-rebase base
shows zero RedBear files lost. 7 modules remain at their tested version pending a
manual Redox-port rebase (kf6-kded6/kiconthemes/kio/kservice SHIM-REJECT,
kirigami PATCH-REJECT, kf6-kimageformats/plasma-desktop DL-FAIL) — flagged, not
silently shipped.
The engine silently no-op'd ('!! not found') when given full paths like
local/recipes/kde/kf6-kio/ — resolve only understood bare names or group/name
tokens. Now strips a trailing slash, an absolute ROOT prefix, and a
local/recipes/ prefix before matching. Test E22.
9th silent-failure bug: the version stamp was checked BEFORE the real code marker
(Qt .cmake.conf / KDE KF_VERSION). A code-only revert leaves the stamp stale, and
the stale stamp then reported the module 'consistent' -> the engine skipped a
needed rebase and the validator false-passed a divergent tree. Both now check the
authoritative code marker first and use the stamp only as a fallback for
marker-less trees. The validator also learned KDE's KF_VERSION marker. Test E21.
Data-loss bug: rsync --delete during a rebase dropped RedBear-added files that
carry no __redox__ token (a Redox Wayland-crash wrapper .sh, a utmp compat
header, a generated D-Bus interface) because the capture was grep-on-marker
only. The engine now, for EVERY vendored rebase, fetches pristine(Vold) and
carries forward every committed file absent from Vold (content-agnostic, matched
by path) — so RedBear additions survive. If Vold cannot be fetched it rejects
(manual) rather than produce a lossy tree. New tests E20 (non-marker added file
preserved) + Vold fixtures for the rebase cases. 41 tests green.
Auto-resolved by sync-recipe-source.sh once the shim-port bugs were fixed: the
baked Redox shims (kpty PTY/utmp guards, UDisks2 D-Bus/optical-disc branches)
apply cleanly to 6.28.0 and are content-verified present in the rebased tree.
Found by extending the edge-case suite to the baked-shim path (E17-E19) after a
sync reported 'ready' but silently dropped a module's Redox shim:
- git show used an ABSOLUTE recipe path ('HEAD:/mnt/.../source/f') which git
rejects (needs repo-relative) -> empty content -> garbage delta. Now uses
${dir#$ROOT/}.
- diff|patch under 'set -o pipefail': diff exits 1 whenever files differ (always
here), so the pipeline looked failed even when patch succeeded -> EVERY shim
false-rejected. Now captures the delta to a file and checks patch's own exit.
- a shim whose file was renamed/removed upstream, or unreadable from HEAD, was
silently skipped. Now: Redox-added files are carried in verbatim; a missing
target or unreadable HEAD file -> SHIM-REJECT (manual), never a silent drop.
Also: old-version URL derivation now rewrites the major.minor dir component too
(KDE mirrors nest tarballs under .../6.28/foo-6.28.0). CI branch glob widened to
[0-9]* so 0.4.0/0.5.0 release branches keep triggering.
Follow-up to the KDE rebase: the vendored bumps had left recipe blake3 stale
(URL bumped, hash not), so recipe.toml declared a hash that no longer matched its
own source.tar. sync-recipe-source.sh now sets recipe blake3 to the authoritative
source.tar hash, and bumps transient recipes' stale cached source.tar to the
declared version. Applied to the marker-readable + transient set.
Integration (answers 'does it run automatically'):
- redbear-ci.yml now runs test-versioning-machinery.sh (33 cases) and
verify-external-source-versions.sh on every push/PR; trigger widened to
0.3.* so a release-branch increment keeps CI (and these checks) firing.
- The validator already runs in build-preflight.sh Phase 1.0C (every build),
and bump-graphics-recipes.sh (invoked by bump-release.sh --with-external)
now calls the sync engine — so an external bump propagates + is validated.
Engine hardening (both regression-tested):
- reconcile_blake3: a vendored bump often left recipe blake3 stale (URL bumped,
hash not); the engine now sets recipe blake3 to the authoritative source.tar
hash (only when source.tar version matches the URL version; no-op under --check).
- transient recipes (no vendored source/) now get their stale cached source.tar
bumped to the declared version too, instead of being skipped.
Applies the versioning fix to the KDE stack via sync-recipe-source.sh: these
modules carry no Redox port (0 __redox__ markers, 0 or auto-appliable patches),
so each is a clean pristine-6.28.0 re-lay with --checksum + a version stamp,
dropping the stale 6.10.0 trees and the line-duplication corruption. The 6
Redox-touching modules (kf6-pty/kio/solid/kservice/kded6, kirigami) are left for
manual port rebasing; mesa and other unknown-marker trees are untouched.
Each module still needs a Redbear OS build-adaptation pass at 6.28.0 (18 versions
of upstream drift); tracked as follow-up.
Edge-case suite (local/scripts/test-versioning-machinery.sh, 27 cases, zero
network via file:// tarballs) covering the validator and the sync engine.
It found and fixed three silent-failure bugs — the exact class the user flagged:
- sync engine used 'rsync -a --delete' (size+mtime quick-check): a changed file
of identical size with a coincidental mtime was skipped, leaving stale content
in source/. Now uses --checksum (content comparison).
- apply_patch relied on patch's default fuzz: a patch whose context no longer
matched the new upstream was force-fitted instead of rejected. Now --fuzz=0
(exact context; line offsets still allowed).
- decorrupt collapsed ANY run of identical lines, mangling legitimate paired
lines; now only collapses the corruption pattern (runs >=4).
Also: unknown-version recipes are skipped (never clobber a ported tree like
mesa), and grep patterns use [[:space:]] for portability.
Root cause of the Qt 6.11.0/6.11.1 and KDE 6.10.0/6.28.0 divergences: a version
bump rewrote recipe tar=/blake3= but never propagated into the vendored source/
tree (the actual build input), and nothing caught the resulting drift.
Adds the missing pieces (see local/docs/VERSIONING.md):
- sync-recipe-source.sh: propagation engine — rebases a vendored source/ onto
the recipe's declared version (pristine + patches + captured baked delta),
with baked-shim preservation and corruption drop; reports patches/shims that
need a manual rebase instead of applying with fuzz.
- verify-external-source-versions.sh: preflight gate (build-preflight.sh Phase
1.0C, REDBEAR_SKIP_EXTERNAL_SOURCE_CHECK) that fails loudly on recipe-vs-
source-vs-tarball version divergence — the tar-recipe analogue of
verify-fork-functions.sh.
- bump-graphics-recipes.sh: now calls the sync engine after a bump, so a bump
can never again silently no-op on a vendored recipe.
- source/.redbear-src-version stamp; seeded for the corrected qt modules.
Same half-done bump as qtbase: recipe tar= was 6.11.1 but the vendored source/
trees stayed 6.11.0. These three carry no Redox port (0 __redox__ markers), so
each is a clean pristine-6.11.1 re-lay:
- qtwayland: pristine 6.11.1 (no patches)
- qtdeclarative: pristine 6.11.1 + P1-skip-tools-crosscompile.patch
- qtsvg: pristine 6.11.1; stale 6.11.0 source.tar replaced; CVE-2026-6210 patch
dropped (the heap-overflow fix is already in upstream 6.11.1)
Drops the injected line-duplication corruption present in the old trees.