Skip to content

Commit d7cc716

Browse files
mpsijmvmcj
authored andcommitted
#2307 Multi-pass: copy feedback dir between passes (but remove nextpass.in)
(cherry picked from commit e2de765)
1 parent cd74bb3 commit d7cc716

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

judge/judgedaemon.main.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,6 +1410,15 @@ function judge(array $judgeTask): bool
14101410
$passdir = $testcasedir . '/' . $passCnt;
14111411
mkdir($passdir, 0755, true);
14121412

1413+
if ($passCnt > 1) {
1414+
$cpcmd = 'cp -R ' . $passdir . '/../' . ($passCnt - 1) . '/feedback ' . $passdir . '/';
1415+
system($cpcmd);
1416+
logmsg(LOG_INFO, " Copying feedback dir from pass " . ($passCnt - 1) . ': ' . $cpcmd);
1417+
$rmcmd = 'rm ' . $passdir . '/feedback/nextpass.in';
1418+
system($rmcmd);
1419+
logmsg(LOG_INFO, " Executing " . $rmcmd);
1420+
}
1421+
14131422
// Copy program with all possible additional files to testcase
14141423
// dir. Use hardlinks to preserve space with big executables.
14151424
$programdir = $passdir . '/execdir';

judge/testcase_run.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ if [ $COMBINED_RUN_COMPARE -eq 1 ]; then
195195
# A combined run and compare script may now already need the
196196
# feedback directory, and perhaps access to the test answers (but
197197
# only the original that lives outside the chroot).
198-
mkdir feedback
198+
mkdir -p feedback
199199
RUNARGS="$RUNARGS $TESTOUT compare.meta feedback"
200200
fi
201201

@@ -232,8 +232,8 @@ if [ $COMBINED_RUN_COMPARE -eq 0 ]; then
232232

233233
exitcode=0
234234
# Create dir for feedback files and make it writable for $RUNUSER
235-
mkdir feedback
236-
chmod a+w feedback
235+
mkdir -p feedback
236+
chmod -R a+w feedback
237237

238238
runcheck $GAINROOT "$RUNGUARD" ${DEBUG:+-v} $CPUSET_OPT -u "$RUNUSER" -g "$RUNGROUP" \
239239
-m $SCRIPTMEMLIMIT -t $SCRIPTTIMELIMIT --no-core \

0 commit comments

Comments
 (0)