| author | |
| committer | |
| log | 05cd8936c885d2b538091eb814724472c73ec8b8 |
| tree | 1e8c31188f041dc68309efd9993b1e401f4acde9 |
| parent | 16c5cbab0c414852bf8b911ed6efdf4ceeac9600 |
3 files changed, 50 insertions(+), 9 deletions(-)
ci/drone/drone.yml+5-5| ... | @@ -7,28 +7,28 @@ platform: | ... | @@ -7,28 +7,28 @@ platform: |
| 7 | 7 | ||
| 8 | steps: | 8 | steps: |
| 9 | - name: build | 9 | - name: build |
| 10 | image: ziglang/static-base:llvm12-aarch64-3 | 10 | image: ziglang/static-base:llvm12-aarch64-5 |
| 11 | commands: | 11 | commands: |
| 12 | - ./ci/drone/linux_script_build | 12 | - ./ci/drone/linux_script_build |
| 13 | 13 | ||
| 14 | - name: test-1 | 14 | - name: test-1 |
| 15 | depends_on: | 15 | depends_on: |
| 16 | - build | 16 | - build |
| 17 | image: ziglang/static-base:llvm12-aarch64-3 | 17 | image: ziglang/static-base:llvm12-aarch64-5 |
| 18 | commands: | 18 | commands: |
| 19 | - ./ci/drone/linux_script_test 1 | 19 | - ./ci/drone/linux_script_test 1 |
| 20 | 20 | ||
| 21 | - name: test-2 | 21 | - name: test-2 |
| 22 | depends_on: | 22 | depends_on: |
| 23 | - build | 23 | - build |
| 24 | image: ziglang/static-base:llvm12-aarch64-3 | 24 | image: ziglang/static-base:llvm12-aarch64-5 |
| 25 | commands: | 25 | commands: |
| 26 | - ./ci/drone/linux_script_test 2 | 26 | - ./ci/drone/linux_script_test 2 |
| 27 | 27 | ||
| 28 | - name: test-3 | 28 | - name: test-3 |
| 29 | depends_on: | 29 | depends_on: |
| 30 | - build | 30 | - build |
| 31 | image: ziglang/static-base:llvm12-aarch64-3 | 31 | image: ziglang/static-base:llvm12-aarch64-5 |
| 32 | commands: | 32 | commands: |
| 33 | - ./ci/drone/linux_script_test 3 | 33 | - ./ci/drone/linux_script_test 3 |
| 34 | 34 | ||
| ... | @@ -38,7 +38,7 @@ steps: | ... | @@ -38,7 +38,7 @@ steps: |
| 38 | - test-1 | 38 | - test-1 |
| 39 | - test-2 | 39 | - test-2 |
| 40 | - test-3 | 40 | - test-3 |
| 41 | image: ziglang/static-base:llvm12-aarch64-3 | 41 | image: ziglang/static-base:llvm12-aarch64-5 |
| 42 | environment: | 42 | environment: |
| 43 | SRHT_OAUTH_TOKEN: | 43 | SRHT_OAUTH_TOKEN: |
| 44 | from_secret: SRHT_OAUTH_TOKEN | 44 | from_secret: SRHT_OAUTH_TOKEN |
ci/drone/linux_script_build+44-3| ... | @@ -2,8 +2,30 @@ | ... | @@ -2,8 +2,30 @@ |
| 2 | 2 | ||
| 3 | . ./ci/drone/linux_script_base | 3 | . ./ci/drone/linux_script_base |
| 4 | 4 | ||
| 5 | apk update | 5 | PREFIX="/deps/local" |
| 6 | apk add samurai | 6 | ZIG="$PREFIX/bin/zig" |
| 7 | TARGET="$TRIPLEARCH-linux-musl" | ||
| 8 | MCPU="baseline" | ||
| 9 | |||
| 10 | export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" | ||
| 11 | export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" | ||
| 12 | |||
| 13 | # The `CMAKE_AR` parameter will consider any spaces to | ||
| 14 | # be part of the executable path rather than CLI args, so we have | ||
| 15 | # to create wrapper scripts for `zig ar` and zig ranlib`. | ||
| 16 | |||
| 17 | cat <<'ENDFILE' >$PREFIX/bin/ar | ||
| 18 | #!/bin/sh | ||
| 19 | /deps/local/bin/zig ar $@ | ||
| 20 | ENDFILE | ||
| 21 | |||
| 22 | cat <<'ENDFILE' >$PREFIX/bin/ranlib | ||
| 23 | #!/bin/sh | ||
| 24 | /deps/local/bin/zig ranlib $@ | ||
| 25 | ENDFILE | ||
| 26 | |||
| 27 | chmod +x $PREFIX/bin/ar | ||
| 28 | chmod +x $PREFIX/bin/ranlib | ||
| 7 | 29 | ||
| 8 | # Make the `zig version` number consistent. | 30 | # Make the `zig version` number consistent. |
| 9 | # This will affect the cmake command below. | 31 | # This will affect the cmake command below. |
| ... | @@ -13,6 +35,25 @@ git fetch --tags | ... | @@ -13,6 +35,25 @@ git fetch --tags |
| 13 | 35 | ||
| 14 | mkdir build | 36 | mkdir build |
| 15 | cd build | 37 | cd build |
| 16 | cmake .. -DCMAKE_BUILD_TYPE=Release "-DCMAKE_INSTALL_PREFIX=$DISTDIR" -DZIG_STATIC=ON -DCMAKE_PREFIX_PATH=/deps/local -GNinja | 38 | cmake .. \ |
| 39 | -DCMAKE_INSTALL_PREFIX="$DISTDIR" \ | ||
| 40 | -DCMAKE_PREFIX_PATH="$PREFIX" \ | ||
| 41 | -DCMAKE_BUILD_TYPE=Release \ | ||
| 42 | -DCMAKE_AR="$PREFIX/bin/ar" \ | ||
| 43 | -DCMAKE_RANLIB="$PREFIX/bin/ranlib" \ | ||
| 44 | -DZIG_TARGET_TRIPLE="$TARGET" \ | ||
| 45 | -DZIG_TARGET_MCPU="$MCPU" \ | ||
| 46 | -DZIG_STATIC=ON \ | ||
| 47 | -GNinja | ||
| 48 | |||
| 49 | # Now CMake will use Zig as the C/C++ compiler. We reset the environment variables | ||
| 50 | # so that installation and testing do not get affected by them. | ||
| 51 | unset CC | ||
| 52 | unset CXX | ||
| 53 | samu install | ||
| 17 | 54 | ||
| 55 | # Here we rebuild Zig but this time using the Zig binary we just now produced to | ||
| 56 | # build zig1.o rather than relying on the one built with stage0. See | ||
| 57 | # https://github.com/ziglang/zig/issues/6830 for more details. | ||
| 58 | cmake .. -DZIG_EXECUTABLE="$DISTDIR/bin/zig" | ||
| 18 | samu install | 59 | samu install |
ci/drone/linux_script_finalize+1-1| ... | @@ -7,7 +7,7 @@ if [ -n "$DRONE_PULL_REQUEST" ]; then | ... | @@ -7,7 +7,7 @@ if [ -n "$DRONE_PULL_REQUEST" ]; then |
| 7 | fi | 7 | fi |
| 8 | 8 | ||
| 9 | apk update | 9 | apk update |
| 10 | apk add py3-pip xz perl-utils jq curl samurai | 10 | apk add py3-pip perl-utils jq curl |
| 11 | pip3 install s3cmd | 11 | pip3 install s3cmd |
| 12 | 12 | ||
| 13 | cd build | 13 | cd build |