authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-11-03 17:48:05-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-11-04 20:33:37-07:00
loge9a12491f6fe5e38a05eeef0e920f2dec23634a4
treee2d8a5e26d8065fd7b0cd4e3722a6e01bd937844
parent8c4faa5f3f63cfbcfdc12cda7c37be1da642d2f6

CI: add stage3/stage4 determinism check

Makes sure that #12183 will not regress.

2 files changed, 36 insertions(+), 0 deletions(-)

ci/zinc/drone.yml+8
...@@ -35,10 +35,18 @@ steps:...@@ -35,10 +35,18 @@ steps:
35 commands:35 commands:
36 - ./ci/zinc/build_aarch64_macos36 - ./ci/zinc/build_aarch64_macos
3737
38- name: test_determinism
39 depends_on:
40 - test_stage3_release
41 image: ci/debian-amd64:11.1-12
42 commands:
43 - ./ci/zinc/linux_test_determinism
44
38- name: linux_package45- name: linux_package
39 depends_on:46 depends_on:
40 - test_stage3_debug47 - test_stage3_debug
41 - test_stage3_release48 - test_stage3_release
49 - test_determinism
42 when:50 when:
43 branch:51 branch:
44 - master52 - master
ci/zinc/linux_test_determinism created+28
...@@ -0,0 +1,28 @@
1#!/bin/sh
2
3set -x
4set -e
5
6DEPS_LOCAL="/deps/local"
7ZIG_PREFIX="$DRONE_WORKSPACE/_release/staging"
8VERSION=$($ZIG_PREFIX/bin/zig version)
9
10"$ZIG_PREFIX/bin/zig" build \
11 --prefix stage4 \
12 -Dconfig_h="build-release/config.h" \
13 -Denable-llvm \
14 -Denable-stage1 \
15 -Dno-lib \
16 -Drelease \
17 -Dstrip \
18 -Dtarget=x86_64-linux-musl \
19 -Duse-zig-libcxx \
20 -Dversion-string="$VERSION"
21
22# diff returns an error code if the files differ.
23echo "If the following command fails, it means nondeterminism has been"
24echo "introduced, making stage3 and stage4 no longer byte-for-byte identical."
25diff "$ZIG_PREFIX/bin/zig" "stage4/bin/zig"
26
27# Explicit exit helps show last command duration.
28exit