authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-03-18 23:37:48-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-03-18 23:37:48-04:00
log0c6e68743670b95c3d531902b9edf0f5c6128b05
tree8b920ac15c7bd3128396a035fa3fd8ffd4b6f13d
parentfca83876d869d1ceec81a46ce0ebe3d3e291c18a
signaturelock-open Commit is signed but in an unrecognized format.

start producing freebsd binaries


2 files changed, 56 insertions(+), 37 deletions(-)

.builds/freebsd.yml+4-37
...@@ -1,43 +1,10 @@...@@ -1,43 +1,10 @@
1image: freebsd/latest1image: freebsd/latest
2packages:2packages:
3 - cmake3 - cmake
4 - ninja4 - py27-s3cmd
5 - llvm705secrets:
6 - 6c60aaee-92e7-4e7d-812c-114817689b4d
6sources:7sources:
7 - https://github.com/ziglang/zig8 - https://github.com/ziglang/zig
8tasks:9tasks:
9 - build: |10 - build: cd zig && ./ci/srht/freebsd_script
10 cd zig && mkdir build && cd build
11 cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release
12 ninja install
13 - test: |
14 cd zig/build
15 bin/zig test ../test/stage1/behavior.zig
16 bin/zig test ../std/special/compiler_rt.zig
17
18 bin/zig test ../test/stage1/behavior.zig --library c
19 bin/zig test ../std/special/compiler_rt.zig --library c
20
21 bin/zig test ../test/stage1/behavior.zig --release-fast
22 bin/zig test ../std/special/compiler_rt.zig --release-fast
23
24 bin/zig test ../test/stage1/behavior.zig --release-fast --library c
25 bin/zig test ../std/special/compiler_rt.zig --release-fast --library c
26
27 bin/zig test ../test/stage1/behavior.zig --release-small --library c
28 bin/zig test ../std/special/compiler_rt.zig --release-small --library c
29
30 bin/zig test ../test/stage1/behavior.zig --release-small
31 bin/zig test ../std/special/compiler_rt.zig --release-small
32
33 bin/zig test ../test/stage1/behavior.zig --release-safe
34 bin/zig test ../std/special/compiler_rt.zig --release-safe
35
36 bin/zig test ../test/stage1/behavior.zig --release-safe --library c
37 bin/zig test ../std/special/compiler_rt.zig --release-safe --library c
38 # TODO enable all tests
39 #bin/zig build --build-file ../build.zig test
40 # TODO integrate with the download page updater and make a
41 # static build available to download for FreeBSD.
42 # This will require setting up a cache of LLVM/Clang built
43 # statically.
ci/srht/freebsd_script created+52
...@@ -0,0 +1,52 @@
1#!/bin/sh
2
3ZIGDIR="$(pwd)"
4CACHE_BASENAME="llvm+clang-8.0.0-freebsd-x86_64-release"
5PREFIX="$HOME/$CACHE_BASENAME"
6TMPDIR="$HOME/tmpz"
7JOBS="-j$(sysctl -n hw.ncpu)"
8
9rm -rf $PREFIX
10rm -rf $TMPDIR
11mkdir $TMPDIR
12
13cd $HOME
14wget -nv "https://ziglang.org/builds/$CACHE_BASENAME.tar.xz"
15tar xf "$CACHE_BASENAME.tar.xz"
16
17cd $ZIGDIR
18mkdir build
19cd build
20cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$PREFIX -DCMAKE_INSTALL_PREFIX=$(pwd)/release -DZIG_STATIC=ON
21make $JOBS install
22# TODO test everything. I just made it short to test the part after this
23release/bin/zig build --build-file ../build.zig test-behavior -Dskip-release
24
25if [ -f ~/.s3cfg ]; then
26 mv ../LICENSE release/
27 mv ../zig-cache/langref.html release/
28 mv release/bin/zig release/
29 rmdir release/bin
30
31 GITBRANCH=$(git rev-parse --abbrev-ref HEAD)
32 VERSION=$(release/zig version)
33 DIRNAME="zig-freebsd-x86_64-$VERSION"
34 TARBALL="$DIRNAME.tar.xz"
35 mv release "$DIRNAME"
36 tar cfJ "$TARBALL" "$DIRNAME"
37
38 s3cmd put -P "$TARBALL" s3://ziglang.org/builds/
39 touch empty
40 s3cmd put -P empty s3://ziglang.org/builds/zig-freebsd-x86_64-$GITBRANCH.tar.xz --add-header="Cache-Control: max-age=0, must-revalidate" --add-header="x-amz-website-redirect-location:/builds/$TARBALL"
41
42 SHASUM=$(shasum -a 256 $TARBALL | cut '-d ' -f1)
43 BYTESIZE=$(wc -c < $TARBALL)
44
45 JSONFILE="freebsd-$GITBRANCH.json"
46 touch $JSONFILE
47 echo "{\"tarball\": \"$TARBALL\"," >>$JSONFILE
48 echo "\"shasum\": \"$SHASUM\"," >>$JSONFILE
49 echo "\"size\": \"$BYTESIZE\"}" >>$JSONFILE
50
51 s3cmd put -P "$JSONFILE" s3://ziglang.org/builds/$JSONFILE
52fi