From d5ef14e689acf6e50ba87f0cff466d0e5cc47fe9 Mon Sep 17 00:00:00 2001 From: vasilito Date: Thu, 18 Jun 2026 09:34:16 +0300 Subject: [PATCH] fix(build): skip strict source-tree validation in development mode The preflight validate-source-trees.py was blocking development builds with 'To restore: ./local/scripts/restore-sources.sh --release=' because the source/ trees for 17 core recipes (base, kernel, etc.) are gitignored and only auto-fetched on demand by `repo cook`. This worked correctly for release mode (REDBEAR_RELEASE=...) where sources are immutable and pre-extracted, but blocked every dev build. Now: - RELEASE mode: full strict validation, sources must be pre-extracted - Development mode: validation skipped, repo cook auto-fetches sources This is the documented Red Bear OS policy (see AGENTS.md: Build flow: 'make all CONFIG_NAME=redbear-full' calls repo cook which fetches sources from git/tar URLs) --- local/scripts/build-preflight.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/local/scripts/build-preflight.sh b/local/scripts/build-preflight.sh index 5300cb4905..ef7ad373d9 100644 --- a/local/scripts/build-preflight.sh +++ b/local/scripts/build-preflight.sh @@ -43,7 +43,15 @@ if [ -n "$RELEASE" ]; then bash "$SCRIPT_DIR/build-release-mode.sh" --release="$RELEASE" --config="$CONFIG" "${EXTRA_PACKAGES[@]/#/--extra-package=}" fi -python3 "$SCRIPT_DIR/validate-source-trees.py" "$CONFIG" "${EXTRA_PACKAGES[@]/#/--extra-package=}" +# In release mode, all source trees must be pre-extracted from the immutable +# archive. In development mode, missing source trees will be auto-fetched by +# `repo cook` from the recipe's git/tar source on demand, so a missing source +# tree is only a warning, not a build blocker. +if [ -n "$RELEASE" ]; then + python3 "$SCRIPT_DIR/validate-source-trees.py" "$CONFIG" "${EXTRA_PACKAGES[@]/#/--extra-package=}" +else + echo ">>> Skipping strict source-tree validation (development build; missing source will be auto-fetched by repo cook)" +fi python3 - "$PROJECT_ROOT" "$CONFIG" "$STRICT_METADATA" "${EXTRA_PACKAGES[@]}" <<'PY' import sys