From 0098147e5c950f2cc12351eff897f07ba732c8a2 Mon Sep 17 00:00:00 2001 From: vasilito Date: Sun, 21 Jun 2026 15:26:24 +0300 Subject: [PATCH] docs(build-system): add v6.1 addendum for cleanup safety + qfeatures.h fix Document two critical build-system findings: C-7.1: Ad-hoc cleanup scripts deleted tracked sources - Added local/scripts/cleanup-build.sh (git-aware cleanup) - Updated AGENTS.md with safe cleanup procedure C-7.2: qtdeclarative missing qfeatures.h caused division-by-zero - Added cmake --install to properly stage generated headers - Added explicit QT_FEATURE_quick_shadereffect/draganddrop flags - Added safety-net to regenerate qtquick-config.h if empty --- .../BUILD-SYSTEM-V6-HARDENING-POSTMORTEM.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) diff --git a/local/docs/BUILD-SYSTEM-V6-HARDENING-POSTMORTEM.md b/local/docs/BUILD-SYSTEM-V6-HARDENING-POSTMORTEM.md index 00ef935478..3ce67df3c0 100644 --- a/local/docs/BUILD-SYSTEM-V6-HARDENING-POSTMORTEM.md +++ b/local/docs/BUILD-SYSTEM-V6-HARDENING-POSTMORTEM.md @@ -197,3 +197,117 @@ shipment status. | `local/docs/BUILD-SYSTEM-V6-HARDENING-POSTMORTEM.md` | This doc updated for 14-session / 9.5-DONE / 122-Python-test state (Session 14 entry + b8c1c780d commit-history row) | Next user-chosen commit; touches paths the user may have other WIP for | | `local/docs/BUILD-SYSTEM-FINGERPRINT-HARDENING-PLAN.md` | User WIP plan (Phase 6+, "pending Oracle fingerprint architecture review") | Draft, not for committing in this arc | | User's `AGENTS.md`, `local/AGENTS.md`, `README.md`, `config/redbear-*.toml`, `local/sources/{base,bootloader,kernel}` | 7,000+ modifications | User WIP; not in this arc | + +--- + +## v6.1 Addendum (2026-06-21) — Cleanup Safety + qtdeclarative qfeatures.h Fix + +### Finding C-7.1: Ad-hoc cleanup scripts deleted tracked sources + +**Date:** 2026-06-21 +**Severity:** HIGH (caused build failure, required manual source restoration) +**Status:** FIXED + +#### Problem + +An ad-hoc cleanup script (`/tmp/cleanup-redbear.sh`) was used to free +disk space before a full rebuild. The script used `rm -rf` on +patterns that matched **tracked source files** under +`local/recipes/*/source/` and `local/sources/*/source/`. Specifically: + +- `local/recipes/libs/libepoxy/source/` (deleted) +- `local/recipes/libs/libdisplay-info/source/` (deleted) +- `local/recipes/libs/libxcvt/source/` (deleted) +- `local/recipes/libs/lcms2/source/` (deleted) +- `local/recipes/system/diskd/source/` (deleted) +- `local/recipes/system/devfsd/source/` (deleted) +- `local/patches/tokio/vendored/src/runtime/task/core.rs` (deleted) + +These sources were committed to git history (commits `f36b6a4582`, +`8782592b9a`, `7c49c45e0e`) and had to be manually restored via +`git checkout`. + +#### Root cause + +The cleanup script did not check whether paths were tracked by git +before deletion. The mainline Redox `make clean` and `make distclean` +targets DO check this, but the ad-hoc script bypassed them. + +#### Fix + +Added `local/scripts/cleanup-build.sh` — a git-aware cleanup script +that: + +1. Uses `git ls-files --error-unmatch` to check every path before + deletion +2. Skips and warns about tracked paths instead of deleting them +3. Supports three modes: `artifacts` (safest), `--all` (also removes + recipe `target/`), `--nuclear` (also removes local recipe + `target/`) +4. Refuses to run outside a git repository + +Updated `AGENTS.md` to document the safe cleanup procedure and +explicitly warn against ad-hoc `rm -rf`. + +### Finding C-7.2: qtdeclarative missing qfeatures.h caused `division by zero in #if` + +**Date:** 2026-06-21 +**Severity:** CRITICAL (blocked SDDM and KWin builds) +**Status:** FIXED + +#### Problem + +The `local/recipes/qt/qtdeclarative/recipe.toml` manually copied +include files from the build directory to the staged sysroot. This +missed the build-time generated `qfeatures.h` (and per-module +`*config.h` files like `qtquick-config.h`). + +Without `qfeatures.h`, the preprocessor expansion +`QT_CONFIG(quick_shadereffect)` and `QT_CONFIG(quick_draganddrop)` +in `qquickitem.h` (lines 119, 460) hit a deliberate `1/0` divide-by-zero +trap, producing these errors when compiling `sddm-greeter-qt6`: + +``` +qquickitem.h:119:5: error: division by zero in #if + 119 | #if QT_CONFIG(quick_shadereffect) +qquickitem.h:460:5: error: division by zero in #if + 460 | #if QT_CONFIG(quick_draganddrop) +``` + +#### Root cause + +Two issues in the qtdeclarative recipe: + +1. **Missing `cmake --install`** — qtbase, qtsvg, and other Qt module + recipes use `cmake --install` to properly stage all generated files + (including `qfeatures.h`). The qtdeclarative recipe skipped this + step and copied files manually. + +2. **Empty `qtquick-config.h`** — Even with `cmake --install`, the + `qtquick-config.h` file was being generated empty because the + recipe did not explicitly enable `QT_FEATURE_quick_shadereffect` + or `QT_FEATURE_quick_draganddrop`. + +#### Fix + +Three changes to `local/recipes/qt/qtdeclarative/recipe.toml`: + +1. Added `cmake --install . --prefix "${COOKBOOK_STAGE}/usr"` after + the build step to properly install all generated files. + +2. Added explicit `-DQT_FEATURE_quick_shadereffect=ON`, + `-DQT_FEATURE_quick_draganddrop=ON`, `-DQT_FEATURE_draganddrop=ON`, + `-DQT_FEATURE_quick_controls2=ON` to the CMake configuration. + +3. Added a safety-net block that regenerates `qtquick-config.h` + with all required feature definitions if CMake produces an empty + file (defensive programming for future Qt version changes). + +### Commits + +| Commit | What | +|--------|------| +| `57a3ea6c9` | qtdeclarative qfeatures.h fix (cmake --install + safety net) | +| `6a7abe0b87` | qtdeclarative qtquick-config.h fix (explicit feature flags + regen safety net) | +| (pending) | Safe cleanup script + AGENTS.md + CONSOLE-TO-KDE-DESKTOP-PLAN.md v5.8 | +