Skip to content

Commit

Permalink
Fix SBCL on Debian 10 (#552)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyene authored Oct 11, 2019
1 parent 24578e7 commit 07d1bb8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
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()

0 comments on commit 07d1bb8

Please sign in to comment.