From 655b7398b6784e65d4c39fbaa2e87a56ab046f1c Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Sat, 23 Jan 2021 14:59:07 -0600 Subject: [PATCH] add crystal --- lxc/executors/crystal | 5 +++++ lxc/test_all_lxc | 2 ++ lxc/tests/crystal.cr | 1 + lxc/versions | 4 ++++ shared/languages.json | 7 +++++++ var/install.txt | 9 +++++++++ 6 files changed, 28 insertions(+) create mode 100644 lxc/executors/crystal create mode 100644 lxc/tests/crystal.cr diff --git a/lxc/executors/crystal b/lxc/executors/crystal new file mode 100644 index 0000000..5530326 --- /dev/null +++ b/lxc/executors/crystal @@ -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 diff --git a/lxc/test_all_lxc b/lxc/test_all_lxc index bc77524..5d4c0f9 100755 --- a/lxc/test_all_lxc +++ b/lxc/test_all_lxc @@ -9,6 +9,8 @@ echo -n 'testing c = ' ../../cli/execute c c.c echo -n 'testing cpp = ' ../../cli/execute cpp cpp.cpp +echo -n 'testing crystal = ' +../../cli/execute crystal crystal.cr echo -n 'testing csharp = ' ../../cli/execute csharp csharp.cs echo -n 'testing deno = ' diff --git a/lxc/tests/crystal.cr b/lxc/tests/crystal.cr new file mode 100644 index 0000000..1af2472 --- /dev/null +++ b/lxc/tests/crystal.cr @@ -0,0 +1 @@ +puts "good" diff --git a/lxc/versions b/lxc/versions index 1fbbaff..60b8fae 100755 --- a/lxc/versions +++ b/lxc/versions @@ -21,6 +21,10 @@ echo 'cpp' lxc-attach --clear-env -n piston -- /bin/bash -l -c "g++ --version" echo '---' +echo 'crystal' +lxc-attach --clear-env -n piston -- /bin/bash -l -c "crystal -v" +echo '---' + echo 'csharp' lxc-attach --clear-env -n piston -- /bin/bash -l -c "mcs --version" echo '---' diff --git a/shared/languages.json b/shared/languages.json index fe6fc67..4321329 100644 --- a/shared/languages.json +++ b/shared/languages.json @@ -38,6 +38,13 @@ "c" ] }, + { + "name": "crystal", + "aliases": [ + "crystal" + "cr" + ] + }, { "name": "lisp", "aliases": [ diff --git a/var/install.txt b/var/install.txt index 857614b..cf0b207 100644 --- a/var/install.txt +++ b/var/install.txt @@ -222,6 +222,15 @@ cd Brainfuck-interpreter echo 'export PATH=$PATH:/opt/bf/Brainfuck-interpreter' >> /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 for i in {1..150}; do useradd -M runner$i