step7 and 8

This commit is contained in:
Motiejus Jakštys 2024-11-06 22:48:24 +02:00
parent d942dc7337
commit 6c20b6aee5
2 changed files with 103 additions and 7 deletions

View File

@ -0,0 +1,39 @@
From fb173ca3a0cd07789dbd7c71a8e9350eef630352 Mon Sep 17 00:00:00 2001
From: motiejus <foo@bar>
Date: Wed, 6 Nov 2024 20:42:27 +0000
Subject: [PATCH] 0.10.0-961-g54160e7f6a: CMakeLists.txt: remove stage3
---
CMakeLists.txt | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 997bfd51f6..4ea143bce7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -862,22 +862,3 @@ set(ZIG_BUILD_ARGS
"-Dcpu=${ZIG_TARGET_MCPU}"
"-Dversion-string=${RESOLVED_ZIG_VERSION}"
)
-
-add_custom_target(stage3 ALL
- COMMAND zig2 build compile ${ZIG_BUILD_ARGS}
- DEPENDS zig2
- COMMENT STATUS "Building stage3"
- WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
-)
-
-if(WIN32)
- set(ZIG_EXECUTABLE "${CMAKE_BINARY_DIR}/zig2.exe")
-else()
- set(ZIG_EXECUTABLE "${CMAKE_BINARY_DIR}/zig2")
-endif()
-
-install(CODE "set(ZIG_EXECUTABLE \"${ZIG_EXECUTABLE}\")")
-install(CODE "set(ZIG_BUILD_ARGS \"${ZIG_BUILD_ARGS}\")")
-install(CODE "set(CMAKE_INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}\")")
-install(CODE "set(CMAKE_SOURCE_DIR \"${CMAKE_SOURCE_DIR}\")")
-install(SCRIPT "${CMAKE_SOURCE_DIR}/cmake/install.cmake")
--
2.39.5

71
run
View File

@ -89,6 +89,22 @@ BUILTIN_TYPE_=0.10.0-851-gaac2d6b56f
REMOVE_BUILTIN_TYPE=2a5e1426aa9469fadb78e837d0100d689213b034 REMOVE_BUILTIN_TYPE=2a5e1426aa9469fadb78e837d0100d689213b034
REMOVE_BUILTIN_TYPE_=0.10.0-853-g2a5e1426aa REMOVE_BUILTIN_TYPE_=0.10.0-853-g2a5e1426aa
# commit 54160e7f6aecb4628df633ceaef4c6d956429a3d
# Author: Veikka Tuominen <git@vexu.eu>
# Date: 2022-12-21T14:33:02+02:00
#
# Sema: make overflow arithmetic builtins return tuples
BUILTINS_4TO2=54160e7f6aecb4628df633ceaef4c6d956429a3d
BUILTINS_4TO2_=0.10.0-961-g54160e7f6a
# commit 622311fb9ac7ee6d93dcb8cda4b608751f7e092a
# Author: Veikka Tuominen <git@vexu.eu>
# Date: 2022-12-21T16:40:30+02:00
#
# update uses of overflow arithmetic builtins
BUILTINS_4TO2_USES=622311fb9ac7ee6d93dcb8cda4b608751f7e092a
BUILTINS_4TO2_USES_=0.10.0-962-g622311fb9a
fullbuild() { fullbuild() {
rm -fr build rm -fr build
mkdir build mkdir build
@ -238,17 +254,58 @@ step6() {
echo "zig1.wasm updated for $TO_" echo "zig1.wasm updated for $TO_"
} }
step7() {
local FROM="$REMOVE_BUILTIN_TYPE"
local FROM_="$REMOVE_BUILTIN_TYPE_"
local TO="$BUILTINS_4TO2"
local TO_="$BUILTINS_4TO2_"
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_"
patch -p1 <"$HERE/0.10.0-961-g54160e7f6a-CMakeLists.txt-remove-stage3.patch"
cp ../zig-$FROM_/stage1/zig1.wasm stage1/zig1.wasm
fullbuild
build/zig2 build update-zig1
popd
}
}
step8() {
local FROM="$BUILTINS_4TO2"
local FROM_="$BUILTINS_4TO2_"
local TO="$BUILTINS_4TO2_USES"
local TO_="$BUILTINS_4TO2_USES_"
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
}
}
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
set -xeuo pipefail set -xeuo pipefail
step=${1:-step0} step=${1:-step0}
step=${step#step} step=${step#step}
# works: # works:
if [[ "$step" -le 00 ]] ; then step0; fi if [[ "$step" -le 0 ]] ; then step0; fi
if [[ "$step" -le 10 ]] ; then step1; fi if [[ "$step" -le 1 ]] ; then step1; fi
if [[ "$step" -le 20 ]] ; then step2; fi if [[ "$step" -le 2 ]] ; then step2; fi
if [[ "$step" -le 30 ]] ; then step3; fi if [[ "$step" -le 3 ]] ; then step3; fi
if [[ "$step" -le 40 ]] ; then step4; fi if [[ "$step" -le 4 ]] ; then step4; fi
if [[ "$step" -le 50 ]] ; then step5; fi if [[ "$step" -le 5 ]] ; then step5; fi
if [[ "$step" -le 60 ]] ; then step6; fi if [[ "$step" -le 6 ]] ; then step6; fi
if [[ "$step" -le 7 ]] ; then step7; fi
if [[ "$step" -le 8 ]] ; then step8; fi
fi fi