Compare commits
4 Commits
c358cd1ed5
...
edc422b1ce
Author | SHA1 | Date |
---|---|---|
|
edc422b1ce | |
|
c54bd64372 | |
|
1d55a41a2d | |
|
6ef0cdf7b4 |
|
@ -156,7 +156,11 @@ class Job {
|
||||||
'-s',
|
'-s',
|
||||||
'-c',
|
'-c',
|
||||||
'/box/submission',
|
'/box/submission',
|
||||||
'-e',
|
'-E',
|
||||||
|
'HOME=/tmp',
|
||||||
|
...this.runtime.env_vars.flat_map(v => ['-E', v]),
|
||||||
|
'-E',
|
||||||
|
`PISTON_LANGUAGE=${this.runtime.language}`,
|
||||||
`--dir=${this.runtime.pkgdir}`,
|
`--dir=${this.runtime.pkgdir}`,
|
||||||
`--dir=/etc:noexec`,
|
`--dir=/etc:noexec`,
|
||||||
`--processes=${this.runtime.max_process_count}`,
|
`--processes=${this.runtime.max_process_count}`,
|
||||||
|
@ -175,10 +179,6 @@ class Job {
|
||||||
...args,
|
...args,
|
||||||
],
|
],
|
||||||
{
|
{
|
||||||
env: {
|
|
||||||
...this.runtime.env_vars,
|
|
||||||
PISTON_LANGUAGE: this.runtime.language,
|
|
||||||
},
|
|
||||||
stdio: 'pipe',
|
stdio: 'pipe',
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -178,15 +178,7 @@ class Runtime {
|
||||||
const env_file = path.join(this.pkgdir, '.env');
|
const env_file = path.join(this.pkgdir, '.env');
|
||||||
const env_content = fss.read_file_sync(env_file).toString();
|
const env_content = fss.read_file_sync(env_file).toString();
|
||||||
|
|
||||||
this._env_vars = {};
|
this._env_vars = env_content.trim().split('\n');
|
||||||
|
|
||||||
env_content
|
|
||||||
.trim()
|
|
||||||
.split('\n')
|
|
||||||
.map(line => line.split('=', 2))
|
|
||||||
.forEach(([key, val]) => {
|
|
||||||
this._env_vars[key.trim()] = val.trim();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this._env_vars;
|
return this._env_vars;
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
git clone "https://codeberg.org/ngn/k" k
|
||||||
|
cd k
|
||||||
|
|
||||||
|
git checkout 544d014afd8dd84b18c2011cabd3aa3d76571ca3
|
||||||
|
make CC=gcc
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# k path
|
||||||
|
export PATH=$PWD/bin:$PATH
|
||||||
|
export K_PATH=$PWD/k
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"language": "k",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"aliases": ["ngnk"]
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
$K_PATH/k "$@"
|
|
@ -0,0 +1 @@
|
||||||
|
`0:`c$2/'((1 0 0 1 1 1 1);(1 0 0 1 0 1 1))
|
Loading…
Reference in New Issue