From b1f874c78a847d591d9f14e67e181d5f3e5e7105 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Fri, 16 Dec 2022 00:42:21 +0100 Subject: [PATCH] enable testing for stage3 and stage4 being byte-for-byte identical --- ci/aarch64-macos.sh | 16 ++++++++++++++++ ci/x86_64-macos.sh | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/ci/aarch64-macos.sh b/ci/aarch64-macos.sh index 337c2bfa8e..2fe38f21a4 100755 --- a/ci/aarch64-macos.sh +++ b/ci/aarch64-macos.sh @@ -52,3 +52,19 @@ stage3-release/bin/zig build test docs \ # Produce the experimental std lib documentation. 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 \ + --prefix stage4-release \ + -Denable-llvm \ + -Dno-lib \ + -Drelease \ + -Dstrip \ + -Dtarget=$TARGET \ + -Duse-zig-libcxx \ + -Dversion-string="$(stage3-release/bin/zig version)" + +# diff returns an error code if the files differ. +echo "If the following command fails, it means nondeterminism has been" +echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." +diff stage3-release/bin/zig stage4-release/bin/zig diff --git a/ci/x86_64-macos.sh b/ci/x86_64-macos.sh index f09121ccd0..9d9cdb9d6f 100755 --- a/ci/x86_64-macos.sh +++ b/ci/x86_64-macos.sh @@ -60,3 +60,19 @@ stage3-release/bin/zig build test docs \ # Produce the experimental std lib documentation. 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 \ + --prefix stage4-release \ + -Denable-llvm \ + -Dno-lib \ + -Drelease \ + -Dstrip \ + -Dtarget=$TARGET \ + -Duse-zig-libcxx \ + -Dversion-string="$(stage3-release/bin/zig version)" + +# diff returns an error code if the files differ. +echo "If the following command fails, it means nondeterminism has been" +echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." +diff stage3-release/bin/zig stage4-release/bin/zig