From 4ac665b2885cedbf88b5eba7faa69bb0e9ac38c0 Mon Sep 17 00:00:00 2001 From: vasilito Date: Sun, 12 Jul 2026 02:16:15 +0300 Subject: [PATCH] =?UTF-8?q?phase=202.4:=20boilerplate=20fixes=20=E2=80=94?= =?UTF-8?q?=20diverged=20mode=20+=20liibredox=20.gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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/' 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 --- .redbear-fork-verify/installer-0.2.42.files | 21 +++++++ .../installer-0.2.42.fingerprint | 1 + .redbear-fork-verify/libredox-0.1.18.files | 4 ++ .../libredox-0.1.18.fingerprint | 1 + local/fork-upstream-map.toml | 4 +- local/scripts/verify-fork-versions.sh | 61 ++++++++++++++++++- local/sources/relibc | 2 +- recipes/wip/wayland/qt6-wayland-smoke | 2 +- 8 files changed, 89 insertions(+), 7 deletions(-) create mode 100644 .redbear-fork-verify/installer-0.2.42.files create mode 100644 .redbear-fork-verify/installer-0.2.42.fingerprint create mode 100644 .redbear-fork-verify/libredox-0.1.18.files create mode 100644 .redbear-fork-verify/libredox-0.1.18.fingerprint diff --git a/.redbear-fork-verify/installer-0.2.42.files b/.redbear-fork-verify/installer-0.2.42.files new file mode 100644 index 0000000000..585d449de3 --- /dev/null +++ b/.redbear-fork-verify/installer-0.2.42.files @@ -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 diff --git a/.redbear-fork-verify/installer-0.2.42.fingerprint b/.redbear-fork-verify/installer-0.2.42.fingerprint new file mode 100644 index 0000000000..35be8a8ba7 --- /dev/null +++ b/.redbear-fork-verify/installer-0.2.42.fingerprint @@ -0,0 +1 @@ +ed6013c2953c7e2117bd2d1c9cfd13425cb59741 diff --git a/.redbear-fork-verify/libredox-0.1.18.files b/.redbear-fork-verify/libredox-0.1.18.files new file mode 100644 index 0000000000..5a12fcf37c --- /dev/null +++ b/.redbear-fork-verify/libredox-0.1.18.files @@ -0,0 +1,4 @@ +Cargo.toml +.gitignore +LICENSE +src/lib.rs diff --git a/.redbear-fork-verify/libredox-0.1.18.fingerprint b/.redbear-fork-verify/libredox-0.1.18.fingerprint new file mode 100644 index 0000000000..43b0ea69ec --- /dev/null +++ b/.redbear-fork-verify/libredox-0.1.18.fingerprint @@ -0,0 +1 @@ +bedf0129b9ad533c3c094b9648f4bac8936d7c99 diff --git a/local/fork-upstream-map.toml b/local/fork-upstream-map.toml index 3330db6296..cd19c75127 100644 --- a/local/fork-upstream-map.toml +++ b/local/fork-upstream-map.toml @@ -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 diff --git a/local/scripts/verify-fork-versions.sh b/local/scripts/verify-fork-versions.sh index ecb7488fa4..90ff05b07d 100755 --- a/local/scripts/verify-fork-versions.sh +++ b/local/scripts/verify-fork-versions.sh @@ -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 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 diff --git a/local/sources/relibc b/local/sources/relibc index fa54b985ff..f222c3464b 160000 --- a/local/sources/relibc +++ b/local/sources/relibc @@ -1 +1 @@ -Subproject commit fa54b985ff51a032b5f4ccf4d06dddb2a5062c99 +Subproject commit f222c3464b9ff94ef85129cdc08e2a80c4db0d02 diff --git a/recipes/wip/wayland/qt6-wayland-smoke b/recipes/wip/wayland/qt6-wayland-smoke index 0c08031da2..bb09824ab3 120000 --- a/recipes/wip/wayland/qt6-wayland-smoke +++ b/recipes/wip/wayland/qt6-wayland-smoke @@ -1 +1 @@ -../../../local/recipes/wayland/qt6-wayland-smoke \ No newline at end of file +../../../../local/recipes/wayland/qt6-wayland-smoke \ No newline at end of file