diff --git a/lxc/executors/zig b/lxc/executors/zig new file mode 100644 index 0000000..1250342 --- /dev/null +++ b/lxc/executors/zig @@ -0,0 +1,6 @@ +#!/bin/bash + +cd /tmp/$2 +cp code.code main.zig +timeout -s KILL 10 zig build-exe main.zig +timeout -s KILL 3 xargs -a args.args -d '\n' ./main diff --git a/lxc/tests/zig.zig b/lxc/tests/zig.zig new file mode 100644 index 0000000..6a9d2ac --- /dev/null +++ b/lxc/tests/zig.zig @@ -0,0 +1,6 @@ +const std = @import("std"); + +pub fn main() !void { + const stdout = std.io.getStdOut().writer(); + try stdout.print("good\n", .{}); +} diff --git a/lxc/versions b/lxc/versions index 1d112df..01f674b 100755 --- a/lxc/versions +++ b/lxc/versions @@ -33,7 +33,7 @@ echo "elixir" lxc-attach --clear-env -n piston -- /bin/bash -l -c "elixir --version" echo '---' -echo 'd' +echo 'd' lxc-attach --clear-env -n piston -- /bin/bash -l -c "dmd --version" echo '---' @@ -124,3 +124,7 @@ echo '---' echo 'typescript' lxc-attach --clear-env -n piston -- /bin/bash -l -c "tsc --version" echo '---' + +echo 'zig' +lxc-attach --clear-env -n piston -- /bin/bash -l -c "zig version" +echo '---' diff --git a/shared/languages.json b/shared/languages.json index 369c388..61c9e7c 100644 --- a/shared/languages.json +++ b/shared/languages.json @@ -221,5 +221,11 @@ "ts", "typescript" ] + }, + { + "name": "zig", + "aliases": [ + "zig" + ] } ] diff --git a/var/install.txt b/var/install.txt index a9cd61a..071b702 100644 --- a/var/install.txt +++ b/var/install.txt @@ -241,6 +241,17 @@ tar -xf dmd.2.095.0.linux.tar echo 'export PATH=$PATH:/opt/d/dmd2/linux/bin64' >> /opt/.profile source /opt/.profile +# install zig +# final binary: /opt/zig/zig +# get version: /opt/zig/zig version +cd /opt && mkdir zig && cd zig +wget https://ziglang.org/download/0.7.1/zig-linux-x86_64-0.7.1.tar.xz +tar -xf zig-linux-x86_64-0.7.1.tar.xz +mv zig-linux-x86_64-0.7.1 zig +rm zig-linux-x86_64-0.7.1.tar.xz +echo 'export PATH=$PATH:/opt/zig/zig' >> /opt/.profile +source /opt/.profile + # create runnable users and apply limits for i in {1..150}; do useradd -M runner$i