Added haskell support

This commit is contained in:
Ethan Edwards 2020-10-16 23:57:45 -04:00
parent a89d22bd25
commit 3246ed6781
No known key found for this signature in database
GPG Key ID: F1AD8EEE1366610B
6 changed files with 18 additions and 0 deletions

View File

@ -117,6 +117,9 @@ case "$lang" in
"typescript" | "ts")
bin=typescript
;;
"haskell" | "hs")
bin=haskell
;;
*)
echo "invalid language"
exit

3
lxc/executors/haskell Normal file
View File

@ -0,0 +1,3 @@
cd /tmp/$2
timeout -s KILL 10 ghc -dynamic -o binary code.code
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./binary"

View File

@ -45,3 +45,5 @@ echo 'testing python2'
../execute python2 test2.py
echo 'testing python3'
../execute python3 test3.py
echo 'testing haskell'
../execute haskell test.hs

1
lxc/tests/test.hs Normal file
View File

@ -0,0 +1 @@
main = putStrLn "Hello, World"

View File

@ -66,3 +66,6 @@ echo '---'
echo 'typescript'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "tsc --version"
echo '---'
echo 'haskell'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "ghc --version"
echo '---'

View File

@ -218,6 +218,11 @@ make
echo 'export PATH=$PATH:/opt/lua/lua54/src' >> /opt/.profile
source /opt/.profile
# install haskell
# final binary: /usr/bin/ghc
# get version: /usr/bin/ghc --version
apt install ghc
# create runnable users and apply limits
for i in {1..150}; do
useradd -M runner$i
@ -323,6 +328,7 @@ If an invalid language is supplied, a typical response will look like the follow
- elixir
- emacs
- go
- haskell
- java
- julia
- kotlin