Skip to content

Commit 8072c5e

Browse files
RiolkuXyene
authored andcommitted
executors: fix JVM config path detection
previously, an erroneous directory was chosen for the JVM config. To ensure a good path is chosen, we use a glob, and resolve the VM path.
1 parent 275349a commit 8072c5e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dmoj/executors/java_executor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import errno
2+
import glob
23
import os
34
import re
45
import subprocess
@@ -84,7 +85,8 @@ def get_fs(self):
8485
+ [ExactFile(self._agent_file)]
8586
+ [ExactDir(str(parent)) for parent in PurePath(self._agent_file).parents]
8687
)
87-
vm_config = Path(self.get_vm()).parent.parent / 'lib' / 'jvm.cfg'
88+
vm_parent = Path(os.path.realpath(self.get_vm())).parent.parent
89+
vm_config = Path(glob.glob(f'{vm_parent}/**/jvm.cfg', recursive=True)[0])
8890
if vm_config.is_symlink():
8991
fs += [RecursiveDir(os.path.dirname(os.path.realpath(vm_config)))]
9092
return fs

0 commit comments

Comments
 (0)