diff --git a/local/scripts/build-redbear.sh b/local/scripts/build-redbear.sh index 134170a889..cb39be8a1f 100755 --- a/local/scripts/build-redbear.sh +++ b/local/scripts/build-redbear.sh @@ -284,6 +284,15 @@ Configs: Environment: REDBEAR_RELEASE If set, builds from immutable release archives. Override to empty for development builds. + REDBEAR_SKIP_ABI_STALENESS=1 + Fast iteration: skip the relibc-consumer invalidation + churn so a rerun goes straight to the recipe you changed + (the cookbook cache still re-cooks changed sources). Safe + ONLY when relibc's ABI is unchanged. Unset it whenever you + bump relibc/base, or stale binaries may ship. + REDBEAR_FORCE_TOOLCHAIN_RECOOK=1 + Force a full re-cook of preserved toolchain packages + (llvm21/clang21/lld21/rust) on a relibc change. EOF } @@ -652,7 +661,7 @@ if [ "$NO_CACHE" != "1" ]; then done - if [ "$USERSPACE_RUNTIME_STALE" = "1" ]; then + if [ "$USERSPACE_RUNTIME_STALE" = "1" ] && [ "${REDBEAR_SKIP_ABI_STALENESS:-0}" != "1" ]; then echo ">>> Cleaning stale build/sysroot dirs (userspace-linked runtime changed)..." find "$PROJECT_ROOT/recipes" "$PROJECT_ROOT/local/recipes" \ \( -path "*/target/x86_64-unknown-redox/build" \ @@ -736,7 +745,17 @@ if [ "$NO_CACHE" != "1" ]; then find "$PROJECT_ROOT/recipes" "$PROJECT_ROOT/local/recipes" \ -path "*/$pkg/target" -type d -exec rm -rf {} + 2>/dev/null || true } - if [ "$relibc_rebuilding" = "1" ]; then + if [ "${REDBEAR_SKIP_ABI_STALENESS:-0}" = "1" ]; then + # Fast-iteration escape hatch: skip the entire relibc-consumer + # invalidation. Safe ONLY when relibc's ABI is unchanged (e.g. iterating + # on a single driver/app recipe). The cookbook's own BLAKE3 dep-hash + # cache still rebuilds recipes whose sources changed, so your edited + # package re-cooks while everything else stays cached — no 30-min churn + # to re-reach it. Unset to restore the stale-binary safety net (which is + # required whenever relibc/base actually changed). + echo ">>> REDBEAR_SKIP_ABI_STALENESS=1 — skipping relibc-consumer invalidation" + echo ">>> (fast iteration; assumes relibc ABI unchanged). Unset to restore it." + elif [ "$relibc_rebuilding" = "1" ]; then echo ">>> relibc is rebuilding — it is statically linked into every" echo ">>> userspace binary, so ALL packages are invalidated to force a" echo ">>> clean relink (correctness over speed; prevents stale-binary skew)."