Skip to content

Commit eac2a37

Browse files
committed
Merge branch 'release/1.20191126'
2 parents 1bc42b9 + 8e2df33 commit eac2a37

File tree

14 files changed

+149
-45
lines changed

14 files changed

+149
-45
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
language: python
2-
python: 2.7
2+
python:
3+
- 2.7
4+
- 3.7
35

46
script: py.test

admin/update_docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -e
33

4-
KOTLIN_VERSION=1.2.71
4+
KOTLIN_VERSION=1.3.50
55

66

77
TAG=develop

debian/changelog

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
1+
kattis-problemtools (1.20191126) bionic; urgency=medium
2+
3+
[ Per Austrin ]
4+
* Add Cobol to default language config
5+
6+
[ Greg Hamerly ]
7+
* This would make problemtools consistent with Kattis.
8+
9+
[ Simon Lindholm ]
10+
* Show input validator output on failure
11+
* Require that graders exit with return code 0
12+
13+
[ Greg Hamerly ]
14+
* require plasTeX version 1.0 for python2 compatibility
15+
16+
[ Simon Lindholm ]
17+
* Reset signal dispositions before running exec
18+
19+
[ Thore Husfeldt ]
20+
* Work around pipe2 on non-linux
21+
22+
[ Greg Hamerly ]
23+
* verifyproblem.py: check for invalid characters in data (directories and filenames)
24+
25+
[ Per Austrin ]
26+
* Reenable Python3 in the setup script
27+
28+
[ Pehr Söderman ]
29+
* Build debian for python3
30+
* Fixing type checks to use issinstance and be both python2 and python3 compatible.
31+
* Removed a type check for long (it will fail on python3, where a separate long does not exist). Added in a type check for string types instead.
32+
* Require python 3.7
33+
* Make travis run tests for python 3.7 as well.
34+
* Add fsharp to languages.yaml
35+
36+
[ Per Austrin ]
37+
* [latex document class] don't litter sample directory with .pstmp files (fixes #136)
38+
* [docker] bump Kotlin version in images to the one currently used in ICPC
39+
40+
-- Per Austrin <austrin@kattis.com> Tue, 26 Nov 2019 21:05:14 +0100
41+
142
kattis-problemtools (1.20190901) bionic; urgency=medium
243

344
[ Greg Hamerly ]

debian/control

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ Source: kattis-problemtools
22
Section: devel
33
Priority: optional
44
Maintainer: Per Austrin <austrin@kattis.com>
5-
Build-Depends: debhelper (>= 8.0.0), g++ (>= 4.8), dh-python, python (>= 2.6.6-3~), python-setuptools, python-pytest, python-yaml, libboost-regex-dev, libgmp-dev, automake, autoconf
5+
Build-Depends: debhelper (>= 8.0.0), g++ (>= 4.8), dh-python, python (>= 2.6.6-3~), python3 (>=3.7), python-setuptools, python-pytest, python-yaml, libboost-regex-dev, libgmp-dev, automake, autoconf
66
Standards-Version: 3.9.4
77
Homepage: https://github.com/Kattis/problemtools
8+
X-Python3-Version: 3.7
89

910
Package: kattis-problemtools
1011
Architecture: any
11-
Depends: ${shlibs:Depends}, ${python:Depends}, ${misc:Depends}, python-yaml, python-plastex, python-pkg-resources, texlive-latex-recommended, texlive-fonts-recommended, texlive-latex-extra, texlive-generic-recommended, texlive-lang-cyrillic, tidy, ghostscript
12+
Depends: ${shlibs:Depends}, ${python:Depends}, ${python3:Depends}, ${misc:Depends}, python-yaml, python-plastex, python-pkg-resources, texlive-latex-recommended, texlive-fonts-recommended, texlive-latex-extra, texlive-generic-recommended, texlive-lang-cyrillic, tidy, ghostscript
1213
Recommends: gcc, g++
1314
Description: Kattis Problem Tools
1415
These are tools to manage and verify problem packages in the

debian/rules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ export PYBUILD_TEST_PYTEST=1
1212
export no_proxy=github.com
1313

1414
%:
15-
dh $@ --with python2 --buildsystem=pybuild
15+
dh $@ --with python2,python3 --buildsystem=pybuild

problemtools/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Auto-generated from git changelog, do not edit!
2-
__version__ = '1.20190901'
2+
__version__ = '1.20191126'

problemtools/config/languages.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ cpp:
105105
name: 'C++'
106106
priority: 1000
107107
files: '*.cc *.C *.cpp *.cxx *.c++'
108-
compile: '/usr/bin/g++ -g -O2 -std=gnu++14 -static -o {binary} {files}'
108+
compile: '/usr/bin/g++ -g -O2 -std=gnu++17 -static -o {binary} {files}'
109109
run: '{binary}'
110110

111111
csharp:
@@ -115,6 +115,20 @@ csharp:
115115
compile: '/usr/bin/mcs -out:{binary}.exe -optimize+ -r:System.Numerics {files}'
116116
run: '/usr/bin/mono {binary}.exe'
117117

