Compare commits

...

4 Commits

Author SHA1 Message Date
Gabriel Francischini C. Pereira 32a548daa0
Merge fc33860983 into 647bc3a7c7 2024-04-08 11:47:21 +03:00
Ahmed Wael 647bc3a7c7
handle stdout and stderr limits properly (#643)
* handle stdout and stderr limits proberly

Co-authored-by: Omar Brikaa <brikaaomar@gmail.com>

* added environment to docker compose

---------

Co-authored-by: Omar Brikaa <brikaaomar@gmail.com>
2024-01-26 19:41:28 +13:00
Thomas Hobson fc33860983
Merge branch 'master' into add-hy-1.0a4 2022-10-15 22:14:07 +13:00
Gabriel F 0a5a5cc2f8 added hy 1.0a4 2022-06-16 16:31:21 -03:00
7 changed files with 50 additions and 2 deletions

View File

@ -221,7 +221,7 @@ class Job {
proc.stderr.on('data', async data => {
if (event_bus !== null) {
event_bus.emit('stderr', data);
} else if (stderr.length > this.runtime.output_max_size) {
} else if ((stderr.length + data.length) > this.runtime.output_max_size) {
this.logger.info(`stderr length exceeded`);
try {
process.kill(proc.pid, 'SIGKILL');
@ -242,7 +242,7 @@ class Job {
proc.stdout.on('data', async data => {
if (event_bus !== null) {
event_bus.emit('stdout', data);
} else if (stdout.length > this.runtime.output_max_size) {
} else if ((stdout.length + data.length) > this.runtime.output_max_size) {
this.logger.info(`stdout length exceeded`);
try {
process.kill(proc.pid, 'SIGKILL');

View File

@ -0,0 +1,22 @@
#!/bin/bash
PREFIX=$(realpath $(dirname $0))
mkdir -p build
cd build
curl "https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz" -o python.tar.gz
tar xzf python.tar.gz --strip-components=1
rm python.tar.gz
./configure --prefix "$PREFIX" --with-ensurepip=install
make -j$(nproc)
make install -j$(nproc)
cd ..
rm -rf build
bin/pip3 install numpy scipy pandas pycrypto whoosh bcrypt passlib sympy
bin/pip3 install --pre hy==1.0a4 hyrule==0.1 toolz multipledispatch funcy funcy_chain pyrsistent

View File

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

View File

@ -0,0 +1,5 @@
{
"language": "hy",
"version": "1.0a4",
"aliases": ["hy", "hy1.0", "hy1.0a4"]
}

3
packages/hy/1.0a4/run Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
hy "$@"

16
packages/hy/1.0a4/test.hy Normal file
View File

@ -0,0 +1,16 @@
(print (cut "abcdef" 1 4))
(defn test [a b [c None] [d "x"] #* e]
[a b c d e])
(print (test 1 2)) ; => [1, 2, None, 'x', ()]
(print (test 1 2 3 4 5 6 7)) ; => [1, 2, 3, 4, (5, 6, 7)]
(import math)
(print (math.sqrt 2))
(import hyrule [inc])
(require hyrule [assoc])
(print (list (map inc [1 2 3])))
(setv d {})
(assoc d "a" 1 "b" 2)
(print d)

View File

@ -344,6 +344,7 @@ Content-Type: application/json
`groovy`,
`haskell`,
`husk`,
`hy`,
`iverilog`,
`japt`,
`java`,