diff --git a/packages/hydrojudge/langs.yaml b/packages/hydrojudge/langs.yaml index 758e97478..d92e804d4 100644 --- a/packages/hydrojudge/langs.yaml +++ b/packages/hydrojudge/langs.yaml @@ -11,6 +11,7 @@ java: execute: /usr/bin/java -Dfile.encoding="UTF-8" -cp Main.jar Main time_limit_rate: 2 compile_time_limit: 30000 + compile_memory_limit: 1024 py3: compile: /usr/bin/python3 -c "import py_compile; py_compile.compile('/w/foo.py', '/w/foo', doraise=True)" code_file: foo.py @@ -19,14 +20,19 @@ php: execute: /usr/bin/php foo.php rs: compile: /usr/bin/rustc -O -o /w/foo /w/foo.rs + compile_time_limit: 30000 hs: compile: /usr/bin/ghc -O -outputdir /tmp -o /w/foo /w/foo.hs + compile_time_limit: 30000 js: execute: /usr/bin/jsc foo.js go: compile: /usr/bin/go build -o /w/foo /w/foo.go + compile_time_limit: 30000 rb: execute: /usr/bin/ruby foo.rb + compile_time_limit: 30000 cs: compile: /usr/bin/mcs csc -optimize+ -out:/w/foo.exe /w/foo.cs - execute: /usr/bin/mono foo.exe \ No newline at end of file + execute: /usr/bin/mono foo.exe + compile_time_limit: 30000 diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index eed35a3d2..b7bacf2eb 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -11,7 +11,7 @@ "adm-zip": "0.5.14", "cac": "^6.7.14", "p-queue": "^8.1.0", - "schemastery": "^3.15.0", + "schemastery": "^3.16.0", "semver": "^7.7.1", "shell-quote": "^1.8.2", "superagent": "^10.1.1", diff --git a/packages/hydrojudge/src/hosts/vj4.ts b/packages/hydrojudge/src/hosts/vj4.ts index aa4afa149..9649ce147 100644 --- a/packages/hydrojudge/src/hosts/vj4.ts +++ b/packages/hydrojudge/src/hosts/vj4.ts @@ -5,7 +5,7 @@ import PQueue from 'p-queue'; import superagent from 'superagent'; import WebSocket from 'ws'; import { JudgeResultBody, parseLang, STATUS } from '@hydrooj/common'; -import { fs, noop } from '@hydrooj/utils'; +import { findFileSync, fs, noop } from '@hydrooj/utils'; import { getConfig } from '../config'; import { FormatError, SystemError } from '../error'; import { Session } from '../interface'; @@ -17,7 +17,7 @@ function removeNixPath(text: string) { return text.replace(/\/nix\/store\/[a-z0-9]{32}-/g, '/nix/'); } -const langs = parseLang(fs.readFileSync(path.resolve(__dirname, '../../langs.yaml'), 'utf-8')); +const langs = parseLang(fs.readFileSync(process.env.VJ4_LANGS || findFileSync('@hydrooj/hydrojudge/langs.yaml'), 'utf-8')); export default class VJ4 implements Session { config: any;