From 48d3e39f9a5562e392871643542328729d643936 Mon Sep 17 00:00:00 2001 From: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Date: Thu, 4 Feb 2021 20:03:17 -0800 Subject: [PATCH 1/6] add scala --- config/languages.json | 6 ++++++ lxc/executors/scala | 4 ++++ lxc/tests/_run | 2 ++ lxc/tests/scala.scala | 3 +++ lxc/util/versions | 4 ++++ readme.md | 1 + var/install.txt | 9 +++++++++ 7 files changed, 29 insertions(+) create mode 100755 lxc/executors/scala create mode 100644 lxc/tests/scala.scala diff --git a/config/languages.json b/config/languages.json index 2a18b45..2f4d3cf 100644 --- a/config/languages.json +++ b/config/languages.json @@ -222,6 +222,12 @@ "rust" ] }, + { + "name": "scala", + "aliases": [ + "sc" + ] + }, { "name": "swift", "aliases": [ diff --git a/lxc/executors/scala b/lxc/executors/scala new file mode 100755 index 0000000..8eba78d --- /dev/null +++ b/lxc/executors/scala @@ -0,0 +1,4 @@ +#!/bin/bash + +cp code.code interim.scala +timeout -s KILL 10 xargs -a args.args -d '\n' scala interim.scala < stdin.stdin diff --git a/lxc/tests/_run b/lxc/tests/_run index 676b8cb..e063d4f 100755 --- a/lxc/tests/_run +++ b/lxc/tests/_run @@ -60,6 +60,8 @@ echo -n 'testing ruby = ' ../../cli/execute ruby ruby.rb echo -n 'testing rust = ' ../../cli/execute rust rust.rs +echo -n 'testing scala = ' +../../cli/execute scala scala.scala echo -n 'testing swift = ' ../../cli/execute swift swift.swift echo -n 'testing typescript = ' diff --git a/lxc/tests/scala.scala b/lxc/tests/scala.scala new file mode 100644 index 0000000..3117683 --- /dev/null +++ b/lxc/tests/scala.scala @@ -0,0 +1,3 @@ +object Test extends App { + println("good") +} diff --git a/lxc/util/versions b/lxc/util/versions index ee139c8..f280210 100755 --- a/lxc/util/versions +++ b/lxc/util/versions @@ -125,6 +125,10 @@ echo 'rust' lxc-attach --clear-env -n piston -- /bin/bash -l -c "rustc --version" echo '---' +echo 'scala' +lxc-attach --clear-env -n piston -- /bin/bash -l -c "scala -version" +echo '---' + echo 'swift' lxc-attach --clear-env -n piston -- /bin/bash -l -c "swift --version" echo '---' diff --git a/readme.md b/readme.md index 613b980..24fb0f8 100644 --- a/readme.md +++ b/readme.md @@ -284,6 +284,7 @@ Content-Type: application/json `python3`, `ruby`, `rust`, +`scala`, `swift`, `typescript`, `zig`, diff --git a/var/install.txt b/var/install.txt index bc7eae9..14c0e04 100644 --- a/var/install.txt +++ b/var/install.txt @@ -102,6 +102,15 @@ tar -xzf rust-1.49.0-x86_64-unknown-linux-gnu.tar.gz cd rust-1.49.0-x86_64-unknown-linux-gnu ./install.sh +# install scala +# final binary: /opt/scala/scala-2.12.13/bin/scala +# get version: /opt/scala/scala-2.12.13/bin/scala -version +cd /opt && mkdir scala && cd scala +wget https://downloads.lightbend.com/scala/2.12.13/scala-2.12.13.tgz +tar -xzf scala-2.12.13.tgz +echo 'export PATH=$PATH:/opt/scala/scala-2.12.13/bin' >> /opt/.profile +source /opt/.profile + # install swift # final binary: /opt/swift/swift-5.1.5-RELEASE-ubuntu18.04/usr/bin/swift # get version: /opt/swift/swift-5.1.5-RELEASE-ubuntu18.04/usr/bin/swift --version From cd2d6cb4052522877b3682ed32d979460164d09c Mon Sep 17 00:00:00 2001 From: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Date: Thu, 4 Feb 2021 20:15:08 -0800 Subject: [PATCH 2/6] Add scala as scala alias --- config/languages.json | 1 + 1 file changed, 1 insertion(+) diff --git a/config/languages.json b/config/languages.json index 2f4d3cf..2fd5b1e 100644 --- a/config/languages.json +++ b/config/languages.json @@ -225,6 +225,7 @@ { "name": "scala", "aliases": [ + "scala", "sc" ] }, From ed6c483babc17ee38dda5aef5d68768316ca6758 Mon Sep 17 00:00:00 2001 From: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Date: Thu, 4 Feb 2021 20:35:24 -0800 Subject: [PATCH 3/6] update to scala 3 --- var/install.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/var/install.txt b/var/install.txt index 14c0e04..cc95fbb 100644 --- a/var/install.txt +++ b/var/install.txt @@ -103,12 +103,12 @@ cd rust-1.49.0-x86_64-unknown-linux-gnu ./install.sh # install scala -# final binary: /opt/scala/scala-2.12.13/bin/scala -# get version: /opt/scala/scala-2.12.13/bin/scala -version +# final binary: /opt/scala/scala3-3.0.0-M3/bin/scala +# get version: /opt/scala/scala3-3.0.0-M3/bin/scala -version cd /opt && mkdir scala && cd scala -wget https://downloads.lightbend.com/scala/2.12.13/scala-2.12.13.tgz -tar -xzf scala-2.12.13.tgz -echo 'export PATH=$PATH:/opt/scala/scala-2.12.13/bin' >> /opt/.profile +wget https://github.com/lampepfl/dotty/releases/download/3.0.0-M3/scala3-3.0.0-M3.tar.gz +tar -xzf scala3-3.0.0-M3.tar.gz +echo 'export PATH=$PATH:/opt/scala/scala3-3.0.0-M3/bin' >> /opt/.profile source /opt/.profile # install swift From d10c58b993fec0fdf0854ba29c64678bd517881f Mon Sep 17 00:00:00 2001 From: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Date: Thu, 4 Feb 2021 20:52:13 -0800 Subject: [PATCH 4/6] set JAVA_HOME --- lxc/executors/scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lxc/executors/scala b/lxc/executors/scala index 8eba78d..1baa5ce 100755 --- a/lxc/executors/scala +++ b/lxc/executors/scala @@ -1,4 +1,7 @@ #!/bin/bash +# Scala will complain if JAVA_HOME isn't set +export JAVA_HOME=/opt/java/jdk-14 + cp code.code interim.scala timeout -s KILL 10 xargs -a args.args -d '\n' scala interim.scala < stdin.stdin From cd38eaa3f4ba38e3cfd8366612f8c3cab24d8bd0 Mon Sep 17 00:00:00 2001 From: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Date: Fri, 5 Feb 2021 00:58:13 -0800 Subject: [PATCH 5/6] Update test to use Scala 3 feature --- lxc/tests/scala.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxc/tests/scala.scala b/lxc/tests/scala.scala index 3117683..4083d74 100644 --- a/lxc/tests/scala.scala +++ b/lxc/tests/scala.scala @@ -1,3 +1,3 @@ -object Test extends App { +@main def run(): Unit = { println("good") } From e14effbf3524d4cfb1654857d0a8dd04748a05bd Mon Sep 17 00:00:00 2001 From: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Date: Fri, 5 Feb 2021 01:17:03 -0800 Subject: [PATCH 6/6] Move JAVA_HOME stuff to Java install --- lxc/executors/scala | 3 --- var/install.txt | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lxc/executors/scala b/lxc/executors/scala index 1baa5ce..8eba78d 100755 --- a/lxc/executors/scala +++ b/lxc/executors/scala @@ -1,7 +1,4 @@ #!/bin/bash -# Scala will complain if JAVA_HOME isn't set -export JAVA_HOME=/opt/java/jdk-14 - cp code.code interim.scala timeout -s KILL 10 xargs -a args.args -d '\n' scala interim.scala < stdin.stdin diff --git a/var/install.txt b/var/install.txt index cc95fbb..d332d25 100644 --- a/var/install.txt +++ b/var/install.txt @@ -139,6 +139,8 @@ cd /opt && mkdir java && cd java wget https://download.java.net/java/GA/jdk14/076bab302c7b4508975440c56f6cc26a/36/GPL/openjdk-14_linux-x64_bin.tar.gz tar -xzf openjdk-14_linux-x64_bin.tar.gz echo 'export PATH=$PATH:/opt/java/jdk-14/bin' >> /opt/.profile +# Scala will complain if JAVA_HOME isn't set +echo 'export JAVA_HOME=/opt/java/jdk-14' >> /opt/.profile source /opt/.profile # install jelly