run: allow passing an intermediate stage

This commit is contained in:
Motiejus Jakštys 2024-11-06 17:02:45 +02:00
parent 2305f1030e
commit 1a703be634

36
run
View File

@ -196,11 +196,37 @@ step40() {
echo "zig1.wasm updated for $TO_"
}
step50() {
local FROM="$CALL_USAGES"
local FROM_="$CALL_USAGES_"
local TO="$BUILTIN_TYPE"
local TO_="$BUILTIN_TYPE_"
echo "Updating zig1.wasm from $FROM_ -> $TO_ in ../zig-$TO_"
rm -fr "../zig-$TO_"
git archive --prefix=zig-$TO_/ $TO | tar -C .. -x
{
pushd "../zig-$TO_"
cp ../zig-$FROM_/stage1/zig1.wasm stage1/zig1.wasm
fullbuild
build/stage3/bin/zig build update-zig1
popd
}
echo "zig1.wasm updated for $TO_"
}
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
set -xeuo pipefail
step00
step10
step20
step30
step40
step=${1:-step00}
step=${step#step}
# works:
if [[ "$step" -le 00 ]] ; then step00; fi
if [[ "$step" -le 10 ]] ; then step10; fi
if [[ "$step" -le 20 ]] ; then step20; fi
if [[ "$step" -le 30 ]] ; then step30; fi
if [[ "$step" -le 40 ]] ; then step40; fi
# does not work:
if [[ "$step" -le 50 ]] ; then step50; fi
fi