diff --git a/.builds/netbsd.yml b/.builds/netbsd.yml new file mode 100644 index 000000000000..69395b5e053b --- /dev/null +++ b/.builds/netbsd.yml @@ -0,0 +1,8 @@ +image: netbsd/latest +secrets: + - 51bfddf5-86a6-4e01-8576-358c72a4a0a4 + - 5cfede76-914e-4071-893e-e5e2e6ae3cea +sources: + - https://github.com/ziglang/zig +tasks: + - build: cd zig && ./ci/srht/netbsd_script diff --git a/ci/srht/index.html b/ci/srht/index.html deleted file mode 100644 index b1fa1af3c2ba..000000000000 --- a/ci/srht/index.html +++ /dev/null @@ -1,737 +0,0 @@ - - - - - Releases ⚡ The Zig Programming Language - - - - -
- -
- -
-

Releases

-

You can also - install Zig from a package manager. -

-

- There is a JSON version of this page. -

- -

master

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameKindSizeSha256
{{SRC_TARBALL}}Source{{SRC_BYTESIZE}}{{SRC_SHASUM}}
{{X86_64_LINUX_TARBALL}}Binary{{X86_64_LINUX_BYTESIZE}}{{X86_64_LINUX_SHASUM}}
{{AARCH64_LINUX_TARBALL}}Binary{{AARCH64_LINUX_BYTESIZE}}{{AARCH64_LINUX_SHASUM}}
{{X86_64_WINDOWS_TARBALL}}Binary{{X86_64_WINDOWS_BYTESIZE}}{{X86_64_WINDOWS_SHASUM}}
{{X86_64_MACOS_TARBALL}}Binary{{X86_64_MACOS_BYTESIZE}}{{X86_64_MACOS_SHASUM}}
{{AARCH64_MACOS_TARBALL}}Binary{{AARCH64_MACOS_BYTESIZE}}{{AARCH64_MACOS_SHASUM}}
{{X86_64_FREEBSD_TARBALL}}Binary{{X86_64_FREEBSD_BYTESIZE}}{{X86_64_FREEBSD_SHASUM}}
- -

0.7.1

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameKindSizeSha256
zig-0.7.1.tar.xzSource11MiB2db3b944ab368d955b48743d9f7c963b8f96de1a441ba5a35e197237cc6dae44
zig-bootstrap-0.7.1.tar.xzSource39MiB040f27c1fae4b0cac0a2782aecdb691f6a2f8e89db6a6ed35024c31c304fd9b2
zig-freebsd-x86_64-0.7.1.tar.xzBinary38MiBe73c1dca35791a3183fdd5ecde0443ebbe180942efceafe651886034fb8def09
zig-linux-aarch64-0.7.1.tar.xzBinary33MiB48ec90eba407e4587ddef7eecef25fec7e13587eb98e3b83c5f2f5fff2a5cbe7
zig-linux-armv7a-0.7.1.tar.xzBinary35MiB5a0662e07b4c4968665e1f97558f8591f6facec45d2e0ff5715e661743107ceb
zig-linux-i386-0.7.1.tar.xzBinary38MiB4882e052e5f83690bd0334bb4fc1702b5403cb3a3d2aa63fd7d6043d8afecba3
zig-linux-riscv64-0.7.1.tar.xzBinary36MiB187294bfd35983348c3fe042901b42e67e7e36ab7f77a5f969d21c0051f4d21f
zig-linux-x86_64-0.7.1.tar.xzBinary37MiB18c7b9b200600f8bcde1cd8d7f1f578cbc3676241ce36d771937ce19a8159b8d
zig-macos-x86_64-0.7.1.tar.xzBinary35MiB845cb17562978af0cf67e3993f4e33330525eaf01ead9386df9105111e3bc519
zig-windows-i386-0.7.1.zipBinary52MiBa1b9a7421e13153e07fd2e2c93ff29aad64d83105b8fcdafa633dbe689caf1c0
zig-windows-x86_64-0.7.1.zipBinary53MiB4818a8a65b4672bc52c0ae7f14d014e0eb8caf10f12c0745176820384cea296a
- -

