sub prepare{
my ($name, $format) = @_;
+ our $errors;
my $basename = fileparse $name, qr/\.[^.]*/;
get_logger->trace("Preparing file $name...");
- open my $devnull, devnull;
- open my $errors, '>>compile-error';
- my $ret = open3 $devnull, $errors, undef, 'gruntmaster-compile', $format => $basename, $name;
- waitpid $ret, 0;
- close $devnull;
- close $errors;
+ $errors .= `gruntmaster-compile $format $basename $name 2>&1`;
+ $errors .= "\n";
die 'Compile error' if $?
}
my @results;
my @full_results = ();
my $meta = {};
+ our $errors = '';
try {
$meta = job_inmeta $job;
if (job_problem $job) {
}
prepare_files $meta;
+ chomp $errors;
my ($files, $generator, $runner, $judge, $testcnt) = map { $meta->{$_} or die "Required parameter missing: $_"} qw/files generator runner judge testcnt/;
set_job_result $job, $meta->{result};
set_job_result_text $job, $meta->{result_text};
set_job_results $job, \@full_results if scalar @full_results;
+ set_job_errors $job, $errors;
my $log = $meta->{contest} ? "ct/$meta->{contest}/log" : 'log';
PUBLISH gensrc => $job;