Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executors: make Zig executor work with 0.8.1 #920

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dmoj/executors/ZIG.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ class Executor(CompiledExecutor):

pub fn main() !void {
const io = std.io;
const stdin = std.io.getStdIn().inStream();
const stdout = std.io.getStdOut().outStream();
const stdin = std.io.getStdIn().reader();
const stdout = std.io.getStdOut().writer();

var line_buf: [50]u8 = undefined;
while (try stdin.readUntilDelimiterOrEof(&line_buf, '\n')) |line| {
if (line.len == 0) break;
try stdout.print("{}", .{line});
try stdout.print("{s}", .{line});
}
}"""

Expand All @@ -28,7 +28,7 @@ def create_files(self, problem_id, source_code, *args, **kwargs):
super().create_files(problem_id, source_code, *args, **kwargs)

def get_compile_args(self):
return [self.get_command(), 'build-exe', self._code, '--release-safe', '--name', self.problem]
return [self.get_command(), 'build-exe', self._code, '-O', 'ReleaseSafe', '--name', self.problem]

@classmethod
def get_version_flags(cls, command):
Expand Down