8000 Finally bump compiler & proot versions by top-sekret · Pull Request #36 · sio2project/sioworkers · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Finally bump compiler & proot versions #36

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@

# Sandboxed compilers:
'gcc4_8_2_c99 = sio.compilers.gcc:run_c_gcc4_8_2_c99',
'gcc12_2_0_c17 = sio.compilers.gcc:run_c_gcc12_2_0_c17',
'g++4_8_2_cpp11 = sio.compilers.gcc:run_cpp_gcc4_8_2_cpp11',
'g++12_2_0_cpp20 = sio.compilers.gcc:run_cpp_gcc12_2_0_cpp20',
'fpc2_6_2 = sio.compilers.fpc:run_pas_fpc2_6_2',
'java1_8 = sio.compilers.java:run_java1_8',

Expand Down
27 changes: 25 additions & 2 deletions sio/compilers/gcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ def gcc_4_8_2_c99(cls):
obj.options = ['-std=gnu99', '-static', '-O2', '-s', '-lm']
return obj

@classmethod
def gcc_12_2_0_c17(cls):
obj = cls('gcc.12_2_0')
obj.options = ['-std=c17', '-static', '-O3', '-lm']
return obj


class CPPCompiler(CStyleCompiler):
lang = 'cpp'
Expand All @@ -22,24 +28,41 @@ def gcc_4_8_2_cpp11(cls):
obj.options = ['-std=c++11', '-static', '-O2', '-s', '-lm']
return obj

@classmethod
def gcc_12_2_0_cpp20(cls):
obj = cls('gcc.12_2_0')
obj.compiler = 'g++'
obj.options = ['-std=c++20', '-static', '-O3']
return obj


def run_gcc4_8_2_c99(environ):
return CCompiler.gcc_4_8_2_c99().compile(environ)


def run_gcc12_2_0_c17(environ):
return CCompiler.gcc_12_2_0_c17().compile(environ)


def run_gcc_default(environ):
return CCompiler.gcc_4_8_2_c99().compile(environ)
return CCompiler.gcc_12_2_0_c17().compile(environ)


def run_gplusplus4_8_2_cpp11(environ):
return CPPCompiler.gcc_4_8_2_cpp11().compile(environ)


def run_gplusplus12_2_0_cpp20(environ):
return CPPCompiler.gcc_12_2_0_cpp20().compile(environ)


def run_gplusplus_default(environ):
return CPPCompiler.gcc_4_8_2_cpp11().compile(environ)
return CPPCompiler.gcc_12_2_0_cpp20().compile(environ)


run_c_default = run_gcc_default
run_c_gcc4_8_2_c99 = run_gcc4_8_2_c99
run_c_gcc12_2_0_c17 = run_gcc12_2_0_c17
run_cpp_default = run_gplusplus_default
run_cpp_gcc4_8_2_cpp11 = run_gplusplus4_8_2_cpp11
run_cpp_gcc12_2_0_cpp20 = run_gplusplus12_2_0_cpp20
2 changes: 1 addition & 1 deletion sio/workers/executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ class PRootExecutor(BaseExecutor):
def __init__(self, sandbox):
"""``sandbox`` has to be a sandbox name."""
self.chroot = get_sandbox(sandbox)
self.proot = SandboxExecutor('proot-sandbox')
self.proot = SandboxExecutor('proot-sandbox_amd64')

self.options = []
with self.chroot:
Expand Down
1 change: 1 addition & 0 deletions sio/workers/test/sources/inwer_argument.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <stdio.h>
#include <string.h>

int main(int argc, char *argv[]) {
if (argc != 2) {
Expand Down
1 change: 0 additions & 1 deletion sio/workers/test/sources/output-too-long.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

Expand Down
Loading
0