118+
cobol:
119+
name: 'Cobol'
120+
priority: 50
121+
files: '*.cob'
122+
compile: '/usr/bin/cobc -o {binary} -g -O2 -std=default -free -x -static {files}'
123+
run: '{binary}'
124+
125+
fsharp:
126+
name: 'F#'
127+
priority: 675
128+
files: '*.fs'
129+
compile: '/usr/bin/fsharpc --out:{binary}.exe --optimize+ -r:System.Numerics {files}'
130+
run: '/usr/bin/mono {binary}.exe'
131+
118132
go:
119133
name: 'Go'
120134
priority: 400

problemtools/languages.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
"""
55
import fnmatch
66
import re
7-
import os
87
import string
9-
import types
10-
import yaml.parser
8+
from six import string_types
119

1210
from . import config
1311

@@ -77,12 +75,12 @@ def update(self, values):
7775
for (key, value) in values.items():
7876
# Check type
7977
if key == 'priority':
80-
if type(value) != int:
78+
if not isinstance(value, int):
8179
raise LanguageConfigError(
8280
'Language %s: priority must be integer but is %s.'
8381
% (self.lang_id, type(value)))
8482
else:
85-
if type(value) != bytes:
83+
if not isinstance(value, string_types):
8684
raise LanguageConfigError(
8785
'Language %s: %s must be string but is %s.'
8886
% (self.lang_id, key, type(value)))
@@ -209,18 +207,18 @@ def update(self, data):
209207
for a language already in the set, the configuration
210208
for that language will be overridden and updated.
211209
"""
212-
if type(data) is not dict:
210+
if not isinstance(data, dict):
213211
raise LanguageConfigError(
214212
'Config file error: content must be a dictionary, but is %s.'
215213
% (type(data)))
216214

217215
for (lang_id, lang_spec) in data.items():
218-
if type(lang_id) is not bytes:
216+
if not isinstance(lang_id, string_types):
219217
raise LanguageConfigError(
220218
'Config file error: language IDs must be strings, but %s is %s.'
221219
% (lang_id, type(lang_id)))
222220

223-
if type(lang_spec) is not dict:
221+
if not isinstance(lang_spec, dict):
224222
raise LanguageConfigError(
225223
'Config file error: language spec must be a dictionary, but spec of language %s is %s.'
226224
% (lang_id, type(lang_spec)))

problemtools/run/program.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,35 @@ def __run_wait(argv, infile, outfile, errfile, timelim, memlim):
7676
pid = os.fork()
7777
if pid == 0: # child
7878
try:
79+
# The Python interpreter internally sets some signal dispositions
80+
# to SIG_IGN (notably SIGPIPE), and unless we reset them manually
81+
# this leaks through to the program we exec. That can has some
82+
# funny side effects, like programs not crashing as expected when
83+
# trying to write to an interactive validator that has terminated
84+
# and closed the read end of a pipe.
85+
#
86+
# This *shouldn't* cause any verdict changes given the setup for
87+
# interactive problems, but reset them anyway, for sanity.
88+
if hasattr(signal, "SIGPIPE"):
89+
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
90+
if hasattr(signal, "SIGXFZ"):
91+
signal.signal(signal.SIGXFZ, signal.SIG_DFL)
92+
if hasattr(signal, "SIGXFSZ"):
93+
signal.signal(signal.SIGXFSZ, signal.SIG_DFL)
94+
7995
if timelim is not None:
8096
limit.try_limit(resource.RLIMIT_CPU, timelim, timelim + 1)
8197
if memlim is not None:
8298
limit.try_limit(resource.RLIMIT_AS, memlim * (1024**2), resource.RLIM_INFINITY)
8399
limit.try_limit(resource.RLIMIT_STACK,
84100
resource.RLIM_INFINITY, resource.RLIM_INFINITY)
101+
85102
Program.__setfd(0, infile, os.O_RDONLY)
86103
Program.__setfd(1, outfile,
87104
os.O_WRONLY | os.O_CREAT | os.O_TRUNC)
88105
Program.__setfd(2, errfile,
89106
os.O_WRONLY | os.O_CREAT | os.O_TRUNC)
107+
90108
os.execvp(argv[0], argv)
91109
except Exception as exc:
92110
print("Oops. Fatal error in child process:")

problemtools/templates/latex/problemset.cls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@
354354
\hline
355355
\parbox[t]{0.55\textwidth}{
356356
\vspace{-0.49cm}
357-
\lstinputlisting[inputencoding=utf8/latin1,basicstyle=\ttfamily]{#4.pstmp}
357+
\lstinputlisting[inputencoding=utf8/latin1,basicstyle=\ttfamily]{\jobname.pstmp}
358358
\vspace{-0.21cm}
359359
}\\
360360
\hline
@@ -372,7 +372,7 @@
372372
\if x\mode\else
373373
\if \mode\curmode\else
374374
\showmessage
375-
\immediate\openout\ps@sampleinteractionmsg=#4.pstmp
375+
\immediate\openout\ps@sampleinteractionmsg=\jobname.pstmp
376376
\edef\curmode{\mode}
377377
\fi
378378
\StrGobbleLeft{\ps@interactionline}{1}[\ps@interactionline]

0 commit comments

Comments
 (0)