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=<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)
This commit is contained in:
2026-06-18 09:34:16 +03:00
parent 79e242d539
commit d5ef14e689
+9 -1
View File
@@ -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