Open enedil opened 7 years ago
It's actually pretty straightforward to add a basic support for Python using the mechanism created for Java solutions, which are not compiled to binaries, but to bytecode, instead. The tricky part is making it secure, especially that, the currently used supervisor is not open-sourced. In case you can disregard this, the current source->execution flow for Java is as follows:
In the codebase you'll encounter three main concepts:
Correct me if I'm wrong, but would it be as secure as it's with C solutions if Python was translated to C and then graded and executed as any other C solution?
It depends on the translation. AFAIU Cython creates Python extensions, which still require the Python runtime to run inside the supervisor. So, from the security standpoint, it doesn't matter, if the code is compiled or interpreted by Python. The issue is that, the supervisor might be too harsh for the runtime – it allows only a very limited subset of syscalls. If the Python code would be translated to vanilla C/C++, limited only to the stdlib, it would be another story.
We switched to from the closed-source supervisor to sio2jail, and as I've said in sio2project/oioioi#9, we have a working support for Python, up and running on sio2.mimuw.edu.pl
. The relevant patches are in the process of code review before inclusion in the official codebase.
We switched to from the closed-source supervisor to sio2jail, and as I've said in sio2project/oioioi#9, we have a working support for Python, up and running on
sio2.mimuw.edu.pl
. The relevant patches are in the process of code review before inclusion in the official codebase.
Any progress on this?
It needs some unit tests, and nobody has time and energy to write them
Hello. I was thinking of possibility of a work around for running Python with oioioi. Currently project requires to run a binary. This could be resolved using Cython - Python code would be transpiled to C or C++ source and then compiled with appropriate compiler. This however would impose double step in compilation with seems to break the current process as there is no support for variable number of steps which produce binary. Any guidance on whether it is even needed and if so, how to proceed?