-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathruntime-images.yml
More file actions
3106 lines (2979 loc) · 95.5 KB
/
Copy pathruntime-images.yml
File metadata and controls
3106 lines (2979 loc) · 95.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
shared_installs:
node24:
apt:
- curl
- xz-utils
script:
- export NODE_VERSION=24.15.0
- curl --retry 5 --retry-delay 2 --retry-connrefused -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz" -o /tmp/node.tar.xz
- rm -rf "/opt/node-v${NODE_VERSION}-linux-x64"
- mkdir -p /opt
- tar -xJf /tmp/node.tar.xz -C /opt
- ln -sfn "/opt/node-v${NODE_VERSION}-linux-x64/bin/node" /usr/local/bin/node
- ln -sfn "/opt/node-v${NODE_VERSION}-linux-x64/bin/node" /usr/local/bin/nodejs
- ln -sfn "/opt/node-v${NODE_VERSION}-linux-x64/bin/npm" /usr/local/bin/npm
- ln -sfn "/opt/node-v${NODE_VERSION}-linux-x64/bin/npx" /usr/local/bin/npx
- rm -f /tmp/node.tar.xz
libobjc16:
script:
- apt-get update -o APT::Get::List-Cleanup=false && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -t sid libobjc-16-dev && find /var/lib/apt/lists -mindepth 1 -delete
freebasic:
apt:
- curl
- gcc
- g++
- libc6-dev
- libncurses-dev
script:
- export FREEBASIC_VERSION=1.10.1
- echo 'deb http://deb.debian.org/debian bullseye main' > /etc/apt/sources.list.d/aonohako-freebasic-bullseye.list
- apt-get update -o APT::Get::List-Cleanup=false
- DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtinfo5
- rm -f /etc/apt/sources.list.d/aonohako-freebasic-bullseye.list
- rm -f /var/lib/apt/lists/deb.debian.org_debian_dists_bullseye_*
- curl --retry 5 --retry-delay 2 --retry-connrefused -fsSL "https://downloads.sourceforge.net/project/fbc/FreeBASIC-${FREEBASIC_VERSION}/Binaries-Linux/FreeBASIC-${FREEBASIC_VERSION}-linux-x86_64.tar.gz" -o /tmp/freebasic.tar.gz
- rm -rf /opt/freebasic
- mkdir -p /opt/freebasic
- tar -xzf /tmp/freebasic.tar.gz -C /opt/freebasic --strip-components=1
- printf '%s\n' '#!/usr/bin/env bash' 'exec /opt/freebasic/bin/fbc "$@"' > /usr/local/bin/fbc
- chmod 0755 /usr/local/bin/fbc
- rm -f /tmp/freebasic.tar.gz
gforth:
script:
- echo 'deb http://deb.debian.org/debian sid main' > /etc/apt/sources.list.d/aonohako-gforth-sid.list
- apt-get update -o APT::Get::List-Cleanup=false
- DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -t sid gforth
- find /var/lib/apt/lists -mindepth 1 -delete
languages:
plain:
install:
apt:
- gcc
- g++
- libc6-dev
- make
smoke:
command:
- /bin/sh
- -c
- |
printf '%s\n' '#include <stdio.h>' 'int main(void) {' ' puts("ok");' ' return 0;' '}' > Main.c
gcc -O2 -pipe Main.c -o Main
[ "$(./Main)" = ok ]
c:
smoke:
command:
- /bin/sh
- -c
- |
printf '%s\n' '#include <stdio.h>' 'int main(void) {' ' puts("ok");' ' return 0;' '}' > Main.c
gcc -O2 -pipe Main.c -o Main
[ "$(./Main)" = ok ]
cpp:
smoke:
command:
- /bin/sh
- -c
- |
printf '%s\n' '#include <iostream>' 'int main() {' ' std::cout << "ok\n";' ' return 0;' '}' > Main.cpp
g++ -O2 -pipe Main.cpp -o Main
[ "$(./Main)" = ok ]
printf '%s\n' \
'#include "testlib.h"' \
'int main(int argc, char *argv[]) {' \
' registerTestlibCmd(argc, argv);' \
' int expected = ans.readInt();' \
' int actual = ouf.readInt();' \
' if (expected != actual) quitf(_wa, "expected %d, found %d", expected, actual);' \
' quitf(_ok, "accepted");' \
'}' > Checker.cpp
g++ -std=c++17 -O2 -pipe Checker.cpp -o Checker
printf '%s\n' '1 2' > input.txt
printf '%s\n' '3' > answer.txt
printf '%s\n' '3' > output.txt
./Checker input.txt output.txt answer.txt
aheui:
install:
apt:
- python3
- python3-pip
pip:
- aheui==1.2.5
smoke:
command:
- /bin/sh
- -c
- |
printf '%s' '밞바밤밣받밞밞밞밦밞바밝밣바박박밦밞받밞받밞발밣받뱔희밞땨몋드떠받볋' > Main.aheui
output="$(aheui Main.aheui 2>/tmp/aheui.stderr || true)"
printf '%s\n' "${output}" | grep '^Hello, World!$'
apecode:
install:
apt:
- curl
- g++
- python3
- python3-pip
script:
- export APECODE_COMMIT=c7ae98d3dfc1713ecc800422a4c815628776e1e2
- export APECODE_SHA256=0ff71e149ec49a94211bb44b6a3d55e1290acb1387ca4f5f76a8f42f568ae629
- curl --retry 5 --retry-delay 2 --retry-connrefused -fsSL "https://codeload.github.com/seo-rii/apecode/tar.gz/${APECODE_COMMIT}" -o /tmp/apecode.tar.gz
- echo "${APECODE_SHA256} /tmp/apecode.tar.gz" | sha256sum -c -
- python3 -m pip install --break-system-packages --no-cache-dir /tmp/apecode.tar.gz
- rm -f /tmp/apecode.tar.gz
smoke:
command:
- bash
- -lc
- |
printf '%s\n' 'state main {' ' return true;' '}' > Main.ape
apecc --check Main.ape
apecc -o Main Main.ape
printf '%s\n' 1 3 '3 1 2' | ./Main | grep '^3 1 2$'
asm:
install:
apt:
- gcc
smoke:
command:
- bash
- -lc
- |
cat > Main.s <<'ASM'
.global _start
.section .text
_start:
mov $1, %rax
mov $1, %rdi
lea msg(%rip), %rsi
mov $3, %rdx
syscall
mov $60, %rax
xor %rdi, %rdi
syscall
.section .rodata
msg:
.ascii "ok\n"
ASM
gcc -nostdlib -static -no-pie Main.s -o Main
./Main | grep '^ok$'
cat > Broken.s <<'ASM'
.global _start
.section .text
_start:
mov %rax, $1
ASM
if gcc -nostdlib -static -no-pie Broken.s -o Broken >/dev/null 2>&1; then exit 1; fi
nasm:
install:
apt:
- gcc
- nasm
smoke:
command:
- bash
- -lc
- |
cat > Main.asm <<'ASM'
default rel
global _start
section .text
_start:
mov rax, 1
mov rdi, 1
lea rsi, [rel msg]
mov rdx, msg_len
syscall
mov rax, 60
xor rdi, rdi
syscall
section .rodata
msg: db "ok", 10
msg_len equ $ - msg
ASM
nasm -felf64 Main.asm -o Main.o
gcc -nostdlib -static -no-pie Main.o -o Main
./Main | grep '^ok$'
cat > Broken.asm <<'ASM'
global _start
section .text
_start:
mov raxx, 60
ASM
if nasm -felf64 Broken.asm -o Broken.o >/dev/null 2>&1; then exit 1; fi
python:
install:
apt:
- python3
- python3-pip
pip:
- setuptools==80.10.2
- numpy==2.4.4
- pandas==3.0.2
- seaborn==0.13.2
- matplotlib==3.10.8
- pillow==12.3.0
- six==1.17.0
- qiskit==2.4.0
- pyparsing==3.3.2
- pylatexenc==2.10
- jax[cpu]==0.10.0
script:
- python3 -m pip install --break-system-packages --no-cache-dir --index-url https://download.pytorch.org/whl/cpu torch==2.11.0+cpu torchvision==0.26.0+cpu
smoke:
command:
- python3
- -c
- |
import jax.numpy as jnp
import os
import pathlib
import numpy as np
import pandas as pd
import PIL.Image
import qiskit
import seaborn as sns
import torch
total = int(np.arange(5).sum())
assert int(pd.Series([1, 2, 3]).sum()) == 6
assert torch.tensor([1, 2]).sum().item() == 3
assert int(jnp.arange(5).sum()) == 10
assert callable(PIL.Image.new)
assert callable(qiskit.QuantumCircuit)
assert sns.__version__
assert "/usr/local/lib/aonohako/python" in os.environ.get("PYTHONPATH", "")
pathlib.Path("same-folder.txt").write_text(str(total), encoding="utf-8")
assert pathlib.Path("same-folder.txt").read_text(encoding="utf-8") == "10"
pypy:
install:
apt:
- pypy3
smoke:
command:
- pypy3
- -c
- |
import sys
from pathlib import Path
assert sys.implementation.name == "pypy"
Path("same-folder.txt").write_text("ok", encoding="utf-8")
print(Path("same-folder.txt").read_text(encoding="utf-8"))
java:
install:
apt:
- bash
- default-jdk-headless
smoke:
command:
- bash
- -lc
- |
printf '%s\n' 'public class Main {' ' public static void main(String[] args) {' ' System.out.println("ok");' ' }' '}' > Main.java
javac --release 11 -encoding UTF-8 Main.java
printf '%s\n' 'Manifest-Version: 1.0' 'Main-Class: Main' '' > MANIFEST.MF
jar cfm Main.jar MANIFEST.MF Main.class
java -XX:ReservedCodeCacheSize=64m -XX:-UseCompressedClassPointers -Xmx128m -Xss1m -XX:MaxDirectMemorySize=16m -XX:MaxMetaspaceSize=64m -Dfile.encoding=UTF-8 -XX:+UseSerialGC -DONLINE_JUDGE=1 -jar Main.jar | grep '^ok$'
groovy:
install:
apt:
- bash
- default-jdk-headless
- groovy
smoke:
command:
- bash
- -lc
- |
cat > Main.groovy <<'GROOVY'
class Main {
static void main(String[] args) {
new File("same-folder.txt").text = "ok"
println new File("same-folder.txt").text.trim()
}
}
GROOVY
groovyc -d . Main.groovy
shopt -s nullglob
groovy_jars=(/usr/share/groovy/embeddable/groovy-all*.jar /usr/share/java/groovy-all*.jar /usr/share/java/groovy*.jar)
groovy_cp='.'
for jar in "${groovy_jars[@]}"; do groovy_cp="${groovy_cp}:${jar}"; done
java -Xmx128m -Xss1m -XX:+UseSerialGC -XX:ReservedCodeCacheSize=32m -XX:MaxDirectMemorySize=16m -XX:MaxMetaspaceSize=192m -XX:CompressedClassSpaceSize=64m -Dfile.encoding=UTF-8 -DONLINE_JUDGE=1 -cp "${groovy_cp}" Main | grep '^ok$'
cat > Broken.groovy <<'GROOVY'
class Broken {
static void main(String[] args) {
println(
}
}
GROOVY
if groovyc -d . Broken.groovy >/dev/null 2>&1; then exit 1; fi
scala:
install:
apt:
- bash
- default-jdk-headless
- scala
smoke:
command:
- bash
- -lc
- |
printf '%s\n' 'object Main extends App {' ' val path = new java.io.File("same-folder.txt")' ' val writer = new java.io.PrintWriter(path, "UTF-8")' ' writer.write("ok")' ' writer.close()' ' println(scala.io.Source.fromFile(path, "UTF-8").mkString.trim)' '}' > Main.scala
scalac Main.scala
shopt -s nullglob
scala_jars=(/usr/share/java/scala*.jar)
scala_cp='.'
for jar in "${scala_jars[@]}"; do scala_cp="${scala_cp}:${jar}"; done
java -Xmx128m -Xss1m -XX:+UseSerialGC -XX:ReservedCodeCacheSize=32m -XX:MaxDirectMemorySize=16m -XX:MaxMetaspaceSize=192m -XX:CompressedClassSpaceSize=64m -Dfile.encoding=UTF-8 -DONLINE_JUDGE=1 -cp "${scala_cp}" Main | grep '^ok$'
javascript:
install:
shared:
- node24
smoke:
command:
- bash
- -lc
- |
cat > Main.js <<'JS'
const fs = require('fs');
fs.writeFileSync('same-folder.txt', 'ok');
console.log(fs.readFileSync('same-folder.txt', 'utf8'));
JS
node --disable-wasm-trap-handler --max-old-space-size=64 --max-semi-space-size=1 --stack-size=2048 Main.js | grep '^ok$'
coffeescript:
install:
apt:
- coffeescript
script:
- ln -sfn /usr/bin/coffee /usr/local/bin/coffee
smoke:
command:
- bash
- -lc
- |
printf '%s\n' "fs = require 'fs'" "fs.writeFileSync 'same-folder.txt', 'ok'" "console.log fs.readFileSync('same-folder.txt', 'utf8')" > Main.coffee
coffee --compile --bare --output . Main.coffee
node --disable-wasm-trap-handler --max-old-space-size=64 --max-semi-space-size=1 --stack-size=2048 /usr/local/bin/coffee Main.coffee | grep '^ok$'
typescript:
install:
shared:
- node24
npm:
- typescript
smoke:
command:
- bash
- -lc
- |
printf '%s\n' "declare const require: any;" "const fs = require('fs');" "fs.writeFileSync('same-folder.txt', 'ok');" "console.log(fs.readFileSync('same-folder.txt', 'utf8'));" > Main.ts
tsc Main.ts --module commonjs --target es2019 --outDir dist
node --disable-wasm-trap-handler --max-old-space-size=64 --max-semi-space-size=1 --stack-size=2048 dist/Main.js | grep '^ok$'
elm:
install:
apt:
- elm-compiler
- nodejs
script:
- install -d -m 0755 /usr/local/lib/aonohako/elm-home
- |
export HOME=/usr/local/lib/aonohako/elm-home
cat > /tmp/elm.json <<'JSON'
{
"type": "application",
"source-directories": ["."],
"elm-version": "0.19.1",
"dependencies": {
"direct": {
"elm/core": "1.0.5",
"elm/json": "1.1.3"
},
"indirect": {}
},
"test-dependencies": {
"direct": {},
"indirect": {}
}
}
JSON
cat > /tmp/Main.elm <<'ELM'
port module Main exposing (main)
import Platform
port stdin : (String -> msg) -> Sub msg
port stdout : String -> Cmd msg
type Msg = Input String
main : Program () () Msg
main =
Platform.worker
{ init = \_ -> ( (), Cmd.none )
, update = \msg model ->
case msg of
Input input ->
( model, stdout input )
, subscriptions = \_ -> stdin Input
}
ELM
cd /tmp && printf 'y\n' | elm make Main.elm --output=/tmp/elm-warmup.js
chmod -R a+rX /usr/local/lib/aonohako/elm-home
rm -f /tmp/elm.json /tmp/Main.elm /tmp/elm-warmup.js
smoke:
command:
- bash
- -lc
- |
set -euo pipefail
tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
cd "$tmp"
export HOME=/usr/local/lib/aonohako/elm-home
cat > elm.json <<'JSON'
{
"type": "application",
"source-directories": ["."],
"elm-version": "0.19.1",
"dependencies": {
"direct": {
"elm/core": "1.0.5",
"elm/json": "1.1.3"
},
"indirect": {}
},
"test-dependencies": {
"direct": {},
"indirect": {}
}
}
JSON
cat > Main.elm <<'ELM'
port module Main exposing (main)
import Platform
port stdin : (String -> msg) -> Sub msg
port stdout : String -> Cmd msg
type Msg = Input String
main : Program () () Msg
main =
Platform.worker
{ init = \_ -> ( (), Cmd.none )
, update = \msg model ->
case msg of
Input input ->
( model, stdout input )
, subscriptions = \_ -> stdin Input
}
ELM
elm make Main.elm --output=aonohako-elm-compiled.js
{
printf '%s\n' 'const fs = require("fs");' 'const __aonohakoInput = fs.readFileSync(0, "utf8");'
cat aonohako-elm-compiled.js
cat <<'JS'
const __aonohakoElm = typeof Elm !== "undefined" ? Elm : (typeof module !== "undefined" && module.exports ? module.exports.Elm : undefined);
const __aonohakoApp = __aonohakoElm.Main.init({ flags: null });
const __aonohakoPorts = __aonohakoApp && __aonohakoApp.ports ? __aonohakoApp.ports : {};
if (__aonohakoPorts.stdout) {
__aonohakoPorts.stdout.subscribe((value) => process.stdout.write(String(value)));
}
if (__aonohakoPorts.stdin) {
__aonohakoPorts.stdin.send(__aonohakoInput);
}
JS
} > Main.js
printf 'ok\n' | node --disable-wasm-trap-handler --max-old-space-size=64 --max-semi-space-size=1 --stack-size=2048 Main.js | grep '^ok$'
cat > Broken.elm <<'ELM'
module Broken exposing (main)
main =
ELM
if elm make Broken.elm --output=Broken.js >/dev/null 2>&1; then exit 1; fi
rescript:
install:
shared:
- node24
script:
- npm install -g --prefix /usr/local rescript@12.3.0
smoke:
command:
- bash
- -lc
- |
set -euo pipefail
tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
cd "$tmp"
cat > rescript.json <<'JSON'
{
"name": "aonohako-rescript-smoke",
"sources": [
{ "dir": ".", "subdirs": false }
],
"package-specs": {
"module": "commonjs",
"in-source": false
},
"suffix": ".js"
}
JSON
printf '%s\n' 'Console.log("ok")' > Main.res
rescript build
node --disable-wasm-trap-handler --max-old-space-size=64 --max-semi-space-size=1 --stack-size=2048 lib/js/Main.js | grep '^ok$'
printf '%s\n' 'let broken = ' > Broken.res
if rescript build >/dev/null 2>&1; then exit 1; fi
purescript:
install:
shared:
- node24
sandbox_tools:
- git
apt:
- git
script:
- npm install -g --prefix /usr/local purescript@0.15.16 spago@1.0.4
- install -d -m 0755 /usr/local/lib/aonohako/purescript-home
- |
export HOME=/usr/local/lib/aonohako/purescript-home
tmp=/tmp/purescript-warmup
rm -rf "$tmp"
mkdir -p "$tmp/src"
cat > "$tmp/spago.yaml" <<'YAML'
package:
name: aonohako-purescript-warmup
dependencies:
- console
- effect
- prelude
test:
main: Test.Main
dependencies: []
workspace:
packageSet:
registry: 77.4.1
extraPackages: {}
YAML
cat > "$tmp/src/Main.purs" <<'PURS'
module Main where
import Prelude
import Effect (Effect)
import Effect.Console (log)
main :: Effect Unit
main = log "ok"
PURS
cd "$tmp" && spago build
chmod -R a+rX /usr/local/lib/aonohako/purescript-home
cd /
rm -rf "$tmp"
smoke:
command:
- bash
- -lc
- |
set -euo pipefail
tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
cd "$tmp"
export HOME=/usr/local/lib/aonohako/purescript-home
cat > spago.yaml <<'YAML'
package:
name: aonohako-purescript-smoke
dependencies:
- console
- effect
- prelude
test:
main: Test.Main
dependencies: []
workspace:
packageSet:
registry: 77.4.1
extraPackages: {}
YAML
mkdir -p src
cat > src/Main.purs <<'PURS'
module Main where
import Prelude
import Effect (Effect)
import Effect.Console (log)
main :: Effect Unit
main = log "ok"
PURS
spago build
printf '%s\n' 'require("./output/Main/index.js").main();' > Main.js
node --disable-wasm-trap-handler --max-old-space-size=64 --max-semi-space-size=1 --stack-size=2048 Main.js | grep '^ok$'
cat > src/Broken.purs <<'PURS'
module Broken where
broken =
PURS
if spago build >/dev/null 2>&1; then exit 1; fi
ruby:
install:
apt:
- ruby-full
smoke:
command:
- ruby
- -e
- |
File.write("same-folder.txt", "ok")
puts File.read("same-folder.txt")
php:
install:
apt:
- php
smoke:
command:
- php
- -r
- |
file_put_contents("same-folder.txt", "ok");
echo file_get_contents("same-folder.txt"), PHP_EOL;
lua:
install:
apt:
- lua5.4
smoke:
command:
- lua5.4
- -e
- |
local f = assert(io.open("same-folder.txt", "w"))
f:write("ok")
f:close()
local r = assert(io.open("same-folder.txt", "r"))
print(r:read("*a"))
r:close()
perl:
install:
apt:
- perl
smoke:
command:
- perl
- -e
- |
open my $fh, '>', 'same-folder.txt' or die $!;
print {$fh} "ok";
close $fh;
open my $rfh, '<', 'same-folder.txt' or die $!;
print scalar <$rfh>;
close $rfh;
elixir:
install:
apt:
- elixir
smoke:
command:
- bash
- -lc
- |
printf '%s\n' 'File.write!("same-folder.txt", "ok")' 'IO.puts(File.read!("same-folder.txt"))' > Main.exs
env ERL_AFLAGS='+MIscs 128 +S 1:1 +A 1 +MMscs 0' elixir Main.exs | grep '^ok$'
haskell:
install:
apt:
- ghc
smoke:
command:
- bash
- -lc
- |
printf '%s\n' 'main :: IO ()' 'main = do' ' writeFile "same-folder.txt" "ok"' ' readFile "same-folder.txt" >>= putStrLn' > Main.hs
ghc -O2 -o Main Main.hs
./Main | grep '^ok$'
idris2:
install:
apt:
- bash
- build-essential
- ca-certificates
- chezscheme
- curl
- libgmp-dev
- make
script:
- export IDRIS2_VERSION=0.8.0
- curl --retry 5 --retry-delay 2 --retry-connrefused -fsSL "https://github.com/idris-lang/Idris2/archive/refs/tags/v${IDRIS2_VERSION}.tar.gz" -o /tmp/idris2.tar.gz
- tar -xzf /tmp/idris2.tar.gz -C /tmp
- IDRIS2_SRC="$(find /tmp -maxdepth 1 -type d -name 'Idris2-*' | head -n 1)"; test -n "${IDRIS2_SRC}"; cd "${IDRIS2_SRC}" && make bootstrap SCHEME=chezscheme PREFIX=/usr/local && make install PREFIX=/usr/local
- rm -rf /tmp/Idris2-* /tmp/idris2.tar.gz
- cd /
smoke:
command:
- bash
- -lc
- |
cat > Main.idr <<'IDRIS'
module Main
main : IO ()
main = putStrLn "ok"
IDRIS
idris2 --cg chez -o Main Main.idr
./build/exec/Main | grep '^ok$'
test -d build/exec/Main_app
cat > Broken.idr <<'IDRIS'
module Broken
main : IO ()
main =
IDRIS
if idris2 --cg chez -o Broken Broken.idr >/dev/null 2>&1; then exit 1; fi
haxe:
install:
apt:
- haxe
- neko
smoke:
command:
- bash
- -lc
- |
cat > Main.hx <<'HAXE'
class Main {
static public function main() {
Sys.println("ok");
}
}
HAXE
haxe -main Main -neko Main.n
neko Main.n | grep '^ok$'
lisp:
install:
apt:
- sbcl
smoke:
command:
- bash
- -lc
- |
cat > Main.lisp <<'LISP'
(with-open-file (out "same-folder.txt"
:direction :output
:if-exists :supersede
:if-does-not-exist :create)
(write-line "ok" out))
(with-open-file (in "same-folder.txt" :direction :input)
(format t "~a~%" (read-line in nil "")))
LISP
sbcl --noinform --script Main.lisp | grep '^ok$'
cat > Broken.lisp <<'LISP'
(format t "ok"
LISP
if sbcl --noinform --script Broken.lisp >/dev/null 2>&1; then exit 1; fi
picolisp:
install:
apt:
- picolisp
smoke:
command:
- bash
- -lc
- |
pil -version -bye >/dev/null
cat > Main.l <<'PICOLISP'
(in NIL
(let (A (read) B (read))
(prinl (+ A B)) ) )
PICOLISP
printf '1 2\n' | pil Main.l -bye | grep '^3$'
printf '%s\n' '(prinl "broken"' > Broken.l
if pil Broken.l -bye >/dev/null 2>&1; then exit 1; fi
swift:
smoke:
command:
- bash
- -lc
- |
printf '%s\n' 'import Foundation' 'try! "ok".write(toFile: "same-folder.txt", atomically: true, encoding: .utf8)' 'print(try! String(contentsOfFile: "same-folder.txt").trimmingCharacters(in: .whitespacesAndNewlines))' > Main.swift
swiftc -O Main.swift -o Main
./Main | grep '^ok$'
sqlite:
install:
apt:
- sqlite3
smoke:
command:
- bash
- -lc
- |
printf '%s\n' 'create table numbers(v integer);' 'insert into numbers(v) values (1),(2),(3);' > setup.sql
printf '%s\n' 'select sum(v) from numbers;' > Main.sql
[ "$(sqlite3 same-folder.db '.read setup.sql' '.read Main.sql')" = 6 ]
[ -f same-folder.db ]
julia:
install:
script:
- ln -sfn /usr/local/julia/bin/julia /usr/local/bin/julia
smoke:
command:
- julia
- --startup-file=no
- --history-file=no
- --color=no
- -e
- |
using Statistics
open("same-folder.txt", "w") do io
write(io, string(mean([1, 2, 3])))
end
println(read("same-folder.txt", String))
raku:
install:
apt:
- raku
smoke:
command:
- bash
- -lc
- |
printf '%s\n' 'spurt "same-folder.txt", "ok";' 'say slurp("same-folder.txt").trim;' > Main.raku
raku -c Main.raku >/dev/null
raku Main.raku | grep '^ok$'
r:
install:
apt:
- r-base-core
smoke:
command:
- bash
- -lc
- |
cat > Main.R <<'RS'
writeLines("ok", "same-folder.txt")
cat(readLines("same-folder.txt"), sep = "\n")
RS
Rscript --vanilla Main.R | grep '^ok$'
cat > Broken.R <<'RS'
if (
RS
if Rscript --vanilla -e "parse(file=commandArgs(TRUE)[1])" Broken.R >/dev/null 2>&1; then exit 1; fi
erlang:
install:
apt:
- erlang-base
- erlang-dev
- erlang-parsetools
smoke:
command:
- bash
- -lc
- |
cat > main.erl <<'ERL'
-module(main).
-export([main/0]).
main() ->
ok = file:write_file("same-folder.txt", <<"ok">>),
{ok, Data} = file:read_file("same-folder.txt"),
io:format("~s~n", [Data]).
ERL
erlc main.erl
erl +S 1:1 +A 1 -noshell -pa . -s main main -s init stop | grep '^ok$'
cat > Broken.erl <<'ERL'
-module(broken).
-export([main/0]).
main() ->
ok =
ERL
if erlc Broken.erl >/dev/null 2>&1; then exit 1; fi
prolog:
install:
apt:
- swi-prolog-nox
smoke:
command:
- bash
- -lc
- |
cat > Main.pl <<'PROLOG'
main :-
setup_call_cleanup(
open('same-folder.txt', write, Out),
write(Out, ok),
close(Out)
),
setup_call_cleanup(
open('same-folder.txt', read, In),
read_string(In, _, Content),
close(In)
),
writeln(Content).
PROLOG
swipl -q -f Main.pl -g main -t halt | grep '^ok$'
cat > Broken.pl <<'PROLOG'
main :-
writeln(ok
PROLOG
if swipl -q -f Broken.pl -g main -t halt >/dev/null 2>&1; then exit 1; fi
whitespace:
install:
apt:
- python3
smoke:
command:
- bash
- -lc
- |
python3 - <<'PY' > Main.ws
S = " "
T = "\t"
L = "\n"
def number(value):
sign = S if value >= 0 else T
bits = bin(abs(value))[2:]
payload = ''.join(S if ch == '0' else T for ch in bits)
return sign + payload + L
def push(value):
return S + S + number(value)
def out_char():
return T + L + S + S
program = ''.join(push(ord(ch)) + out_char() for ch in "ok\n") + L + L + L
print(program, end="")
PY
python3 /usr/local/lib/aonohako/whitespace.py Main.ws | grep '^ok$'
bf:
install:
apt:
- python3
smoke:
command:
- bash
- -lc
- |
printf '%s' '++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.' > Main.bf
python3 /usr/local/lib/aonohako/brainfuck.py Main.bf | grep '^Hello World!$'
befunge:
install:
apt:
- python3
smoke:
command:
- bash
- -lc
- |
printf '%s' '>"ko",,91+,@' > Main.bef
python3 /usr/local/lib/aonohako/befunge.py Main.bef | grep '^ok$'
malbolge:
install:
apt:
- python3
smoke:
command:
- bash
- -lc
- |
cat > Main.mal <<'MALBOLGE'