Compare commits
4 Commits
961fe5d067
...
45cfaaf391
Author | SHA1 | Date |
---|---|---|
|
45cfaaf391 | |
|
1d55a41a2d | |
|
6ef0cdf7b4 | |
|
99b03e20d0 |
|
@ -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,22 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
PREFIX=$(realpath $(dirname $0))
|
||||||
|
|
||||||
|
mkdir -p build
|
||||||
|
|
||||||
|
cd build
|
||||||
|
|
||||||
|
curl https://git.xslendi.xyz/slendi/3Days/archive/main.tar.gz -o 3days.tar.gz
|
||||||
|
|
||||||
|
tar xzf 3days.tar.gz --strip-components=1
|
||||||
|
rm 3days.tar.gz
|
||||||
|
|
||||||
|
make
|
||||||
|
|
||||||
|
cp -v 3d_loader $PREFIX/.
|
||||||
|
cp -rv T $PREFIX/.
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
rm -rf build
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
export PATH=$PWD/bin:$PATH
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"language": "holyc",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"aliases": ["hc"]
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
3d_loader -T $PWD/bin/ -c "$@"
|
|
@ -0,0 +1 @@
|
||||||
|
"OK";
|
Loading…
Reference in New Issue