添加新语言支持

This commit is contained in:
MeiK 2021-04-20 17:11:41 +08:00
parent 717779fec1
commit 10f6c437ff
3 changed files with 40 additions and 3 deletions

View File

@ -53,3 +53,39 @@ languages:
openjdk 11.0.9.1 2020-11-04
OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)
CSharp:
compile_cmd: /plugins/csharp/compile.sh Main.cs
code_file: Main.cs
run_cmd: ./bin/release/net5.0/Main
version: 5.0.202
PHP:
compile_cmd: php -l main.php
code_file: main.php
run_cmd: php -f main.php
version: PHP 8.0.3 (cli) (built:: Mar 5 2021 07:54:13) ( NTS )
Ruby:
compile_cmd: ruby -c main.rb
code_file: main.rb
run_cmd: ruby main.rb
version: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
Perl:
compile_cmd: perl -c main.pl
code_file: main.pl
run_cmd: perl main.pl
version: This is perl 5, version 30, subversion 0 (v5.30.0) built for x86_64-linux-gnu-thread-multi
Haskell:
compile_cmd: ghc main.hs
code_file: main.hs
run_cmd: ./main
version: The Glorious Glasgow Haskell Compilation System, version 8.6.5
Pascal:
compile_cmd: fpc -omain main.p
code_file: main.p
run_cmd: ./main
version: Free Pascal Compiler version 3.0.4+dfsg-23 [2019/11/25] for x86_64

@ -1 +1 @@
Subproject commit 559c473ee872e25f123be8a9f0b129857c4c6915
Subproject commit 53054639b956ab565b5ccc0bc0ea44211018f7a6

View File

@ -43,11 +43,11 @@ pub async fn compile(language: &str, code: &str, path: &Path) -> Result<JudgeRes
String::from("/STDIN/"),
path_to_string(&path.join(STDOUT_FILENAME))?,
path_to_string(&path.join(STDERR_FILENAME))?,
5000,
8000,
1024 * 1024,
50 * 1024 * 1024,
i32::from(CONFIG.cgroup),
32,
64,
);
let status = sandbox.spawn().await?;
drop(permit);
@ -107,6 +107,7 @@ pub async fn judge(
|| language == "Go"
|| language == "JavaScript"
|| language == "TypeScript"
|| language == "CSharp"
{
1024 * 1024
} else {