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

Fix SBCL on Debian 10 #552

Merged
merged 3 commits into from
Oct 11, 2019
Merged
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: 1 addition & 1 deletion .travis.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'F95', 'GO', 'GROOVY', 'HASK', 'JAVA8', 'OCAML', 'SCALA', 'MONOCS', 'MONOVB',
'PAS', 'PRO', 'GAS32', 'GAS64', 'LUA', 'NASM', 'NASM64',
'PERL', 'PHP', 'PY2', 'PY3', 'PYPY', 'PYPY3', 'RKT',
'RUBY2', 'RUST', 'SCM', 'SED', 'SWIFT', 'TCL', 'TEXT']
'RUBY2', 'RUST', 'SCM', 'SED', 'SWIFT', 'SBCL', 'TCL', 'TEXT']

RVM_DIR = os.path.expanduser('~/.rvm/rubies/')
PYENV_DIR = '/opt/python/'
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ addons:
- dart/stable
- scala
- racket
- sbcl
matrix:
include:
- name: flake8
Expand Down
11 changes: 9 additions & 2 deletions dmoj/executors/SBCL.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,22 @@ class Executor(NullStdoutMixin, ScriptDirectoryMixin, CompiledExecutor):
command = 'sbcl'
syscalls = ['personality', 'poll']
test_program = '(write-line (read-line))'
address_grace = 1048576 * 2 # *wipes brow*
address_grace = 262144
data_grace = 262144

compile_script = '''(compile-file "{code}")'''

def get_compile_args(self):
return [self.get_command(), '--eval', self.compile_script.format(code=self._code), '--quit']

def get_cmdline(self):
return [self.get_command(), '--noinform', '--load', self.problem + ".fasl", '--quit', '--end-toplevel-options']
return [self.get_command(), '--dynamic-space-size', str(int(self.__memory_limit / 1024.0 + 1)),
'--noinform', '--no-sysinit', '--no-userinit', '--load', self.problem + ".fasl",
'--quit', '--end-toplevel-options']

def launch(self, *args, **kwargs):
self.__memory_limit = kwargs['memory']
return super().launch(*args, **kwargs)

def get_executable(self):
return self.get_command()