build: make verify-fork-functions honor 'diverged' mode like its sibling

verify-fork-versions.sh reads the 4th column of fork-upstream-map.toml
and skips the content check for forks marked 'diverged', with a WARN.
verify-fork-functions.sh had no notion of mode and hard-failed every
fork, so kernel (30), bootloader (5) and installer (2) blocked every
canonical build for drift the map itself records as accepted, with
comments saying a full rebase is later work.

Both verifiers now read the same source of truth. Diverged forks are
reported and counted as warnings; every other fork still gates. This
turned a 5-fork / 43-function hard failure into 2 real findings, which
are fixed in the accompanying relibc and base commits.
This commit is contained in:
2026-08-03 13:26:14 +03:00
parent 84a9872ab0
commit 7f2920f861
+22 -2
View File
@@ -64,6 +64,7 @@ if [[ ${#TARGET_FORKS[@]} -eq 0 ]]; then
fi
VIOLATIONS=0
DIVERGED_WARNINGS=0
TOTAL_MISSING=0
for fork in "${TARGET_FORKS[@]}"; do
@@ -78,6 +79,15 @@ for fork in "${TARGET_FORKS[@]}"; do
continue
fi
# Mode from the authoritative map (4th column), same source of truth as
# verify-fork-versions.sh. A fork marked 'diverged' has substantial
# post-fork work and is deliberately behind upstream master -- the map
# records for each one that a full rebase is later work. Its sibling
# verifier skips the content check for those forks with a WARN; this one
# used to hard-fail them, so kernel/bootloader/installer blocked every
# build for drift the project has already accepted. Report, do not gate.
fork_mode=$(awk -v f="$fork" '$1==f {print $4}' "$PROJECT_ROOT/local/fork-upstream-map.toml" 2>/dev/null | head -1)
# Determine upstream branch
upstream_branch="master"
if ! (cd "$fork_dir" && git rev-parse --verify upstream/master >/dev/null 2>&1); then
@@ -215,7 +225,14 @@ for fork in "${TARGET_FORKS[@]}"; do
echo " This likely means a bad merge or cherry-pick dropped them silently."
echo " Fix: ./local/scripts/upgrade-forks.sh $fork"
fi
VIOLATIONS=$((VIOLATIONS + 1))
if [[ "$fork_mode" == "diverged" ]]; then
echo " NOTE: $fork is 'diverged' in local/fork-upstream-map.toml —"
echo " reported as a warning, not a build gate. Rebasing it is"
echo " tracked work; see local/docs/FORK-BUMP-PATCHING-POLICY.md."
DIVERGED_WARNINGS=$((DIVERGED_WARNINGS + 1))
else
VIOLATIONS=$((VIOLATIONS + 1))
fi
elif [[ "$QUIET" -eq 0 ]]; then
echo -e "\033[1;32mOK: $fork — all upstream functions present\033[0m"
fi
@@ -227,5 +244,8 @@ if [[ "$VIOLATIONS" -gt 0 ]]; then
exit 1
fi
echo -e "\033[1;32mAll forks retain all upstream functions.\033[0m"
if [[ "${DIVERGED_WARNINGS:-0}" -gt 0 ]]; then
echo -e "\033[1;33m$DIVERGED_WARNINGS diverged fork(s) are behind upstream (warning only).\033[0m"
fi
echo -e "\033[1;32mAll gated forks retain all upstream functions.\033[0m"
exit 0