CI: test updating the wasm binary

Make sure that no commit regresses the ability to upgrade our wasm
binary. Otherwise, somebody in the future is going to have a Bad Day.
This commit is contained in:
Andrew Kelley 2022-12-07 19:27:35 -07:00
parent d69e97ae16
commit 83361e4a9b
4 changed files with 109 additions and 0 deletions

View File

@ -71,3 +71,30 @@ tidy --drop-empty-elements no -qe ../zig-cache/langref.html
# Produce the experimental std lib documentation. # Produce the experimental std lib documentation.
stage3-debug/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib stage3-debug/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
# Ensure that updating the wasm binary from this commit will result in a viable build.
stage3-debug/bin/zig build update-zig1
rm -rf ../build-new
mkdir ../build-new
cd ../build-new
export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
cmake .. \
-DCMAKE_PREFIX_PATH="$PREFIX" \
-DCMAKE_BUILD_TYPE=Debug \
-DZIG_TARGET_TRIPLE="$TARGET" \
-DZIG_TARGET_MCPU="$MCPU" \
-DZIG_STATIC=ON \
-GNinja
unset CC
unset CXX
ninja install
stage3/bin/zig test ../test/behavior.zig -I../test

View File

@ -71,3 +71,30 @@ tidy --drop-empty-elements no -qe ../zig-cache/langref.html
# Produce the experimental std lib documentation. # Produce the experimental std lib documentation.
stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
# Ensure that updating the wasm binary from this commit will result in a viable build.
stage3-release/bin/zig build update-zig1
rm -rf ../build-new
mkdir ../build-new
cd ../build-new
export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
cmake .. \
-DCMAKE_PREFIX_PATH="$PREFIX" \
-DCMAKE_BUILD_TYPE=Release \
-DZIG_TARGET_TRIPLE="$TARGET" \
-DZIG_TARGET_MCPU="$MCPU" \
-DZIG_STATIC=ON \
-GNinja
unset CC
unset CXX
ninja install
stage3/bin/zig test ../test/behavior.zig -I../test

View File

@ -70,3 +70,30 @@ tidy --drop-empty-elements no -qe ../zig-cache/langref.html
# Produce the experimental std lib documentation. # Produce the experimental std lib documentation.
stage3-debug/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib stage3-debug/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
# Ensure that updating the wasm binary from this commit will result in a viable build.
stage3-debug/bin/zig build update-zig1
rm -rf ../build-new
mkdir ../build-new
cd ../build-new
export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
cmake .. \
-DCMAKE_PREFIX_PATH="$PREFIX" \
-DCMAKE_BUILD_TYPE=Debug \
-DZIG_TARGET_TRIPLE="$TARGET" \
-DZIG_TARGET_MCPU="$MCPU" \
-DZIG_STATIC=ON \
-GNinja
unset CC
unset CXX
ninja install
stage3/bin/zig test ../test/behavior.zig -I../test

View File

@ -72,6 +72,7 @@ tidy --drop-empty-elements no -qe ../zig-cache/langref.html
# Produce the experimental std lib documentation. # Produce the experimental std lib documentation.
stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
# Ensure that stage3 and stage4 are byte-for-byte identical.
stage3-release/bin/zig build \ stage3-release/bin/zig build \
--prefix stage4-release \ --prefix stage4-release \
-Denable-llvm \ -Denable-llvm \
@ -86,3 +87,30 @@ stage3-release/bin/zig build \
echo "If the following command fails, it means nondeterminism has been" echo "If the following command fails, it means nondeterminism has been"
echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." echo "introduced, making stage3 and stage4 no longer byte-for-byte identical."
diff stage3-release/bin/zig stage4-release/bin/zig diff stage3-release/bin/zig stage4-release/bin/zig
# Ensure that updating the wasm binary from this commit will result in a viable build.
stage3-release/bin/zig build update-zig1
rm -rf ../build-new
mkdir ../build-new
cd ../build-new
export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
cmake .. \
-DCMAKE_PREFIX_PATH="$PREFIX" \
-DCMAKE_BUILD_TYPE=Release \
-DZIG_TARGET_TRIPLE="$TARGET" \
-DZIG_TARGET_MCPU="$MCPU" \
-DZIG_STATIC=ON \
-GNinja
unset CC
unset CXX
ninja install
stage3/bin/zig test ../test/behavior.zig -I../test