mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-11-04 14:49:58 +08:00
编译器使用绝对路径,否则报找不到文件的异常。
This commit is contained in:
parent
65c2033120
commit
ee35981fcb
@ -2,7 +2,6 @@
|
|||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
import judger
|
import judger
|
||||||
import commands
|
|
||||||
from judge_exceptions import CompileError, JudgeClientError
|
from judge_exceptions import CompileError, JudgeClientError
|
||||||
from logger import logger
|
from logger import logger
|
||||||
from settings import judger_workspace
|
from settings import judger_workspace
|
||||||
@ -14,11 +13,11 @@ def compile_(language_item, src_path, exe_path):
|
|||||||
compile_args = compile_command[1:]
|
compile_args = compile_command[1:]
|
||||||
compiler_output_file = os.path.join(judger_workspace, str(time.time()) + ".out")
|
compiler_output_file = os.path.join(judger_workspace, str(time.time()) + ".out")
|
||||||
|
|
||||||
compile_result = judger.run(exe_path=compiler,
|
compile_result = judger.run(path=compiler,
|
||||||
in_file="/dev/null",
|
in_file="/dev/null",
|
||||||
out_file=compiler_output_file,
|
out_file=compiler_output_file,
|
||||||
max_cpu_time=2000,
|
max_cpu_time=2000,
|
||||||
max_memory=200000000,
|
max_memory=2000000000,
|
||||||
args=compile_args,
|
args=compile_args,
|
||||||
env=["PATH=" + os.environ["PATH"]],
|
env=["PATH=" + os.environ["PATH"]],
|
||||||
use_sandbox=False)
|
use_sandbox=False)
|
||||||
|
|||||||
@ -7,7 +7,7 @@ languages = {
|
|||||||
"src_name": "main.c",
|
"src_name": "main.c",
|
||||||
"code": 1,
|
"code": 1,
|
||||||
"syscalls": "!execve:k,flock:k,ptrace:k,sync:k,fdatasync:k,fsync:k,msync,sync_file_range:k,syncfs:k,unshare:k,setns:k,clone:k,query_module:k,sysinfo:k,syslog:k,sysfs:k",
|
"syscalls": "!execve:k,flock:k,ptrace:k,sync:k,fdatasync:k,fsync:k,msync,sync_file_range:k,syncfs:k,unshare:k,setns:k,clone:k,query_module:k,sysinfo:k,syslog:k,sysfs:k",
|
||||||
"compile_command": "gcc -DONLINE_JUDGE -O2 -w -std=c99 {src_path} -lm -o {exe_path}/main",
|
"compile_command": "/usr/bin/gcc -DONLINE_JUDGE -O2 -w -std=c99 {src_path} -lm -o {exe_path}/main",
|
||||||
"execute_command": "{exe_path}/main"
|
"execute_command": "{exe_path}/main"
|
||||||
},
|
},
|
||||||
2: {
|
2: {
|
||||||
@ -15,7 +15,7 @@ languages = {
|
|||||||
"src_name": "main.cpp",
|
"src_name": "main.cpp",
|
||||||
"code": 2,
|
"code": 2,
|
||||||
"syscalls": "!execve:k,flock:k,ptrace:k,sync:k,fdatasync:k,fsync:k,msync,sync_file_range:k,syncfs:k,unshare:k,setns:k,clone:k,query_module:k,sysinfo:k,syslog:k,sysfs:k",
|
"syscalls": "!execve:k,flock:k,ptrace:k,sync:k,fdatasync:k,fsync:k,msync,sync_file_range:k,syncfs:k,unshare:k,setns:k,clone:k,query_module:k,sysinfo:k,syslog:k,sysfs:k",
|
||||||
"compile_command": "g++ -DONLINE_JUDGE -O2 -w -std=c++11 {src_path} -lm -o {exe_path}/main",
|
"compile_command": "/usr/bin/g++ -DONLINE_JUDGE -O2 -w -std=c++11 {src_path} -lm -o {exe_path}/main",
|
||||||
"execute_command": "{exe_path}/main"
|
"execute_command": "{exe_path}/main"
|
||||||
},
|
},
|
||||||
3: {
|
3: {
|
||||||
@ -23,7 +23,7 @@ languages = {
|
|||||||
"src_name": "Main.java",
|
"src_name": "Main.java",
|
||||||
"code": 3,
|
"code": 3,
|
||||||
"syscalls": "!execve:k,flock:k,ptrace:k,sync:k,fdatasync:k,fsync:k,msync,sync_file_range:k,syncfs:k,unshare:k,setns:k,clone[a&268435456==268435456]:k,query_module:k,sysinfo:k,syslog:k,sysfs:k",
|
"syscalls": "!execve:k,flock:k,ptrace:k,sync:k,fdatasync:k,fsync:k,msync,sync_file_range:k,syncfs:k,unshare:k,setns:k,clone[a&268435456==268435456]:k,query_module:k,sysinfo:k,syslog:k,sysfs:k",
|
||||||
"compile_command": "javac {src_path} -d {exe_path}",
|
"compile_command": "/usr/bin/javac {src_path} -d {exe_path}",
|
||||||
"execute_command": "java -cp {exe_path} -Djava.security.manager -Djava.security.policy==policy Main"
|
"execute_command": "java -cp {exe_path} -Djava.security.manager -Djava.security.policy==policy Main"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user