Compare commits

..

2 commits

Author SHA1 Message Date
scpchicken
c358cd1ed5
Merge 7199dd266e into 4e361dcf92 2024-10-12 00:07:32 +02:00
Hydrazer
7199dd266e pkg(k-1.0.0): Added k 1.0.0 2022-12-24 08:37:55 -07:00
9 changed files with 24 additions and 17 deletions

View file

@ -156,11 +156,7 @@ class Job {
'-s',
'-c',
'/box/submission',
'-E',
'HOME=/tmp',
...this.runtime.env_vars.flat_map(v => ['-E', v]),
'-E',
`PISTON_LANGUAGE=${this.runtime.language}`,
'-e',
`--dir=${this.runtime.pkgdir}`,
`--dir=/etc:noexec`,
`--processes=${this.runtime.max_process_count}`,
@ -179,6 +175,10 @@ class Job {
...args,
],
{
env: {
...this.runtime.env_vars,
PISTON_LANGUAGE: this.runtime.language,
},
stdio: 'pipe',
}
);

View file

@ -178,7 +178,15 @@ class Runtime {
const env_file = path.join(this.pkgdir, '.env');
const env_content = fss.read_file_sync(env_file).toString();
this._env_vars = env_content.trim().split('\n');
this._env_vars = {};
env_content
.trim()
.split('\n')
.map(line => line.split('=', 2))
.forEach(([key, val]) => {
this._env_vars[key.trim()] = val.trim();
});
}
return this._env_vars;

View file

@ -1,5 +0,0 @@
{
"language": "k",
"version": "1.0.0",
"aliases": ["ngnk"]
}

View file

@ -1 +0,0 @@
`0:`c$2/'((1 0 0 1 1 1 1);(1 0 0 1 0 1 1))

4
packages/k/1.0.0/build.sh → packages/ngnk/1.0.0/build.sh vendored Normal file → Executable file
View file

@ -5,5 +5,5 @@ set -e
git clone "https://codeberg.org/ngn/k" k
cd k
git checkout 544d014afd8dd84b18c2011cabd3aa3d76571ca3
make CC=gcc
git checkout 040f73b56f379a8298cb1747075c9e947dfe0e42
make CC=gcc

View file

@ -1,5 +1,4 @@
#!/usr/bin/env bash
# k path
export PATH=$PWD/bin:$PATH
export K_PATH=$PWD/k
export K_PATH=$PWD/k

5
packages/ngnk/1.0.0/metadata.json vendored Normal file
View file

@ -0,0 +1,5 @@
{
"language": "ngnk",
"version": "1.0.0",
"aliases": ["k"]
}

View file

@ -1,3 +1,3 @@
#!/usr/bin/env bash
$K_PATH/k "$@"
$K_PATH/k "$@"

1
packages/ngnk/1.0.0/test.k vendored Normal file
View file

@ -0,0 +1 @@
`0:"OK"