Compare commits

...

4 Commits

Author SHA1 Message Date
Slendi 45cfaaf391
Merge 99b03e20d0 into 1d55a41a2d 2025-03-15 09:24:54 +00:00
Omar Brikaa 1d55a41a2d
Explicitly provide env vars instead of inheriting them from parent (#703) 2025-02-08 20:46:46 +02:00
Omar Brikaa 6ef0cdf7b4
Provide HOME in sandbox (#702) 2025-02-08 15:10:50 +02:00
Slendi 99b03e20d0
pkg(holyc-1.0.0): Added holyc 1.0.0
This patch adds support for the HolyC programming language by Terry A.
Davis.

The compiler used is based on a modified version of the 3Days compiler.
Both 3Days and the fork used here do not have a specific version so
1.0.0 has been used and will be used forwards in future commits unless
3Days gets versioning (which it wont since development stopped).

Signed-off-by: Slendi <slendi@socopon.com>
2023-06-12 14:23:13 +03:00
7 changed files with 38 additions and 14 deletions

View File

@ -156,7 +156,11 @@ class Job {
'-s',
'-c',
'/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=/etc:noexec`,
`--processes=${this.runtime.max_process_count}`,
@ -175,10 +179,6 @@ class Job {
...args,
],
{
env: {
...this.runtime.env_vars,
PISTON_LANGUAGE: this.runtime.language,
},
stdio: 'pipe',
}
);

View File

@ -178,15 +178,7 @@ 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')
.map(line => line.split('=', 2))
.forEach(([key, val]) => {
this._env_vars[key.trim()] = val.trim();
});
this._env_vars = env_content.trim().split('\n');
}
return this._env_vars;

22
packages/holyc/1.0.0/build.sh vendored Executable file
View File

@ -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

1
packages/holyc/1.0.0/environment vendored Normal file
View File

@ -0,0 +1 @@
export PATH=$PWD/bin:$PATH

5
packages/holyc/1.0.0/metadata.json vendored Normal file
View File

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

3
packages/holyc/1.0.0/run vendored Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
3d_loader -T $PWD/bin/ -c "$@"

1
packages/holyc/1.0.0/test.HC vendored Normal file
View File

@ -0,0 +1 @@
"OK";