add crystal

This commit is contained in:
Brian Seymour 2021-01-23 14:59:07 -06:00
parent f04e046d4b
commit 655b7398b6
6 changed files with 28 additions and 0 deletions

5
lxc/executors/crystal Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
cd /tmp/$2
crystal build code.code
timeout -s KILL 3 xargs -a args.args -d '\n' ./code < stdin.stdin

View File

@ -9,6 +9,8 @@ echo -n 'testing c = '
../../cli/execute c c.c ../../cli/execute c c.c
echo -n 'testing cpp = ' echo -n 'testing cpp = '
../../cli/execute cpp cpp.cpp ../../cli/execute cpp cpp.cpp
echo -n 'testing crystal = '
../../cli/execute crystal crystal.cr
echo -n 'testing csharp = ' echo -n 'testing csharp = '
../../cli/execute csharp csharp.cs ../../cli/execute csharp csharp.cs
echo -n 'testing deno = ' echo -n 'testing deno = '

1
lxc/tests/crystal.cr Normal file
View File

@ -0,0 +1 @@
puts "good"

View File

@ -21,6 +21,10 @@ echo 'cpp'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "g++ --version" lxc-attach --clear-env -n piston -- /bin/bash -l -c "g++ --version"
echo '---' echo '---'
echo 'crystal'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "crystal -v"
echo '---'
echo 'csharp' echo 'csharp'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "mcs --version" lxc-attach --clear-env -n piston -- /bin/bash -l -c "mcs --version"
echo '---' echo '---'

View File

@ -38,6 +38,13 @@
"c" "c"
] ]
}, },
{
"name": "crystal",
"aliases": [
"crystal"
"cr"
]
},
{ {
"name": "lisp", "name": "lisp",
"aliases": [ "aliases": [

View File

@ -222,6 +222,15 @@ cd Brainfuck-interpreter
echo 'export PATH=$PATH:/opt/bf/Brainfuck-interpreter' >> /opt/.profile echo 'export PATH=$PATH:/opt/bf/Brainfuck-interpreter' >> /opt/.profile
source /opt/.profile source /opt/.profile
# install crystal
# final binary: /opt/crystal/crystal-0.35.1-1/bin/crystal
# get version: /opt/crystal/crystal-0.35.1-1/bin/crystal -v
cd /opt && mkdir crystal && cd crystal
wget https://github.com/crystal-lang/crystal/releases/download/0.35.1/crystal-0.35.1-1-linux-x86_64.tar.gz
tar -xzf crystal-0.35.1-1-linux-x86_64.tar.gz
echo 'export PATH="$PATH:/opt/crystal/crystal-0.35.1-1/bin:$PATH"' >> /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