From 295e73d4d977d0e97897d4918bf9ac9a5a681047 Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 8 Feb 2021 20:05:14 +1300 Subject: [PATCH 01/17] Disable color output for deno By default Deno has color output, we don't need this - and it also makes challenges on emkc.org not give the correct results. --- lxc/executors/deno | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxc/executors/deno b/lxc/executors/deno index f55e1f4..8ec4c14 100755 --- a/lxc/executors/deno +++ b/lxc/executors/deno @@ -1,4 +1,4 @@ #!/bin/bash cd /tmp/$1 -timeout -s KILL 3 xargs -a args.args -d '\n' deno run code.code < stdin.stdin +timeout -s KILL 3 xargs -a args.args -d '\n' NO_COLOR=true deno run code.code < stdin.stdin From 4af1aa670b532f00cd7babda0dfe0fcb90bcfd1a Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Thu, 18 Feb 2021 16:26:11 -0600 Subject: [PATCH 02/17] replace pkill loop with pgrep while loop --- lxc/execute | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lxc/execute b/lxc/execute index 66e1daf..3f893fb 100755 --- a/lxc/execute +++ b/lxc/execute @@ -27,7 +27,7 @@ exec 200>&- # prevent users from spying on each other lxc-attach --clear-env -n piston -- \ - /bin/bash -l -c " + /bin/bash -c " chown runner$runner: -R /tmp/$id chmod 700 /tmp/$id " > /dev/null 2>&1 @@ -35,12 +35,12 @@ lxc-attach --clear-env -n piston -- \ # runner timeout -s KILL 20 \ lxc-attach --clear-env -n piston -- \ - /bin/bash -l -c "runuser runner$runner /exec/$language $id" + /bin/bash -c "runuser runner$runner /exec/$language $id" # process janitor lxc-attach --clear-env -n piston -- \ - /bin/bash -l -c " - for i in {1..100} + /bin/bash -c " + while pgrep -u runner$runner > /dev/null do pkill -u runner$runner --signal SIGKILL done From 2ca831f8226c1123bc1e27d2a634f10110c022dc Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Thu, 18 Feb 2021 16:29:04 -0600 Subject: [PATCH 03/17] use login shell again since rust breaks without it --- lxc/execute | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxc/execute b/lxc/execute index 3f893fb..9a4a611 100755 --- a/lxc/execute +++ b/lxc/execute @@ -35,7 +35,7 @@ lxc-attach --clear-env -n piston -- \ # runner timeout -s KILL 20 \ lxc-attach --clear-env -n piston -- \ - /bin/bash -c "runuser runner$runner /exec/$language $id" + /bin/bash -l -c "runuser runner$runner /exec/$language $id" # process janitor lxc-attach --clear-env -n piston -- \ From 87b124c73761c5b6b573d5c0840a6561cc5c748d Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Fri, 19 Feb 2021 00:33:39 -0600 Subject: [PATCH 04/17] fix prolog executor and instructions --- container/install_script.sh | 5 +++-- lxc/executors/prolog | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/container/install_script.sh b/container/install_script.sh index bb7264f..40973e8 100644 --- a/container/install_script.sh +++ b/container/install_script.sh @@ -16,7 +16,8 @@ apt-get update apt-get install -y \ nano wget build-essential pkg-config libxml2-dev \ libsqlite3-dev mono-complete curl cmake libpython2.7-dev \ - ruby libtinfo-dev unzip git openssl libssl-dev sbcl libevent-dev + ruby libtinfo-dev unzip git openssl libssl-dev sbcl libevent-dev \ + ninja-build # install python2 # final binary: /opt/python2/Python-2.7.17/python @@ -294,7 +295,7 @@ rm $SUB_DIR.tar.gz cd $SUB_DIR mkdir build cd build -cmake -DSWIPL_PACKAGES_JAVA=OFF -DSWIPL_PACKAGES_X=OFF -DMULTI_THREADED=OFF -G Ninja .. +cmake -DSWIPL_PACKAGES_JAVA=OFF -DSWIPL_PACKAGES_X=OFF -DMULTI_THREADED=OFF -DINSTALL_DOCUMENTATION=OFF -G Ninja .. ninja echo "export PATH=\$PATH:/opt/swipl/$SUB_DIR/build/src" >> /opt/.profile source /opt/.profile diff --git a/lxc/executors/prolog b/lxc/executors/prolog index e5bb3ec..ec6aeda 100755 --- a/lxc/executors/prolog +++ b/lxc/executors/prolog @@ -2,8 +2,7 @@ cd /tmp/$1 -sed 's/^.*$/:- forall((Goal = (\0), call(Goal)), (write(Goal), nl))./' input.input | - cat code.code - > code.pl +sed 's/^.*$/:- forall((Goal = (\0), call(Goal)), (write(Goal), nl))./' stdin.stdin | + cat code.code - > code.pl timeout -s KILL 3 swipl -g true -t halt code.pl - From 1305dc9e3ff5086abd17097534ae1bbbf3f22647 Mon Sep 17 00:00:00 2001 From: TitouanT Date: Tue, 23 Feb 2021 10:43:44 +0100 Subject: [PATCH 05/17] call main\1 predicate with arguments list if any --- lxc/executors/prolog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lxc/executors/prolog b/lxc/executors/prolog index ec6aeda..d9a6211 100755 --- a/lxc/executors/prolog +++ b/lxc/executors/prolog @@ -5,4 +5,9 @@ cd /tmp/$1 sed 's/^.*$/:- forall((Goal = (\0), call(Goal)), (write(Goal), nl))./' stdin.stdin | cat code.code - > code.pl +if [ -s args.args ] +then + echo ":- main($(jq --raw-input -c --slurp 'split("\n")' args.args))." >> code.pl +fi + timeout -s KILL 3 swipl -g true -t halt code.pl From 2ad9829fc6b476aa659c40eec418e292179b4241 Mon Sep 17 00:00:00 2001 From: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Date: Tue, 23 Feb 2021 19:43:26 -0800 Subject: [PATCH 06/17] Disable color output for scala --- lxc/executors/scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxc/executors/scala b/lxc/executors/scala index be9c27d..7221451 100755 --- a/lxc/executors/scala +++ b/lxc/executors/scala @@ -2,4 +2,4 @@ cd /tmp/$1 cp code.code interim.scala -timeout -s KILL 10 xargs -a args.args -d '\n' scala interim.scala < stdin.stdin +timeout -s KILL 10 xargs -a args.args -d '\n' scala -color never interim.scala < stdin.stdin From 0d3517fe56eb42140ed86c534dd1b4542b6cd96a Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Thu, 25 Feb 2021 18:28:35 -0600 Subject: [PATCH 07/17] link math --- lxc/executors/c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxc/executors/c b/lxc/executors/c index e0806f3..e849a08 100755 --- a/lxc/executors/c +++ b/lxc/executors/c @@ -1,5 +1,5 @@ #!/usr/bin/bash cd /tmp/$1 -timeout -s KILL 10 gcc -std=c11 -o binary -x c code.code +timeout -s KILL 10 gcc -std=c11 -o binary -x c code.code -lm timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin From 84fb5e0b9cd1b7e5254350c0195516261f3eb4c8 Mon Sep 17 00:00:00 2001 From: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Date: Thu, 25 Feb 2021 18:32:13 -0800 Subject: [PATCH 08/17] Fix scala version --- lxc/util/versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxc/util/versions b/lxc/util/versions index f86b563..6ff9d54 100755 --- a/lxc/util/versions +++ b/lxc/util/versions @@ -130,7 +130,7 @@ 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" +lxc-attach --clear-env -n piston -- /bin/bash -l -c "scalac -version" echo '---' echo 'swift' From 2444092236eecf390c4a46e044b2caf940bbc1ae Mon Sep 17 00:00:00 2001 From: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Date: Thu, 25 Feb 2021 18:43:34 -0800 Subject: [PATCH 09/17] Update install comment in install_script --- container/install_script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container/install_script.sh b/container/install_script.sh index 40973e8..c7cf270 100644 --- a/container/install_script.sh +++ b/container/install_script.sh @@ -101,7 +101,7 @@ cd rust-1.49.0-x86_64-unknown-linux-gnu # install scala # final binary: /opt/scala/scala3-3.0.0-M3/bin/scala -# get version: /opt/scala/scala3-3.0.0-M3/bin/scala -version +# get version: /opt/scala/scala3-3.0.0-M3/bin/scalac -version cd /opt && mkdir scala && cd scala 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 From 14d1090daa471d0e0bade121ca072d897b73500a Mon Sep 17 00:00:00 2001 From: Vrganj Date: Fri, 12 Mar 2021 20:18:43 +0100 Subject: [PATCH 10/17] Add lolcode --- config/languages.json | 6 ++++++ container/install_script.sh | 12 +++++++++++- lxc/executors/lolcode | 4 ++++ lxc/tests/lolcode.lol | 4 ++++ readme.md | 1 + 5 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 lxc/executors/lolcode create mode 100644 lxc/tests/lolcode.lol diff --git a/config/languages.json b/config/languages.json index f62ea5c..b8a54b2 100644 --- a/config/languages.json +++ b/config/languages.json @@ -136,6 +136,12 @@ "java" ] }, + { + "name": "lolcode", + "aliases": [ + "lolcode" + ] + }, { "name": "nim", "aliases": [ diff --git a/container/install_script.sh b/container/install_script.sh index c7cf270..593f7e1 100644 --- a/container/install_script.sh +++ b/container/install_script.sh @@ -284,7 +284,6 @@ MIX_ENV=prod mix escript.build --force echo 'export PATH=$PATH:/opt/05AB1E/05AB1E' >> /opt/.profile source /opt/.profile - # install prolog # final binary: /opt/swipl/swipl-/build/src/swipl cd /opt && mkdir swipl && cd swipl @@ -300,6 +299,17 @@ ninja echo "export PATH=\$PATH:/opt/swipl/$SUB_DIR/build/src" >> /opt/.profile source /opt/.profile +# install lolcode +# final binary: /opt/lolcode/bin/lci +cd /opt +git clone https://github.com/justinmeza/lci.git lolcode +cd lolcode +mkdir bin +cmake .. +make +echo 'export PATH=$PATH:/opt/lolcode/bin' >> /opt/.profile +source /opt/.profile + # create runnable users and apply limits for i in {1..150}; do useradd -M runner$i diff --git a/lxc/executors/lolcode b/lxc/executors/lolcode new file mode 100644 index 0000000..15e7473 --- /dev/null +++ b/lxc/executors/lolcode @@ -0,0 +1,4 @@ +#!/bin/bash + +cd /tmp/$1 +timeout -s KILL 3 lci code.code < stdin.stdin diff --git a/lxc/tests/lolcode.lol b/lxc/tests/lolcode.lol new file mode 100644 index 0000000..eac51ad --- /dev/null +++ b/lxc/tests/lolcode.lol @@ -0,0 +1,4 @@ +HAI 1.2 + CAN HAS STDIO? + VISIBLE "good" +KTHXBYE diff --git a/readme.md b/readme.md index ea4c0e9..d58b4e5 100644 --- a/readme.md +++ b/readme.md @@ -275,6 +275,7 @@ Content-Type: application/json `julia`, `kotlin`, `lisp`, +`lolcode`, `lua`, `nasm`, `nasm64`, From ed0a5c4f78dc5a97f3eb3975e5c348beecb47ec1 Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Fri, 12 Mar 2021 13:27:06 -0600 Subject: [PATCH 11/17] merge and add clojure --- config/languages.json | 7 +++++++ container/install_script.sh | 9 +++++++++ lxc/executors/clojure | 4 ++++ lxc/tests/clojure.clj | 5 +++++ lxc/util/versions | 8 ++++++++ 5 files changed, 33 insertions(+) create mode 100644 lxc/executors/clojure create mode 100644 lxc/tests/clojure.clj diff --git a/config/languages.json b/config/languages.json index b8a54b2..e3c0c50 100644 --- a/config/languages.json +++ b/config/languages.json @@ -39,6 +39,13 @@ "c" ] }, + { + "name": "clojure", + "aliases": [ + "clojure", + "clj" + ] + }, { "name": "crystal", "aliases": [ diff --git a/container/install_script.sh b/container/install_script.sh index 593f7e1..a4e0eb0 100644 --- a/container/install_script.sh +++ b/container/install_script.sh @@ -310,6 +310,15 @@ make echo 'export PATH=$PATH:/opt/lolcode/bin' >> /opt/.profile source /opt/.profile +# install clojure +# final binary: /opt/clojure/bin/clojure +# get version: /opt/clojure/bin/clojure -version +cd /opt && mkdir clojure && cd clojure +curl -O https://download.clojure.org/install/linux-install-1.10.2.796.sh +chmod +x linux-install-1.10.2.796.sh +./linux-install-1.10.2.796.sh --prefix /opt/clojure +echo 'export PATH=$PATH:/opt/clojure/bin' >> /opt/.profile + # create runnable users and apply limits for i in {1..150}; do useradd -M runner$i diff --git a/lxc/executors/clojure b/lxc/executors/clojure new file mode 100644 index 0000000..39689c4 --- /dev/null +++ b/lxc/executors/clojure @@ -0,0 +1,4 @@ +#!/bin/bash + +cd /tmp/$1 +timeout -s KILL 3 xargs -a args.args -d '\n' clojure -M code.code < stdin.stdin diff --git a/lxc/tests/clojure.clj b/lxc/tests/clojure.clj new file mode 100644 index 0000000..befe5c3 --- /dev/null +++ b/lxc/tests/clojure.clj @@ -0,0 +1,5 @@ +(ns clojure.examples.hello + (:gen-class)) +(defn hello-world [] + (println "good")) +(hello-world) diff --git a/lxc/util/versions b/lxc/util/versions index 6ff9d54..5fd2866 100755 --- a/lxc/util/versions +++ b/lxc/util/versions @@ -21,6 +21,10 @@ echo 'cpp' lxc-attach --clear-env -n piston -- /bin/bash -l -c "g++ --version" echo '---' +echo 'clojure' +lxc-attach --clear-env -n piston -- /bin/bash -l -c "clojure -version" +echo '---' + echo 'crystal' lxc-attach --clear-env -n piston -- /bin/bash -l -c "crystal -v" echo '---' @@ -77,6 +81,10 @@ echo 'lisp' lxc-attach --clear-env -n piston -- /bin/bash -l -c "sbcl --version" echo '---' +echo 'lolcode' +echo '1.0.0' +echo '---' + echo 'lua' lxc-attach --clear-env -n piston -- /bin/bash -l -c "lua -v" echo '---' From 9f7d01bb189380ad79e1bff8c5df619a78937a73 Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Fri, 12 Mar 2021 13:28:39 -0600 Subject: [PATCH 12/17] add missing cd --- container/install_script.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/container/install_script.sh b/container/install_script.sh index a4e0eb0..3aaad05 100644 --- a/container/install_script.sh +++ b/container/install_script.sh @@ -305,6 +305,7 @@ cd /opt git clone https://github.com/justinmeza/lci.git lolcode cd lolcode mkdir bin +cd bin cmake .. make echo 'export PATH=$PATH:/opt/lolcode/bin' >> /opt/.profile From a2afccad268a75ac7a4f310eeb7e71dec1ca7020 Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Fri, 12 Mar 2021 13:33:17 -0600 Subject: [PATCH 13/17] add missing tests, give clojure more time --- lxc/executors/clojure | 2 +- lxc/tests/_run | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lxc/executors/clojure b/lxc/executors/clojure index 39689c4..7298893 100644 --- a/lxc/executors/clojure +++ b/lxc/executors/clojure @@ -1,4 +1,4 @@ #!/bin/bash cd /tmp/$1 -timeout -s KILL 3 xargs -a args.args -d '\n' clojure -M code.code < stdin.stdin +timeout -s KILL 10 xargs -a args.args -d '\n' clojure -M code.code < stdin.stdin diff --git a/lxc/tests/_run b/lxc/tests/_run index b166802..dbcc47b 100755 --- a/lxc/tests/_run +++ b/lxc/tests/_run @@ -6,6 +6,8 @@ echo -n 'testing bash = ' ../../cli/execute bash bash.sh echo -n 'testing c = ' ../../cli/execute c c.c +echo -n 'testing clojure = ' +../../cli/execute clojure clojure.clj echo -n 'testing cpp = ' ../../cli/execute cpp cpp.cpp echo -n 'testing crystal = ' @@ -34,6 +36,8 @@ echo -n 'testing julia = ' ../../cli/execute julia julia.jl echo -n 'testing kotlin = ' ../../cli/execute kotlin kotlin.kt +echo -n 'testing lolcode = ' +../../cli/execute lolcode lolcode.lol echo -n 'testing lisp = ' ../../cli/execute lisp lisp.cl echo -n 'testing nasm 32 bit = ' From 66a602038b87d3c7e271e563e3159c22873325bb Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Fri, 12 Mar 2021 13:58:16 -0600 Subject: [PATCH 14/17] specify m2 directory explicitly --- lxc/executors/clojure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxc/executors/clojure b/lxc/executors/clojure index 7298893..f82f9e8 100644 --- a/lxc/executors/clojure +++ b/lxc/executors/clojure @@ -1,4 +1,4 @@ #!/bin/bash cd /tmp/$1 -timeout -s KILL 10 xargs -a args.args -d '\n' clojure -M code.code < stdin.stdin +timeout -s KILL 10 xargs -a args.args -d '\n' clojure -Sdeps '{:mvn/local-repo "/opt/.m2/repository"}' -M code.code < stdin.stdin From 6ff766d90b756b0c1c1a560042c1c313d829af3b Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Fri, 12 Mar 2021 14:12:25 -0600 Subject: [PATCH 15/17] fix deno, fix clojure version, lolcode dynamic version --- api/src/languages.js | 2 ++ lxc/executors/deno | 3 ++- lxc/util/versions | 2 +- readme.md | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/api/src/languages.js b/api/src/languages.js index 6ac2f14..b1c93d2 100644 --- a/api/src/languages.js +++ b/api/src/languages.js @@ -22,6 +22,8 @@ const languages = require('../../config/languages.json'); versions[language] = /\d+/.exec(lines[1])?.[0]; } else if (language === 'emacs') { versions[language] = /\d+\.\d+/.exec(lines[1])?.[0]; + } else if (language === 'clojure') { + versions[language] = /\d+\.\d+\.\d+\.\d+/.exec(lines[1])?.[0]; } else { versions[language] = /\d+\.\d+\.\d+/.exec(section)?.[0]; } diff --git a/lxc/executors/deno b/lxc/executors/deno index 8ec4c14..85bdd93 100755 --- a/lxc/executors/deno +++ b/lxc/executors/deno @@ -1,4 +1,5 @@ #!/bin/bash cd /tmp/$1 -timeout -s KILL 3 xargs -a args.args -d '\n' NO_COLOR=true deno run code.code < stdin.stdin +export NO_COLOR=true +timeout -s KILL 3 xargs -a args.args -d '\n' deno run code.code < stdin.stdin diff --git a/lxc/util/versions b/lxc/util/versions index 5fd2866..49ec747 100755 --- a/lxc/util/versions +++ b/lxc/util/versions @@ -82,7 +82,7 @@ lxc-attach --clear-env -n piston -- /bin/bash -l -c "sbcl --version" echo '---' echo 'lolcode' -echo '1.0.0' +lxc-attach --clear-env -n piston -- /bin/bash -l -c "lci --version" echo '---' echo 'lua' diff --git a/readme.md b/readme.md index d58b4e5..3628d2a 100644 --- a/readme.md +++ b/readme.md @@ -260,6 +260,7 @@ Content-Type: application/json `brainfuck`, `c`, `cpp`, +`clojure`, `crystal`, `csharp`, `d`, From ac44a5c3730092c37d15f06092a783786d153c40 Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Fri, 12 Mar 2021 14:41:43 -0600 Subject: [PATCH 16/17] new clojure install --- container/install_script.sh | 9 ++++----- lxc/executors/clojure | 2 +- lxc/util/versions | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/container/install_script.sh b/container/install_script.sh index 3aaad05..b9682c6 100644 --- a/container/install_script.sh +++ b/container/install_script.sh @@ -17,7 +17,7 @@ apt-get install -y \ nano wget build-essential pkg-config libxml2-dev \ libsqlite3-dev mono-complete curl cmake libpython2.7-dev \ ruby libtinfo-dev unzip git openssl libssl-dev sbcl libevent-dev \ - ninja-build + ninja-build maven # install python2 # final binary: /opt/python2/Python-2.7.17/python @@ -315,10 +315,9 @@ source /opt/.profile # final binary: /opt/clojure/bin/clojure # get version: /opt/clojure/bin/clojure -version cd /opt && mkdir clojure && cd clojure -curl -O https://download.clojure.org/install/linux-install-1.10.2.796.sh -chmod +x linux-install-1.10.2.796.sh -./linux-install-1.10.2.796.sh --prefix /opt/clojure -echo 'export PATH=$PATH:/opt/clojure/bin' >> /opt/.profile +git clone https://github.com/clojure/clojure.git +cd clojure +mvn -Plocal -Dmaven.test.skip=true package # create runnable users and apply limits for i in {1..150}; do diff --git a/lxc/executors/clojure b/lxc/executors/clojure index f82f9e8..03f475a 100644 --- a/lxc/executors/clojure +++ b/lxc/executors/clojure @@ -1,4 +1,4 @@ #!/bin/bash cd /tmp/$1 -timeout -s KILL 10 xargs -a args.args -d '\n' clojure -Sdeps '{:mvn/local-repo "/opt/.m2/repository"}' -M code.code < stdin.stdin +timeout -s KILL 10 xargs -a args.args -d '\n' java -jar /opt/clojure/clojure/clojure.jar code.code < stdin.stdin diff --git a/lxc/util/versions b/lxc/util/versions index 49ec747..af068a0 100755 --- a/lxc/util/versions +++ b/lxc/util/versions @@ -22,7 +22,7 @@ lxc-attach --clear-env -n piston -- /bin/bash -l -c "g++ --version" echo '---' echo 'clojure' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "clojure -version" +echo '1.10.2' echo '---' echo 'crystal' From 16c585d41d649af8a1be4cd35559d60970f27339 Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Sun, 14 Mar 2021 22:08:56 -0500 Subject: [PATCH 17/17] dont trim output --- lxc/execute.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lxc/execute.js b/lxc/execute.js index fc9fb8b..a1bac7d 100644 --- a/lxc/execute.js +++ b/lxc/execute.js @@ -37,9 +37,9 @@ function execute(language, source, stdin = '', args = []) { }); process.on('exit', code => { - stderr = stderr.trim().substring(0, OUTPUT_LIMIT); - stdout = stdout.trim().substring(0, OUTPUT_LIMIT); - output = output.trim().substring(0, OUTPUT_LIMIT); + stderr = stderr.substring(0, OUTPUT_LIMIT); + stdout = stdout.substring(0, OUTPUT_LIMIT); + output = output.substring(0, OUTPUT_LIMIT); resolve({ stdout,