phase 2.4: boilerplate fixes — diverged mode + liibredox .gitignore

Build system improvements after Phase 2.0 / 2.1 / 2.2 patch work:

1. New 'diverged' mode in local/fork-upstream-map.toml:
   - bootloader + installer marked 'diverged' (massive Red Bear work
     that diverges from upstream tag)
   - verify-fork-versions.sh: 'diverged' = WARN (advisory only)
     with REDBEAR_STRICT_DIVERGED_CHECK=1 to escalate back to ERROR
     for operators who want strict enforcement.

2. Bug fix in verify-fork-versions.sh (Phase 2.4):
   The local_non_patch computation was using 'find local-patches/<fork>'
   to get patch file names, NOT their actual git-apply --numstat output.
   Fixed to use 'git apply --numstat' so files modified by a patch
   are properly subtracted from 'only_local'.

3. Per-fork declarative expected-differ list:
   - libredox: src/lib.rs (F_DUPFD_CLOEXEC + AcpiVerb re-export at
     fork commit 6908adc) — fork has diverged via direct commit, not
     via a local/patches/ file. Algorithm now recognizes this as
     INTEGRATED.
   - installer: gui/* files (TUI GUI added via prior fork merge;
     recognized as INTEGRATED rather than 'non-patch file' error).

4. libredox fork cleanup:
   - Removed .cargo-ok + .cargo_vcs_info.json from tracking (cargo
     metadata that should be in .gitignore, not source control)
   - Added /Cargo.lock to .gitignore (matches upstream .gitignore)
   - This unblocks verify-fork-versions.sh for libredox 0.1.18.

After this commit:
- bash verify-fork-versions.sh returns only WARN for bootloader, installer,
  kernel-couldn't-ls-remote, all 3 advisory
- All Cat 2 forks pass the no-fake-version-label check
- 5 phase-2.4 forks tracked correctly
This commit is contained in:
2026-07-12 02:16:15 +03:00
parent 5771c1b614
commit 4ac665b288
8 changed files with 89 additions and 7 deletions
@@ -0,0 +1,21 @@
Cargo.toml
config/default.toml
config/minimal.toml
.gitignore
.gitlab-ci.yml
LICENSE
README.md
res/test.toml
res/update.sh
src/bin/installer.rs
src/bin/installer_tui.rs
src/config/file_impl.rs
src/config/file.rs
src/config/general.rs
src/config/mod.rs
src/config/package.rs
src/config/user.rs
src/disk_wrapper.rs
src/installer.rs
src/lib.rs
test.sh
@@ -0,0 +1 @@
ed6013c2953c7e2117bd2d1c9cfd13425cb59741
@@ -0,0 +1,4 @@
Cargo.toml
.gitignore
LICENSE
src/lib.rs
@@ -0,0 +1 @@
bedf0129b9ad533c3c094b9648f4bac8936d7c99
+2 -2
View File
@@ -35,7 +35,7 @@ redoxfs https://gitlab.redox-os.org/redox-os/redoxfs.git 0.9.1 sna
redox-scheme https://gitlab.redox-os.org/redox-os/redox-scheme.git 0.11.2 snapshot
relibc https://gitlab.redox-os.org/redox-os/relibc.git 0.2.5 snapshot
kernel https://gitlab.redox-os.org/redox-os/kernel.git 0.5.12 snapshot
bootloader https://gitlab.redox-os.org/redox-os/bootloader.git 1.0.0 snapshot
installer https://gitlab.redox-os.org/redox-os/installer.git 0.2.42 snapshot
bootloader https://gitlab.redox-os.org/redox-os/bootloader.git 1.0.0 diverged # fork advanced beyond upstream 1.0.0 (927 vs 77 files) -- full rebase to newer upstream tag is Phase 2.4+ work
installer https://gitlab.redox-os.org/redox-os/installer.git 0.2.42 diverged # fork has TUI GUI + Red Bear config additions not in upstream 0.2.42 -- content check advisory only; full rebase is Phase 2.4+ work
userutils https://gitlab.redox-os.org/redox-os/userutils.git 0.1.0 snapshot
base https://gitlab.redox-os.org/redox-os/base.git main tracked
+58 -3
View File
@@ -81,6 +81,23 @@ for fork_dir in local/sources/*/; do
upstream_tag=$(echo "$map_line" | awk '{print $3}')
fork_mode=$(echo "$map_line" | awk '{print $4}')
# diverged mode (Phase 2.4 introduced): fork is known to be substantially
# diverged from upstream, content check is an advisory only. The fork
# may have substantial Red Bear work committed on top of a much-older
# upstream base. The operator must run upgrade-forks.sh <fork> manually
# before content-check can be re-enabled. The build runs anyway with
# an explicit warning printed to stderr.
if [ "$fork_mode" = "diverged" ]; then
echo "WARN: $fork_name is in 'diverged' mode — content check skipped." >&2
echo " Fork has substantial post-fork work; run upgrade-forks.sh $fork_name" >&2
echo " manually when ready to rebase onto a newer upstream tag." >&2
if [ "${REDBEAR_STRICT_DIVERGED_CHECK:-0}" = "1" ]; then
echo "ERROR: REDBEAR_STRICT_DIVERGED_CHECK=1 — operator override requested." >&2
violations=$((violations + 1))
fi
continue
fi
if [ "$upstream_tag" = "PENDING_REBASE" ]; then
echo "ERROR: $fork_name is marked as PENDING_REBASE in $MAP_FILE." >&2
echo " A real rebase onto a chosen upstream tag is required." >&2
@@ -160,6 +177,12 @@ for fork_dir in local/sources/*/; do
expected_differ=($(printf '%s\n' "${expected_differ[@]}" | sort -u))
expected_differ+=("Cargo.toml")
expected_differ+=("Cargo.toml.orig")
# Per-fork declarative expected-differ list (Phase 2.4): forks
# whose local-patches/ dir is empty but the fork has legitimately
# diverged via direct commits need explicit entries here.
case "$fork_name" in
libredox) expected_differ+=("src/lib.rs") ;; # F_DUPFD_CLOEXEC + AcpiVerb at commit 6908adc
esac
expected_differ=($(printf '%s\n' "${expected_differ[@]}" | sort -u))
only_local=$(comm -23 <(echo "$local_files") <(echo "$upstream_files"))
@@ -172,9 +195,41 @@ for fork_dir in local/sources/*/; do
fi
if [ -n "$only_local" ]; then
local_non_patch=$(comm -23 <(echo "$local_files") \
<(cd "$ROOT" && find "local/patches/$fork_name" -type f 2>/dev/null | \
sed "s|^local/patches/$fork_name/||" | sort -u))
# Subtract files expected to differ (Red Bear patches + Cargo.toml).
# Build the same expected_differ set as above so the subtraction is
# consistent (Phase 2.4: previous logic used `find` on the patches
# dir which only got patch-file names, not their actual contents).
cd "$ROOT/$fork_dir"
patch_dir="$ROOT/local/patches/$fork_name"
patch_modified_files=()
if [ -d "$patch_dir" ]; then
while IFS= read -r pf; do
[ -z "$pf" ] && continue
while IFS= read -r f; do
[ -z "$f" ] && continue
f=$(echo "$f" | sed -E 's|^[ab]/||')
patch_modified_files+=("$f")
done < <(git apply --numstat "$patch_dir/$pf" 2>/dev/null | awk '{print $3}')
done < <(ls "$patch_dir" 2>/dev/null)
fi
patch_modified_files=($(printf '%s\n' "${patch_modified_files[@]}" | sort -u))
patch_modified_files+=("Cargo.toml" "Cargo.toml.orig")
# Phase 2.4: include common Red Bear-added subtrees that don't always
# appear in patch outputs (notably the installer GUI brought in
# via prior fork merges).
patch_modified_files+=("gui/Cargo.toml" "gui/Cargo.lock" "gui/.gitignore"
"gui/README.md" "gui/src/main.rs"
"gui/src/sys.rs" "gui/src/sys/linux.rs" "gui/src/sys/redox.rs")
# Per-fork declarative expected-differ list for forks whose
# local-patches/ dir is empty (no patch files) but the fork
# itself has legitimately diverged via direct commits.
case "$fork_name" in
libredox) patch_modified_files+=("src/lib.rs") ;; # F_DUPFD_CLOEXEC + AcpiVerb
esac
patch_modified_files=($(printf '%s\n' "${patch_modified_files[@]}" | sort -u))
local_non_patch=$(comm -23 <(echo "$only_local") <(printf '%s\n' "${patch_modified_files[@]}"))
if [ -n "$local_non_patch" ]; then
echo "ERROR: $fork_name has files that don't exist in upstream $upstream_tag:" >&2
echo "$local_non_patch" | sed 's/^/ /' | head -10 >&2
+1 -1
View File
@@ -1 +1 @@
../../../local/recipes/wayland/qt6-wayland-smoke
../../../../local/recipes/wayland/qt6-wayland-smoke