rbx.cp 0.5.73__py3-none-any.whl → 0.6.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rbx/annotations.py +21 -1
- rbx/box/cd.py +11 -1
- rbx/box/checkers.py +9 -1
- rbx/box/cli.py +59 -46
- rbx/box/code.py +142 -3
- rbx/box/contest/build_contest_statements.py +44 -34
- rbx/box/contest/contest_package.py +4 -7
- rbx/box/contest/main.py +7 -58
- rbx/box/contest/schema.py +52 -8
- rbx/box/contest/statements.py +53 -25
- rbx/box/creation.py +3 -36
- rbx/box/environment.py +21 -9
- rbx/box/fields.py +35 -0
- rbx/box/lang.py +27 -0
- rbx/box/linting.py +26 -0
- rbx/box/package.py +4 -35
- rbx/box/packaging/boca/packager.py +48 -5
- rbx/box/packaging/contest_main.py +13 -0
- rbx/box/packaging/main.py +13 -2
- rbx/box/packaging/packager.py +4 -4
- rbx/box/packaging/pkg/packager.py +142 -0
- rbx/box/packaging/polygon/packager.py +2 -24
- rbx/box/packaging/polygon/upload.py +35 -17
- rbx/box/presets/__init__.py +362 -281
- rbx/box/presets/lock_schema.py +1 -2
- rbx/box/presets/schema.py +13 -5
- rbx/box/remote.py +2 -2
- rbx/box/retries.py +8 -0
- rbx/box/schema.py +82 -19
- rbx/box/solutions.py +77 -15
- rbx/box/statements/build_statements.py +44 -27
- rbx/box/statements/builders.py +18 -10
- rbx/box/statements/expander.py +49 -0
- rbx/box/statements/latex_jinja.py +61 -4
- rbx/box/statements/schema.py +33 -9
- rbx/box/stats.py +92 -0
- rbx/box/tasks.py +6 -3
- rbx/box/testcase_utils.py +19 -47
- rbx/box/tooling/__init__.py +0 -0
- rbx/box/tooling/boca/__init__.py +0 -0
- rbx/box/tooling/boca/main.py +13 -0
- rbx/box/tooling/boca/scrape.py +34 -0
- rbx/box/{packaging/boca/upload.py → tooling/boca/scraper.py} +77 -8
- rbx/box/tooling/main.py +8 -0
- rbx/box/ui/utils/run_ui.py +1 -1
- rbx/box/ui/widgets/interaction_box.py +19 -1
- rbx/grading/caching.py +18 -2
- rbx/grading/judge/sandbox.py +60 -5
- rbx/grading/judge/sandboxes/isolate.py +1 -0
- rbx/grading/judge/sandboxes/stupid_sandbox.py +11 -5
- rbx/grading/judge/sandboxes/timeit.py +36 -15
- rbx/grading/processing_context.py +62 -78
- rbx/grading/steps.py +92 -40
- rbx/resources/packagers/boca/checker.sh +4 -1
- rbx/resources/packagers/boca/compile/c +2 -6
- rbx/resources/packagers/boca/compile/cc +2 -6
- rbx/resources/packagers/boca/compile/cpp +2 -6
- rbx/resources/packagers/boca/compile/java +1 -6
- rbx/resources/packagers/boca/compile/kt +24 -28
- rbx/resources/packagers/boca/compile/py2 +2 -6
- rbx/resources/packagers/boca/compile/py3 +2 -6
- rbx/resources/packagers/boca/interactive/c +15 -83
- rbx/resources/packagers/boca/interactive/cc +15 -83
- rbx/resources/packagers/boca/interactive/cpp +15 -83
- rbx/resources/packagers/boca/interactive/java +15 -88
- rbx/resources/packagers/boca/interactive/kt +15 -88
- rbx/resources/packagers/boca/interactive/py2 +15 -88
- rbx/resources/packagers/boca/interactive/py3 +15 -88
- rbx/resources/packagers/boca/interactor_compile.sh +5 -2
- rbx/resources/packagers/boca/interactor_run.sh +174 -0
- rbx/resources/packagers/boca/safeexec.c +530 -0
- rbx/resources/packagers/boca/safeexec_compile.sh +49 -0
- rbx/resources/presets/default/contest/contest.rbx.yml +9 -8
- rbx/resources/presets/default/problem/problem.rbx.yml +38 -26
- rbx/resources/presets/default/problem/random.txt +3 -1
- rbx/resources/presets/default/problem/rbx.h +92 -0
- rbx/resources/presets/default/problem/statement/statement.rbx.tex +4 -7
- rbx/resources/presets/default/problem/validator.cpp +8 -8
- rbx/resources/templates/rbx.h +2 -3
- {rbx_cp-0.5.73.dist-info → rbx_cp-0.6.1.dist-info}/METADATA +23 -6
- {rbx_cp-0.5.73.dist-info → rbx_cp-0.6.1.dist-info}/RECORD +84 -71
- {rbx_cp-0.5.73.dist-info → rbx_cp-0.6.1.dist-info}/WHEEL +1 -1
- rbx/resources/packagers/boca/compile/pas +0 -172
- rbx/resources/presets/default/problem/statement/projecao.png +0 -0
- {rbx_cp-0.5.73.dist-info → rbx_cp-0.6.1.dist-info}/LICENSE +0 -0
- {rbx_cp-0.5.73.dist-info → rbx_cp-0.6.1.dist-info}/entry_points.txt +0 -0
@@ -1,172 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
# ////////////////////////////////////////////////////////////////////////////////
|
3
|
-
# //BOCA Online Contest Administrator
|
4
|
-
# // Copyright (C) 2003-2012 by BOCA System (bocasystem@gmail.com)
|
5
|
-
# //
|
6
|
-
# // This program is free software: you can redistribute it and/or modify
|
7
|
-
# // it under the terms of the GNU General Public License as published by
|
8
|
-
# // the Free Software Foundation, either version 3 of the License, or
|
9
|
-
# // (at your option) any later version.
|
10
|
-
# //
|
11
|
-
# // This program is distributed in the hope that it will be useful,
|
12
|
-
# // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
-
# // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
-
# // GNU General Public License for more details.
|
15
|
-
# // You should have received a copy of the GNU General Public License
|
16
|
-
# // along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
# ////////////////////////////////////////////////////////////////////////////////
|
18
|
-
#Last modified: 28/aug/2012 by cassio@ime.usp.br
|
19
|
-
#
|
20
|
-
# parameters are:
|
21
|
-
# $1 source_file
|
22
|
-
# $2 exe_file (default run.exe)
|
23
|
-
# $3 timelimit (optional, limit to run all the repetitions, by default only one repetition)
|
24
|
-
# $4 maximum allowed memory (in MBytes, default 512M)
|
25
|
-
#
|
26
|
-
# the output of the submission should be directed to the standard output
|
27
|
-
#
|
28
|
-
# the return code show what happened (according to safeexec):
|
29
|
-
# 0 ok
|
30
|
-
# 1 compile error
|
31
|
-
# 2 runtime error
|
32
|
-
# 3 timelimit exceeded
|
33
|
-
# 4 internal error
|
34
|
-
# 5 parameter error
|
35
|
-
# 6 internal error
|
36
|
-
# 7 memory limit exceeded
|
37
|
-
# 8 security threat
|
38
|
-
# 9 runtime error
|
39
|
-
# other_codes are unknown to boca: in this case BOCA will present the
|
40
|
-
# last line of standard output to the judge
|
41
|
-
|
42
|
-
umask 0022
|
43
|
-
|
44
|
-
if [ "$1" == "" ]; then
|
45
|
-
echo "parameter problem"
|
46
|
-
exit 43
|
47
|
-
fi
|
48
|
-
if [ ! -r "$1" ]; then
|
49
|
-
echo "$1 not found or it's not readable"
|
50
|
-
exit 44
|
51
|
-
fi
|
52
|
-
name="$1"
|
53
|
-
if [ ! -r "$1" ]; then
|
54
|
-
echo "$1 not found or it's not readable"
|
55
|
-
exit 44
|
56
|
-
fi
|
57
|
-
mkdir -p src
|
58
|
-
if [ "${name##*.}" == "zip" -a "${name##*.}" == "ZIP" ]; then
|
59
|
-
unzip "$name" -d src
|
60
|
-
name="*.c"
|
61
|
-
else
|
62
|
-
cp "$name" src
|
63
|
-
fi
|
64
|
-
id -u bocajail >/dev/null 2>/dev/null
|
65
|
-
if [ $? == 0 ]; then
|
66
|
-
bocau=`id -u bocajail`
|
67
|
-
bocag=`id -g bocajail`
|
68
|
-
chown bocajail.nogroup .
|
69
|
-
else
|
70
|
-
bocau=`id -u nobody`
|
71
|
-
bocag=`id -g nobody`
|
72
|
-
chown nobody.nogroup .
|
73
|
-
fi
|
74
|
-
if [ "$bocau" == "" -o "$bocag" == "" ]; then
|
75
|
-
echo "error finding user to run script"
|
76
|
-
exit 43
|
77
|
-
fi
|
78
|
-
|
79
|
-
# this script makes use of safeexec to execute the code with less privilegies
|
80
|
-
# make sure that directories below are correct.
|
81
|
-
sf=`which safeexec`
|
82
|
-
[ -x "$sf" ] || sf=/usr/bin/safeexec
|
83
|
-
if [ ! -x $sf ]; then
|
84
|
-
echo "$sf not found or it's not executable"
|
85
|
-
exit 46
|
86
|
-
fi
|
87
|
-
maxm=512000
|
88
|
-
if [ "$4" != "" ]; then
|
89
|
-
if [ "$4" -gt "512" ]; then
|
90
|
-
maxm=${4}000
|
91
|
-
fi
|
92
|
-
fi
|
93
|
-
|
94
|
-
# setting up the timelimit according to the problem
|
95
|
-
if [ "$3" == "" ]; then
|
96
|
-
time=5
|
97
|
-
else
|
98
|
-
time=$3
|
99
|
-
fi
|
100
|
-
let "ttime = $time + 30"
|
101
|
-
|
102
|
-
if [ "$2" == "" ]; then
|
103
|
-
exe=run.exe
|
104
|
-
else
|
105
|
-
exe=$2
|
106
|
-
fi
|
107
|
-
|
108
|
-
rm -f $exe compileit.retcode runit.retcode 2>/dev/null
|
109
|
-
cat <<EOF > compileit.sh
|
110
|
-
#!/bin/bash
|
111
|
-
cc=\`which fpc\`
|
112
|
-
[ -x "\$cc" ] || cc=/usr/bin/fpc
|
113
|
-
if [ ! -x "\$cc" ]; then
|
114
|
-
echo "\$cc not found or it's not executable"
|
115
|
-
exit 47
|
116
|
-
fi
|
117
|
-
cd src
|
118
|
-
"\$cc" -Xt -XS -O2 -o../$exe $name
|
119
|
-
echo \$? > ../compileit.retcode
|
120
|
-
exit 0
|
121
|
-
EOF
|
122
|
-
chmod 755 compileit.sh
|
123
|
-
|
124
|
-
cdir=`pwd`
|
125
|
-
echo "Current directory is $cdir" >&2
|
126
|
-
echo $cdir | grep -q "/bocajail"
|
127
|
-
if [ $? == 0 ]; then
|
128
|
-
cdir=`echo $cdir | sed "s/.*\/bocajail//"`
|
129
|
-
echo "Internal directory is $cdir"
|
130
|
-
cat <<EOF > runit.sh
|
131
|
-
#!/bin/bash
|
132
|
-
cd "$cdir"
|
133
|
-
[ -f /proc/cpuinfo ] || /bin/mount -t proc proc /proc
|
134
|
-
#/bin/mount --bind /dev /dev
|
135
|
-
[ -d /sys/kernel ] || /bin/mount -t sysfs sysfs /sys
|
136
|
-
$sf -r1 -F1000 -n0 -U$bocau -G$bocag -C. -ostdout0 -estderr0 -d$maxm -m$maxm -f20000 -t$ttime -T$ttime ./compileit.sh
|
137
|
-
echo \$? > runit.retcode
|
138
|
-
if [ ! -d /bocajail ]; then
|
139
|
-
/bin/umount /proc 2>/dev/null
|
140
|
-
#/bin/umount /dev
|
141
|
-
/bin/umount /sys 2>/dev/null
|
142
|
-
fi
|
143
|
-
EOF
|
144
|
-
chmod 755 runit.sh
|
145
|
-
chroot /bocajail "$cdir/runit.sh"
|
146
|
-
if [ -r runit.retcode ]; then
|
147
|
-
ret=`cat runit.retcode`
|
148
|
-
else
|
149
|
-
ret=99
|
150
|
-
fi
|
151
|
-
else
|
152
|
-
echo "COMPILATION IS NOT BEING CHROOTED -- THIS IS NOT AN IDEAL SETTING"
|
153
|
-
$sf -r1 -F1000 -n0 -U$bocau -G$bocag -C. -ostdout0 -estderr0 -d$maxm -m$maxm -f20000 -t$ttime -T$ttime ./compileit.sh
|
154
|
-
ret=$?
|
155
|
-
fi
|
156
|
-
if [ -f "stdout0" ]; then
|
157
|
-
cat "stdout0"
|
158
|
-
fi
|
159
|
-
if [ -f "stderr0" ]; then
|
160
|
-
cat "stderr0"
|
161
|
-
fi
|
162
|
-
rm -rf src/
|
163
|
-
if [ "$ret" != "0" ]; then
|
164
|
-
echo "Compilation Error: $ret"
|
165
|
-
exit $ret
|
166
|
-
fi
|
167
|
-
ret=`cat compileit.retcode`
|
168
|
-
if [ "$ret" != "0" ]; then
|
169
|
-
echo "Compilation Error: $ret"
|
170
|
-
ret=1
|
171
|
-
fi
|
172
|
-
exit $ret
|
Binary file
|
File without changes
|
File without changes
|