This commit is contained in:
Brian Seymour 2021-01-23 15:15:00 -06:00
parent e5a91bb71c
commit c452d37b42
5 changed files with 34 additions and 1 deletions

6
lxc/executors/zig Normal file
View File

@ -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

6
lxc/tests/zig.zig Normal file
View File

@ -0,0 +1,6 @@
const std = @import("std");
pub fn main() !void {
const stdout = std.io.getStdOut().writer();
try stdout.print("good\n", .{});
}

View File

@ -124,3 +124,7 @@ echo '---'
echo 'typescript' echo 'typescript'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "tsc --version" lxc-attach --clear-env -n piston -- /bin/bash -l -c "tsc --version"
echo '---' echo '---'
echo 'zig'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "zig version"
echo '---'

View File

@ -221,5 +221,11 @@
"ts", "ts",
"typescript" "typescript"
] ]
},
{
"name": "zig",
"aliases": [
"zig"
]
} }
] ]

View File

@ -241,6 +241,17 @@ tar -xf dmd.2.095.0.linux.tar
echo 'export PATH=$PATH:/opt/d/dmd2/linux/bin64' >> /opt/.profile echo 'export PATH=$PATH:/opt/d/dmd2/linux/bin64' >> /opt/.profile
source /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 # create runnable users and apply limits
for i in {1..150}; do for i in {1..150}; do
useradd -M runner$i useradd -M runner$i