authorgravatar for michael.dusan@gmail.comMichael Dusan <michael.dusan@gmail.com> 2021-04-24 16:39:26-04:00
committergravatar for michael.dusan@gmail.comMichael Dusan <michael.dusan@gmail.com> 2021-04-25 00:02:36-04:00
log37b05742ff1544bccf7c8ae9b12c6707a5a54df2
tree2101c24314e42f751751b9d52b5e3709cbbf2812
parent6951889f6ede655d58b95a48bf052260e6a21d06

ci: drone disable debug test suite for aarch64

Temporary workaround for #8597 until upstream fix lands. - add `zig build -Dskip-debug` option - build a release-fast build.exe - disable test suite build modes { debug, release-small, release-safe } - enable passing test-* components - use parallel pipeline steps for tests

7 files changed, 168 insertions(+), 69 deletions(-)

build.zig+5-2
...@@ -44,6 +44,7 @@ pub fn build(b: *Builder) !void {...@@ -44,6 +44,7 @@ pub fn build(b: *Builder) !void {
4444
45 const fmt_build_zig = b.addFmt(&[_][]const u8{"build.zig"});45 const fmt_build_zig = b.addFmt(&[_][]const u8{"build.zig"});
4646
47 const skip_debug = b.option(bool, "skip-debug", "Main test suite skips debug builds") orelse false;
47 const skip_release = b.option(bool, "skip-release", "Main test suite skips release builds") orelse false;48 const skip_release = b.option(bool, "skip-release", "Main test suite skips release builds") orelse false;
48 const skip_release_small = b.option(bool, "skip-release-small", "Main test suite skips release-small builds") orelse skip_release;49 const skip_release_small = b.option(bool, "skip-release-small", "Main test suite skips release-small builds") orelse skip_release;
49 const skip_release_fast = b.option(bool, "skip-release-fast", "Main test suite skips release-fast builds") orelse skip_release;50 const skip_release_fast = b.option(bool, "skip-release-fast", "Main test suite skips release-fast builds") orelse skip_release;
...@@ -237,8 +238,10 @@ pub fn build(b: *Builder) !void {...@@ -237,8 +238,10 @@ pub fn build(b: *Builder) !void {
237238
238 var chosen_modes: [4]builtin.Mode = undefined;239 var chosen_modes: [4]builtin.Mode = undefined;
239 var chosen_mode_index: usize = 0;240 var chosen_mode_index: usize = 0;
240 chosen_modes[chosen_mode_index] = builtin.Mode.Debug;241 if (!skip_debug) {
241 chosen_mode_index += 1;242 chosen_modes[chosen_mode_index] = builtin.Mode.Debug;
243 chosen_mode_index += 1;
244 }
242 if (!skip_release_safe) {245 if (!skip_release_safe) {
243 chosen_modes[chosen_mode_index] = builtin.Mode.ReleaseSafe;246 chosen_modes[chosen_mode_index] = builtin.Mode.ReleaseSafe;
244 chosen_mode_index += 1;247 chosen_mode_index += 1;
ci/drone/drone.yml+33-2
...@@ -6,7 +6,38 @@ platform:...@@ -6,7 +6,38 @@ platform:
6 arch: arm646 arch: arm64
77
8steps:8steps:
9- name: build-and-test9- name: build
10 image: ziglang/static-base:llvm12-aarch64-1
11 commands:
12 - ./ci/drone/linux_script_build
13
14- name: test-1
15 depends_on:
16 - build
17 image: ziglang/static-base:llvm12-aarch64-1
18 commands:
19 - ./ci/drone/linux_script_test 1
20
21- name: test-2
22 depends_on:
23 - build
24 image: ziglang/static-base:llvm12-aarch64-1
25 commands:
26 - ./ci/drone/linux_script_test 2
27
28- name: test-3
29 depends_on:
30 - build
31 image: ziglang/static-base:llvm12-aarch64-1
32 commands:
33 - ./ci/drone/linux_script_test 3
34
35- name: finalize
36 depends_on:
37 - build
38 - test-1
39 - test-2
40 - test-3
10 image: ziglang/static-base:llvm12-aarch64-141 image: ziglang/static-base:llvm12-aarch64-1
11 environment:42 environment:
12 SRHT_OAUTH_TOKEN:43 SRHT_OAUTH_TOKEN:
...@@ -16,4 +47,4 @@ steps:...@@ -16,4 +47,4 @@ steps:
16 AWS_SECRET_ACCESS_KEY:47 AWS_SECRET_ACCESS_KEY:
17 from_secret: AWS_SECRET_ACCESS_KEY48 from_secret: AWS_SECRET_ACCESS_KEY
18 commands:49 commands:
19 - ./ci/drone/linux_script50 - ./ci/drone/linux_script_finalize
ci/drone/linux_script deleted-65
...@@ -1,65 +0,0 @@
1#!/bin/sh
2
3set -x
4set -e
5
6TRIPLEARCH="$(uname -m)"
7BUILDDIR="$(pwd)"
8DISTDIR="$(pwd)/dist"
9
10apk update
11apk add py3-pip xz perl-utils jq curl samurai
12pip3 install s3cmd
13
14# Make the `zig version` number consistent.
15# This will affect the cmake command below.
16git config core.abbrev 9
17git fetch --unshallow || true
18git fetch --tags
19
20mkdir build
21cd build
22cmake .. -DCMAKE_BUILD_TYPE=Release "-DCMAKE_INSTALL_PREFIX=$DISTDIR" -DZIG_STATIC=ON -DCMAKE_PREFIX_PATH=/deps/local -GNinja
23
24samu install
25# run-translated-c tests are skipped due to: https://github.com/ziglang/zig/issues/8537
26./zig build test \
27 -Dskip-release \
28 -Dskip-non-native \
29 -Dskip-compile-errors \
30 -Dskip-run-translated-c
31
32if [ -z "$DRONE_PULL_REQUEST" ]; then
33 mv ../LICENSE "$DISTDIR/"
34 mv ../zig-cache/langref.html "$DISTDIR/"
35 mv "$DISTDIR/bin/zig" "$DISTDIR/"
36 rmdir "$DISTDIR/bin"
37
38 GITBRANCH="$DRONE_BRANCH"
39 VERSION="$("$DISTDIR/zig" version)"
40 DIRNAME="zig-linux-$TRIPLEARCH-$VERSION"
41 TARBALL="$DIRNAME.tar.xz"
42 mv "$DISTDIR" "$DIRNAME"
43 tar cfJ "$TARBALL" "$DIRNAME"
44
45 s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/
46
47 SHASUM=$(shasum -a 256 $TARBALL | cut '-d ' -f1)
48 BYTESIZE=$(wc -c < $TARBALL)
49
50 JSONFILE="$TRIPLEARCH-linux-$GITBRANCH.json"
51 touch $JSONFILE
52 echo "{\"tarball\": \"$TARBALL\"," >>$JSONFILE
53 echo "\"shasum\": \"$SHASUM\"," >>$JSONFILE
54 echo "\"size\": \"$BYTESIZE\"}" >>$JSONFILE
55
56 s3cmd put -P --add-header="Cache-Control: max-age=0, must-revalidate" "$JSONFILE" "s3://ziglang.org/builds/$JSONFILE"
57 s3cmd put -P "$JSONFILE" "s3://ziglang.org/builds/$TRIPLEARCH-linux-$VERSION.json"
58 if [ "$GITBRANCH" = "master" ]; then
59 # avoid leaking oauth token
60 set +x
61
62 cd "$BUILDDIR"
63 ./ci/srht/on_master_success "$VERSION" "$SRHT_OAUTH_TOKEN"
64 fi
65fi
ci/drone/linux_script_base created+22
...@@ -0,0 +1,22 @@
1#!/bin/sh
2
3# https://docs.drone.io/pipeline/docker/syntax/workspace/
4#
5# Drone automatically creates a temporary volume, known as your workspace,
6# where it clones your repository. The workspace is the current working
7# directory for each step in your pipeline.
8#
9# Because the workspace is a volume, filesystem changes are persisted between
10# pipeline steps. In other words, individual steps can communicate and share
11# state using the filesystem.
12#
13# Workspace volumes are ephemeral. They are created when the pipeline starts
14# and destroyed after the pipeline completes.
15
16set -x
17set -e
18
19TRIPLEARCH="$(uname -m)"
20DISTDIR="$DRONE_WORKSPACE/dist"
21
22export ZIG_GLOBAL_CACHE_DIR="$DRONE_WORKSPACE/zig-cache"
ci/drone/linux_script_build created+18
...@@ -0,0 +1,18 @@
1#!/bin/sh
2
3. ./ci/drone/linux_script_base
4
5apk update
6apk add samurai
7
8# Make the `zig version` number consistent.
9# This will affect the cmake command below.
10git config core.abbrev 9
11git fetch --unshallow || true
12git fetch --tags
13
14mkdir build
15cd build
16cmake .. -DCMAKE_BUILD_TYPE=Release "-DCMAKE_INSTALL_PREFIX=$DISTDIR" -DZIG_STATIC=ON -DCMAKE_PREFIX_PATH=/deps/local -GNinja
17
18samu install
ci/drone/linux_script_finalize created+46
...@@ -0,0 +1,46 @@
1#!/bin/sh
2
3. ./ci/drone/linux_script_base
4
5if [ -n "$DRONE_PULL_REQUEST" ]; then
6 exit 0
7fi
8
9apk update
10apk add py3-pip xz perl-utils jq curl samurai
11pip3 install s3cmd
12
13cd build
14
15mv ../LICENSE "$DISTDIR/"
16# docs are disabled due to: https://github.com/ziglang/zig/issues/8597
17#mv ../zig-cache/langref.html "$DISTDIR/"
18mv "$DISTDIR/bin/zig" "$DISTDIR/"
19rmdir "$DISTDIR/bin"
20
21GITBRANCH="$DRONE_BRANCH"
22VERSION="$("$DISTDIR/zig" version)"
23DIRNAME="zig-linux-$TRIPLEARCH-$VERSION"
24TARBALL="$DIRNAME.tar.xz"
25mv "$DISTDIR" "$DIRNAME"
26tar cfJ "$TARBALL" "$DIRNAME"
27
28s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/
29
30SHASUM=$(shasum -a 256 $TARBALL | cut '-d ' -f1)
31BYTESIZE=$(wc -c < $TARBALL)
32
33JSONFILE="tarball.json"
34touch $JSONFILE
35echo "{\"tarball\": \"$TARBALL\"," >>$JSONFILE
36echo "\"shasum\": \"$SHASUM\"," >>$JSONFILE
37echo "\"size\": \"$BYTESIZE\"}" >>$JSONFILE
38
39s3cmd put -P "$JSONFILE" "s3://ziglang.org/builds/$TRIPLEARCH-linux-$VERSION.json"
40if [ "$GITBRANCH" = "master" ]; then
41 # avoid leaking oauth token
42 set +x
43
44 cd "$DRONE_WORKSPACE"
45 ./ci/srht/on_master_success "$VERSION" "$SRHT_OAUTH_TOKEN"
46fi
ci/drone/linux_script_test created+44
...@@ -0,0 +1,44 @@
1#!/bin/sh
2
3. ./ci/drone/linux_script_base
4
5# only release-fast builds of test suite due to: https://github.com/ziglang/zig/issues/8597
6#
7# Some test suite components will be missing because they do not support
8# forcing -OReleaseFast
9#
10# see `zig build --help` for the full list of test-* components
11case "$1" in
12 1)
13 steps="\
14 test-stage2 \
15 test-fmt \
16 test-behavior"
17 ;;
18 2)
19 steps="test-std"
20 ;;
21 3)
22 steps="\
23 test-compiler-rt \
24 test-minilibc \
25 test-compare-output"
26 ;;
27 '')
28 echo "error: expecting test group argument"
29 exit 1
30 ;;
31 *)
32 echo "error: unknown test group: $1"
33 exit 1
34 ;;
35esac
36
37# only release-fast builds of test suite due to: https://github.com/ziglang/zig/issues/8597
38./build/zig build \
39 -Drelease \
40 -Dskip-debug \
41 -Dskip-release-small \
42 -Dskip-release-safe \
43 -Dskip-non-native \
44 $steps