0.7.0

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameKindSizeSha256
zig-0.7.0.tar.xzSource11MiB0efd2cf6c3b05723db80e9cf193bc55150bba84ca41f855a90f53fc756445f83
zig-bootstrap-0.7.0.tar.xzSource39MiBf073beaf5c53c8c57c0d374cbfcb332ef92ad703173edba0d9e0f2ed28401b72
zig-freebsd-x86_64-0.7.0.tar.xzBinary34MiBa0c926272ee4ae720034b4a6a1dc98399d76156dd84182554740f0ca8a41fc99
zig-linux-aarch64-0.7.0.tar.xzBinary32MiBf89933bac87d44be82325754ff88423020c81c7032a6fc41cfeb81e982eeab9b
zig-linux-armv7a-0.7.0.tar.xzBinary34MiB011c267e25a96ee160505a560c441daa045359a9d50e13ab1bada9d75c95db2d
zig-linux-i386-0.7.0.tar.xzBinary37MiB4bb2072cd363bcb1cbeb4872ff5cbc1f683b02d0cc1f90c46e3ea7422ce53222
zig-linux-riscv64-0.7.0.tar.xzBinary36MiB40dff81faa6f232ac40abbf88b9371f3cc932b6e09c423b94387c9ea580cb7be
zig-linux-x86_64-0.7.0.tar.xzBinary36MiBe619b1c6094c095b932767f527aee2507f847ea981513ff8a08aab0fd730e0ac
zig-macos-aarch64-0.7.0.tar.xzBinary33MiB338238035734db74ea4f30e500a4893bf741d38305c10952d5e39fa05bdb057d
zig-macos-x86_64-0.7.0.tar.xzBinary35MiB94063f9a311cbbf7a2e0a12295e09437182cf950f18cb0eb30ea9893f3677f24
zig-windows-i386-0.7.0.zipBinary51MiBb1e520aacbfbd645ff3521b3eb4d44166d9a0288b8725e4b001f8b50a425eb2e
zig-windows-x86_64-0.7.0.zipBinary52MiB965f56c0a36f9cda2125e3a348bc654f7f155e2804c3667d231775ec228f8553
- -

0.6.0

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameKindSizeSha256
zig-0.6.0.tar.xzSource9.9MiB5d167dc19354282dd35dd17b38e99e1763713b9be8a4ba9e9e69284e059e7204
zig-bootstrap-0.6.0.tar.xzSource36.7MiB5e0e4dc878b3dd0c1852a442b174f0732e8c07869a8fcd226b71a93b89b381ab
zig-freebsd-x86_64-0.6.0.tar.xzBinary36MiB190ff79c1eb56805a315d7c7a51082e32f62926250c0702b36760c225e1634a3
zig-linux-aarch64-0.6.0.tar.xzBinary36MiBe7520efd42cfa02be48c2e430d08fe1f3cbb999d21d9f0d3ffd0febb976b2f41
zig-linux-armv6kz-0.6.0.tar.xzBinary38MiB36b6493b3fed43eb1f0000e765798ad31a6bb7d7fd3f553ac1c3761dbc919b82
zig-linux-armv7a-0.6.0.tar.xzBinary38MiB946969abe357def95ca9cbbfcebfcf2d90cf967bcd3f48ee87662e32d91d8f35
zig-linux-i386-0.6.0.tar.xzBinary43MiBa97a2f9ae21575743cdd763c1917d49400d83fc562ef64582b18bade43eb24ce
zig-linux-riscv64-0.6.0.tar.xzBinary41MiB68ddee43f7503c8ae5f26a921f3602c34719a02ed2241f528c0b8b888cc14b38
zig-linux-x86_64-0.6.0.tar.xzBinary43MiB08fd3c757963630645441c2772362e9c2294020c44f14fce1b89f45de0dc1253
zig-macos-x86_64-0.6.0.tar.xzBinary41MiB17270360e87ddc49f737e760047b2fac49f1570a824a306119b1194ac4093895
zig-windows-i386-0.6.0.zipBinary58MiB3b0a02618743e92175990dc6d1a787bb95ff62c4cda016f1c14c7786f575f8ca
zig-windows-x86_64-0.6.0.zipBinary47MiBc3b897832523e1026e10b2d8d55d7f895185c0a27a63681f3a23219c3f1c38f4
- -

0.5.0

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameKindSizeSha256
zig-0.5.0.tar.xzSource10.4MiB55ae16960f152bcb9cf98b4f8570902d0e559a141abf927f0d3555b7cc838a31
zig-linux-x86_64-0.5.0.tar.xzBinary39.0MiB43e8f8a8b8556edd373ddf9c1ef3ca6cf852d4d09fe07d5736d12fefedd2b4f7
zig-windows-x86_64-0.5.0.zipBinary42.8MiB58141323db8d84a5af62746be5f9140bc161ee760ef33dc91a887bf9ac021976
zig-macos-x86_64-0.5.0.tar.xzBinary36.1MiB28702cc05745c7c0bd450487d5f4091bf0a1ad279b35eb9a640ce3e3a15b300d
zig-freebsd-x86_64-0.5.0.tar.xzBinary32.1MiB9e1f4d36c3d584c0aa01f20eb4cd0a0eef3eee5af23e483b8414de55feab6ab6
- -

0.4.0

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameKindSizeSha256
zig-0.4.0.tar.xzSource5.1MiBfec1f3f6b359a3d942e0a7f9157b3b30cde83927627a0e1ea95c54de3c526cfc
zig-linux-x86_64-0.4.0.tar.xzBinary31.4MiBfb1954e2fb556a01f8079a08130e88f70084e08978ff853bb2b1986d8c39d84e
zig-windows-x86_64-0.4.0.zipBinary34.1MiBfbc3dd205e064c263063f69f600bedb18e3d0aa2efa747a63ef6cafb6d73f127
zig-macos-x86_64-0.4.0.tar.xzBinary29.4MiB67c932982484d017c5111e54af9f33f15e8e05c6bc5346a55e04052159c964a8
zig-freebsd-x86_64-0.4.0.tar.xzBinary26.0MiB3d557c91ac36d8262eb1733bb5f261c95944f9b635e43386e3d00a3272818c30
- -

0.3.0

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameKindSizeSha256
zig-0.3.0.tar.xzSource2.2MiBd70af604f3a8622f3393d93abb3e056bf60351e32d121e6fa4fe03d8d41e1f5a
zig-linux-x86_64-0.3.0.tar.xzBinary24.0MiBb378d0aae30cb54f28494e7bc4efbc9bfb6326f47bfb302e8b5287af777b2f3c
zig-windows-x86_64-0.3.0.zipBinary21.5MiBbb568c03950958f8bb3472139c3ab5ed74547c8c694ab50f404c202faf51baf4
zig-macos-x86_64-0.3.0.tar.xzBinary22.6MiB19dec1f1943ab7be26823376d466f7e456143deb34e17502778a949034dc2e7e
- -

0.2.0

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameKindSizeSha256
zig-0.2.0.tar.xzSource1.9MiB29c9beb172737f4d5019b88ceae829ae8bc6512fb4386cfbf895ae2b42aa6965
zig-linux-x86_64-0.2.0.tar.xzBinary23.5MiB209c6fb745d42474c0a73d6f291c7ae3a38b6a1b6b641eea285a7f840cc1a890
zig-win64-0.2.0.zipBinary20.6MiB4f8a2979941a1f081ec8e545cca0b72608c0db1c5a3fd377a94db40649dcd3d4
- -

0.1.1

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameKindSizeSha256
zig-0.1.1.tar.xzSource1.62MiBffca0cfb263485287e19cc997b08701fcd5f24b700345bcdc3dd8074f5a104e0
zig-win64-0.1.1.zipBinary19.3MiB6fc88bef531af7e567fe30bf60da1487b86833cbee84c7a2f3e317030aa5b660
-
- - diff --git a/ci/srht/index.json b/ci/srht/index.json index 5c5b8ab88263..32eb103d1700 100644 --- a/ci/srht/index.json +++ b/ci/srht/index.json @@ -14,6 +14,11 @@ "shasum": "{{X86_64_FREEBSD_SHASUM}}", "size": "{{X86_64_FREEBSD_BYTESIZE}}" }, + "x86_64-netbsd": { + "tarball": "https://ziglang.org/builds/{{X86_64_NETBSD_TARBALL}}", + "shasum": "{{X86_64_NETBSD_SHASUM}}", + "size": "{{X86_64_NETBSD_BYTESIZE}}" + }, "x86_64-macos": { "tarball": "https://ziglang.org/builds/{{X86_64_MACOS_TARBALL}}", "shasum": "{{X86_64_MACOS_SHASUM}}", diff --git a/ci/srht/netbsd_script b/ci/srht/netbsd_script new file mode 100755 index 000000000000..508da4b3246e --- /dev/null +++ b/ci/srht/netbsd_script @@ -0,0 +1,92 @@ +#!/bin/sh + +set -x +set -e + +sudo pkgin -y update +sudo pkgin -y upgrade +sudo pkgin -y install cmake samurai curl jq py27-s3cmd wget clang + +ZIGDIR="$(pwd)" +CACHE_BASENAME="zig+llvm+lld+clang-x86_64-netbsd-gnu-0.8.0" +PREFIX="$HOME/$CACHE_BASENAME" + +cd $HOME +wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" +tar xf "$CACHE_BASENAME.tar.xz" + +cd $ZIGDIR + +# Make the `zig version` number consistent. +# This will affect the cmake command below. +git config core.abbrev 9 +git fetch --unshallow || true +git fetch --tags + +# SourceHut reports that it is a terminal that supports escape codes, but it +# is a filthy liar. Here we tell Zig to not try to send any terminal escape +# codes to show progress. +export TERM=dumb + +mkdir build +cd build +export CC="$PREFIX/bin/zigcc" +export CXX="$PREFIX/bin/zigcxx" +echo "#!/bin/sh +env CC=\"clang\" $PREFIX/bin/zig cc \"\$@\"" > $CC +echo "#!/bin/sh +env CC=\"clang\" $PREFIX/bin/zig c++ \"\$@\"" > $CXX +chmod +x $CC +chmod +x $CXX + +cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH=$PREFIX \ + "-DCMAKE_INSTALL_PREFIX=$(pwd)/release" \ + -DZIG_STATIC=ON \ + -DZIG_TARGET_TRIPLE=x86_64-netbsd-none \ + -GNinja +samu install + +unset CC +unset CXX + +# Here we skip some tests to save time. +release/bin/zig build test -Dskip-compile-errors -Dskip-non-native + +if [ -f ~/.s3cfg ]; then + mv ../LICENSE release/ + mv ../zig-cache/langref.html release/ + mv release/bin/zig release/ + rmdir release/bin + + GITBRANCH=$(basename $GITHUB_REF) + VERSION=$(release/zig version) + DIRNAME="zig-netbsd-x86_64-$VERSION" + TARBALL="$DIRNAME.tar.xz" + mv release "$DIRNAME" + tar cfJ "$TARBALL" "$DIRNAME" + + s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/ + + SHASUM=$(shasum -a 256 $TARBALL | cut '-d ' -f1) + BYTESIZE=$(wc -c < $TARBALL) + + JSONFILE="netbsd-$GITBRANCH.json" + touch $JSONFILE + echo "{\"tarball\": \"$TARBALL\"," >>$JSONFILE + echo "\"shasum\": \"$SHASUM\"," >>$JSONFILE + echo "\"size\": \"$BYTESIZE\"}" >>$JSONFILE + + s3cmd put -P --add-header="Cache-Control: max-age=0, must-revalidate" "$JSONFILE" "s3://ziglang.org/builds/$JSONFILE" + s3cmd put -P "$JSONFILE" "s3://ziglang.org/builds/x86_64-netbsd-$VERSION.json" + + if [ "$GITBRANCH" = "master" ]; then + # avoid leaking oauth token + set +x + + OAUTH_TOKEN="$(cat ~/.oauth_token)" + cd "$ZIGDIR" + ./ci/srht/on_master_success "$VERSION" "$OAUTH_TOKEN" + fi +fi diff --git a/ci/srht/update-download-page.zig b/ci/srht/update-download-page.zig index d9dadc9ff2a6..b91dfd0c376c 100644 --- a/ci/srht/update-download-page.zig +++ b/ci/srht/update-download-page.zig @@ -10,11 +10,6 @@ pub fn main() !void { const out_dir = "out"; try std.fs.cwd().makePath(out_dir); - { - const out_file = out_dir ++ path.sep_str ++ "index.html"; - const in_file = "index.html"; - try render(allocator, in_file, out_file, .html); - } { const out_file = out_dir ++ path.sep_str ++ "index.json"; const in_file = "index.json"; diff --git a/ci/srht/update_download_page b/ci/srht/update_download_page index ebdb3ed6b0a5..490388ca78e2 100755 --- a/ci/srht/update_download_page +++ b/ci/srht/update_download_page @@ -15,6 +15,7 @@ X86_64_WINDOWS_JSON_URL="https://ziglang.org/builds/x86_64-windows-$VERSION.json AARCH64_MACOS_JSON_URL="https://ziglang.org/builds/aarch64-macos-$VERSION.json" X86_64_MACOS_JSON_URL="https://ziglang.org/builds/x86_64-macos-$VERSION.json" X86_64_FREEBSD_JSON_URL="https://ziglang.org/builds/x86_64-freebsd-$VERSION.json" +X86_64_NETBSD_JSON_URL="https://ziglang.org/builds/x86_64-netbsd-$VERSION.json" # If any of these fail, it's not really this job failing; rather we have detected # that this job will be called again later when other jobs have completed. @@ -24,6 +25,7 @@ curl --fail -I "$X86_64_WINDOWS_JSON_URL" >/dev/null || exit 0 curl --fail -I "$AARCH64_MACOS_JSON_URL" >/dev/null || exit 0 curl --fail -I "$X86_64_MACOS_JSON_URL" >/dev/null || exit 0 curl --fail -I "$X86_64_FREEBSD_JSON_URL" >/dev/null || exit 0 +curl --fail -I "$X86_64_NETBSD_JSON_URL" >/dev/null || exit 0 # Without --user, this gave me: # ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied @@ -84,16 +86,21 @@ export X86_64_FREEBSD_TARBALL="$(echo "$X86_64_FREEBSD_JSON" | jq .tarball -r)" export X86_64_FREEBSD_BYTESIZE="$(echo "$X86_64_FREEBSD_JSON" | jq .size -r)" export X86_64_FREEBSD_SHASUM="$(echo "$X86_64_FREEBSD_JSON" | jq .shasum -r)" +X86_64_NETBSD_JSON=$(curl --fail "$X86_64_NETBSD_JSON_URL" || exit 1) +export X86_64_NETBSD_TARBALL="$(echo "$X86_64_NETBSD_JSON" | jq .tarball -r)" +export X86_64_NETBSD_BYTESIZE="$(echo "$X86_64_NETBSD_JSON" | jq .size -r)" +export X86_64_NETBSD_SHASUM="$(echo "$X86_64_NETBSD_JSON" | jq .shasum -r)" + export MASTER_DATE="$(date +%Y-%m-%d)" export MASTER_VERSION="$VERSION" +# Create index.json and update the website repo. cd "$SRCTARBALLDIR/ci/srht" "$ZIG" run update-download-page.zig CIDIR="$(pwd)" -# Create index.json and index.html and update the website repo. cd "$HOME" -git clone git@github.com:ziglang/www.ziglang.org.git +git clone --depth 1 git@github.com:ziglang/www.ziglang.org.git cd www.ziglang.org WWWDIR="$(pwd)"