├── extra ├── matplotlibrc ├── config.toml ├── pycodestyle ├── cquery11 ├── fluxbox │ ├── apps │ └── init ├── lang-gitignore ├── replit-v2.py ├── nixproxy.nix ├── polygott-gitignore ├── build-prybar-lang.sh ├── _test_runner.py ├── pulse │ └── client.conf ├── py-dap └── apt-install ├── .gitignore ├── run_dir ├── sitecustomize.py ├── junit-4.12.jar ├── hamcrest-core-1.3.jar ├── json-simple-1.1.1.jar ├── com.microsoft.java.debug.plugin-0.32.0.jar ├── replit.py ├── findreqs.py └── parser.py ├── gen ├── x11-vnc.ejs ├── versions.ejs ├── self-test.ejs ├── languages.json.ejs ├── package.json ├── tests.ejs ├── Dockerfile.splice.ejs ├── run-language-server.ejs ├── lang-setup.ejs ├── detect-language.ejs ├── self-test-per-lang.ejs ├── phase2-per-lang.ejs ├── run-project.ejs ├── languages.d.ejs └── phase0.ejs ├── out ├── polygott-x11-vnc ├── share │ └── polygott │ │ ├── phase2.d │ │ ├── cpp │ │ ├── d │ │ ├── jest │ │ ├── php │ │ ├── assembly │ │ ├── clisp │ │ ├── cpp11 │ │ ├── crystal │ │ ├── csharp │ │ ├── elixir │ │ ├── erlang │ │ ├── express │ │ ├── fortran │ │ ├── fsharp │ │ ├── guile │ │ ├── haskell │ │ ├── love2d │ │ ├── mercury │ │ ├── pascal │ │ ├── prolog │ │ ├── rlang │ │ ├── react_native │ │ ├── dart │ │ ├── sqlite │ │ ├── deno │ │ ├── ocaml │ │ ├── lua │ │ ├── tcl │ │ ├── nextjs │ │ ├── flow │ │ ├── nodejs │ │ ├── elisp │ │ ├── go │ │ ├── wren │ │ ├── kotlin │ │ ├── rust │ │ ├── bash │ │ ├── python │ │ ├── enzyme │ │ ├── nix │ │ ├── pygame │ │ ├── quil │ │ ├── pyxel │ │ ├── ballerina │ │ ├── webassembly │ │ ├── gatsbyjs │ │ ├── ruby │ │ ├── scala │ │ ├── nim │ │ ├── powershell │ │ ├── julia │ │ ├── reactjs │ │ ├── raku │ │ ├── haxe │ │ ├── reactts │ │ ├── swift │ │ ├── forth │ │ ├── clojure │ │ ├── c │ │ ├── java │ │ ├── python3 │ │ └── objective-c │ │ └── self-test.d │ │ ├── flow │ │ ├── jest │ │ ├── quil │ │ ├── nextjs │ │ ├── reactjs │ │ ├── reactts │ │ ├── gatsbyjs │ │ ├── react_native │ │ ├── kotlin │ │ ├── love2d │ │ ├── tcl │ │ ├── lua │ │ ├── bash │ │ ├── ruby │ │ ├── php │ │ ├── forth │ │ ├── deno │ │ ├── raku │ │ ├── swift │ │ ├── wren │ │ ├── julia │ │ ├── python │ │ ├── sqlite │ │ ├── enzyme │ │ ├── nodejs │ │ ├── clojure │ │ ├── d │ │ ├── guile │ │ ├── rust │ │ ├── elixir │ │ ├── express │ │ ├── rlang │ │ ├── c │ │ ├── crystal │ │ ├── fsharp │ │ ├── haskell │ │ ├── ocaml │ │ ├── dart │ │ ├── elisp │ │ ├── clisp │ │ ├── cpp │ │ ├── fortran │ │ ├── nim │ │ ├── pascal │ │ ├── cpp11 │ │ ├── prolog │ │ ├── java │ │ ├── haxe │ │ ├── scala │ │ ├── erlang │ │ ├── powershell │ │ ├── csharp │ │ ├── ballerina │ │ ├── nix │ │ ├── assembly │ │ ├── mercury │ │ ├── objective-c │ │ ├── pygame │ │ ├── go │ │ ├── pyxel │ │ ├── python3 │ │ └── webassembly ├── Dockerfile.splice ├── languages.json └── phase0.sh ├── languages ├── jest.toml ├── react_native.toml ├── nextjs.toml ├── express.toml ├── php.toml ├── elixir.toml ├── sqlite.toml ├── flow.toml ├── guile.toml ├── clisp.toml ├── pascal.toml ├── fortran.toml ├── rlang.toml ├── gatsbyjs.toml ├── prolog.toml ├── d.toml ├── enzyme.toml ├── love2d.toml ├── fsharp.toml ├── quil.toml ├── reactjs.toml ├── lua.toml ├── bash.toml ├── reactts.toml ├── wren.toml ├── crystal.toml ├── haskell.toml ├── kotlin.toml ├── deno.toml ├── assembly.toml ├── ocaml.toml ├── ballerina.toml ├── rust.toml ├── tcl.toml ├── nodejs.toml ├── cpp11.toml ├── csharp.toml ├── elisp.toml ├── mercury.toml ├── powershell.toml ├── scala.toml ├── julia.toml ├── dart.toml ├── nix.toml ├── nim.toml ├── erlang.toml ├── python.toml ├── ruby.toml ├── cpp.toml ├── go.toml ├── pyxel.toml ├── raku.toml ├── pygame.toml ├── clojure.toml ├── forth.toml ├── swift.toml ├── haxe.toml ├── c.toml ├── webassembly.toml ├── java.toml ├── python3.toml └── objective-c.toml ├── packages.txt ├── .dockerignore └── LICENSE /extra/matplotlibrc: -------------------------------------------------------------------------------- 1 | backend : Agg 2 | -------------------------------------------------------------------------------- /extra/config.toml: -------------------------------------------------------------------------------- 1 | virtualenvs.create = false -------------------------------------------------------------------------------- /extra/pycodestyle: -------------------------------------------------------------------------------- 1 | [pycodestyle] 2 | ignore = E, W 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | gen/node_modules/ 3 | ignore/ 4 | .mypy_cache/ 5 | -------------------------------------------------------------------------------- /extra/cquery11: -------------------------------------------------------------------------------- 1 | %clang 2 | %c -std=gnu11 3 | %cpp -std=gnu++11 4 | -pthread -------------------------------------------------------------------------------- /extra/fluxbox/apps: -------------------------------------------------------------------------------- 1 | [app] (name!=inexistent) 2 | [Position] (TopLeft) {0 0} 3 | [end] 4 | -------------------------------------------------------------------------------- /run_dir/sitecustomize.py: -------------------------------------------------------------------------------- 1 | import site 2 | site.addsitedir('/home/runner/.site-packages') 3 | -------------------------------------------------------------------------------- /run_dir/junit-4.12.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/replit/polygott/master/run_dir/junit-4.12.jar -------------------------------------------------------------------------------- /run_dir/hamcrest-core-1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/replit/polygott/master/run_dir/hamcrest-core-1.3.jar -------------------------------------------------------------------------------- /run_dir/json-simple-1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/replit/polygott/master/run_dir/json-simple-1.1.1.jar -------------------------------------------------------------------------------- /gen/x11-vnc.ejs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is now a no-op. X11 now starts automatically. 4 | 5 | exit 0 6 | -------------------------------------------------------------------------------- /extra/lang-gitignore: -------------------------------------------------------------------------------- 1 | # common 2 | .bash_logout 3 | .bashrc 4 | .profile 5 | .config/ 6 | .replit/ 7 | .upm/ 8 | .env 9 | -------------------------------------------------------------------------------- /out/polygott-x11-vnc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is now a no-op. X11 now starts automatically. 4 | 5 | exit 0 6 | -------------------------------------------------------------------------------- /extra/replit-v2.py: -------------------------------------------------------------------------------- 1 | import sys 2 | def clear(): 3 | sys.stdout.write(chr(27) + '[3;J' + chr(27) + "[H" + chr(27) + '[2J') 4 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/cpp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/d: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/jest: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/php: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/assembly: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/clisp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/cpp11: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/crystal: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/csharp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/elixir: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/erlang: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/express: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/fortran: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/fsharp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/guile: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/haskell: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/love2d: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/mercury: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/pascal: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/prolog: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/rlang: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/react_native: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | 8 | rm /phase2.sh 9 | -------------------------------------------------------------------------------- /run_dir/com.microsoft.java.debug.plugin-0.32.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/replit/polygott/master/run_dir/com.microsoft.java.debug.plugin-0.32.0.jar -------------------------------------------------------------------------------- /run_dir/replit.py: -------------------------------------------------------------------------------- 1 | send_msg = None 2 | 3 | def init(send): 4 | global send_msg 5 | send_msg = send 6 | 7 | def clear(): 8 | send_msg("clearConsole") 9 | -------------------------------------------------------------------------------- /extra/nixproxy.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs ? import {}, 3 | repldir, 4 | replit ? import (repldir + "/replit.nix") { inherit pkgs; }, 5 | }: 6 | pkgs.mkShell { 7 | buildInputs = replit.deps; 8 | } 9 | -------------------------------------------------------------------------------- /extra/polygott-gitignore: -------------------------------------------------------------------------------- 1 | # common 2 | .bash_logout 3 | .bashrc 4 | .profile 5 | .cache/ 6 | .local/ 7 | .config/ 8 | .replit/ 9 | .upm/ 10 | 11 | # executables 12 | main 13 | *.exe 14 | *.dll 15 | -------------------------------------------------------------------------------- /gen/versions.ejs: -------------------------------------------------------------------------------- 1 | <% for ( let lang of languages ) { -%> 2 | echo "<%= lpad(lang.name, 20) %>" $(<%- c(lang.versionCommand) %> 2>&1 4 | -------------------------------------------------------------------------------- /gen/self-test.ejs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | <% for ( let lang of languages ) { -%> 8 | # <%= lang.name %> 9 | /usr/share/polygott/self-test.d/<%= lang.id %> || CODE=1 10 | <% } -%> 11 | 12 | exit $CODE 13 | -------------------------------------------------------------------------------- /languages/jest.toml: -------------------------------------------------------------------------------- 1 | name = "jest" 2 | entrypoint = "config.json" 3 | languages = [ 4 | "nodejs" 5 | ] 6 | extensions = [ 7 | "js" 8 | ] 9 | 10 | [run] 11 | command = [ 12 | "jest", 13 | "--colors", 14 | "--config", 15 | "/home/runner/config.json" 16 | ] 17 | -------------------------------------------------------------------------------- /languages/react_native.toml: -------------------------------------------------------------------------------- 1 | name = "react_native" 2 | entrypoint = "index.js" 3 | languages = [ 4 | "jest" 5 | ] 6 | extensions = [ 7 | "js" 8 | ] 9 | 10 | [run] 11 | command = [ 12 | "jest", 13 | "--colors", 14 | "--config", 15 | "/home/runner/config.json" 16 | ] 17 | -------------------------------------------------------------------------------- /languages/nextjs.toml: -------------------------------------------------------------------------------- 1 | name = "nextjs" 2 | languages = [ 3 | "nodejs" 4 | ] 5 | entrypoint = "pages/index.js" 6 | extensions = [ 7 | "js" 8 | ] 9 | packages = [] 10 | setup = [ 11 | "mkdir -p /home/runner/pages" 12 | ] 13 | 14 | [run] 15 | command = [ 16 | "yarn", 17 | "dev" 18 | ] 19 | -------------------------------------------------------------------------------- /extra/build-prybar-lang.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | LANG="$1" 3 | 4 | export GOPATH=/gocode 5 | export LC_ALL=C.UTF-8 6 | export PATH="/gocode/src/github.com/replit/prybar:$PATH" 7 | cd /gocode/src/github.com/replit/prybar 8 | make "prybar-${LANG}" 9 | cp "prybar-${LANG}" /usr/bin/ 10 | cp -r prybar_assets/ /usr/bin/ -------------------------------------------------------------------------------- /languages/express.toml: -------------------------------------------------------------------------------- 1 | name = "express" 2 | entrypoint = "index.js" 3 | extensions = [ 4 | "js" 5 | ] 6 | popularity = 1.0 7 | 8 | [run] 9 | command = [ 10 | "node", 11 | "index.js" 12 | ] 13 | 14 | [tests] 15 | 16 | [tests.hello] 17 | code = "console.log(\"hello\")" 18 | output = "hello\n" 19 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/flow: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",flow,"* ]]; then 8 | echo S 'flow:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'flow' 14 | 15 | 16 | exit $CODE 17 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/jest: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",jest,"* ]]; then 8 | echo S 'jest:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'jest' 14 | 15 | 16 | exit $CODE 17 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/quil: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",quil,"* ]]; then 8 | echo S 'quil:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'quil' 14 | 15 | 16 | exit $CODE 17 | -------------------------------------------------------------------------------- /languages/php.toml: -------------------------------------------------------------------------------- 1 | name = "php" 2 | entrypoint = "main.php" 3 | extensions = [ 4 | "php" 5 | ] 6 | packages = [ 7 | "php-cli", 8 | "php-pear" 9 | ] 10 | 11 | [run] 12 | command = [ 13 | "php", 14 | "main.php" 15 | ] 16 | 17 | [tests] 18 | 19 | [tests.hello] 20 | code = " 4 | <% if (lang.languages && lang.languages.length) { -%> 5 | "phase2-<%= lang.id %>": "phase2-<%= lang.languages[0] %>", 6 | <% } else { -%> 7 | "phase2-<%= lang.id %>": "phase1.5", 8 | <% } -%> 9 | <% } -%> 10 | "phase2-tools": "phase1.5" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/kotlin: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",kotlin,"* ]]; then 8 | echo S 'kotlin:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'kotlin' 14 | 15 | echo S 'kotlin:hello' 16 | 17 | exit $CODE 18 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/love2d: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",love2d,"* ]]; then 8 | echo S 'love2d:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'love2d' 14 | 15 | echo S 'love2d:hello' 16 | 17 | exit $CODE 18 | -------------------------------------------------------------------------------- /languages/elixir.toml: -------------------------------------------------------------------------------- 1 | name = "elixir" 2 | languages = [ 3 | "erlang" 4 | ] 5 | entrypoint = "main.exs" 6 | extensions = [ 7 | "ex", 8 | "exs" 9 | ] 10 | packages = [ 11 | "elixir", 12 | ] 13 | 14 | [run] 15 | command = [ 16 | "elixir", 17 | "./main.exs" 18 | ] 19 | 20 | [tests] 21 | 22 | [tests.hello] 23 | code = "IO.puts \"hello world\"" 24 | output = "hello world\n" 25 | -------------------------------------------------------------------------------- /gen/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "polygott-gen", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "MIT", 11 | "dependencies": { 12 | "ejs": "^2.6.1", 13 | "glob": "^7.1.3", 14 | "toml": "^2.3.3", 15 | "tv4": "^1.3.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /languages/sqlite.toml: -------------------------------------------------------------------------------- 1 | name = "sqlite" 2 | entrypoint = "main.sql" 3 | extensions = [ 4 | "sql" 5 | ] 6 | packages = [ 7 | "sqlite3", 8 | ] 9 | setup = [ 10 | "/usr/bin/build-prybar-lang.sh sqlite" 11 | ] 12 | 13 | [run] 14 | command = [ 15 | "sqlite3", 16 | "-init", 17 | "main.sql", 18 | ] 19 | 20 | [tests] 21 | 22 | [tests.hello] 23 | code = "select 'hello';" 24 | output = "hello\n" 25 | -------------------------------------------------------------------------------- /languages/flow.toml: -------------------------------------------------------------------------------- 1 | name = "flow" 2 | languages = [ 3 | "nodejs" 4 | ] 5 | entrypoint = "src/index.js" 6 | extensions = [ 7 | "js" 8 | ] 9 | packages = [] 10 | setup = [ 11 | "npm install -g flow-language-server-amasad flow-bin" 12 | ] 13 | 14 | [run] 15 | command = [ 16 | "yarn", 17 | "start" 18 | ] 19 | 20 | [languageServer] 21 | command = [ 22 | "flow-language-server", 23 | "--stdio" 24 | ] 25 | -------------------------------------------------------------------------------- /languages/guile.toml: -------------------------------------------------------------------------------- 1 | name = "guile" 2 | entrypoint = "main.scm" 3 | extensions = [ 4 | "scm" 5 | ] 6 | aliases = [ 7 | "scheme" 8 | ] 9 | packages = [ 10 | "guile-2.2" 11 | ] 12 | setup = [ 13 | ] 14 | 15 | [run] 16 | command = [ 17 | "guile", 18 | "-s", 19 | "./main.scm" 20 | ] 21 | 22 | [tests] 23 | 24 | [tests.hello] 25 | code = "(display \"hello world\")" 26 | output = "hello world" 27 | -------------------------------------------------------------------------------- /languages/clisp.toml: -------------------------------------------------------------------------------- 1 | name = "common lisp" 2 | entrypoint = "main.lisp" 3 | aliases = [ 4 | "lisp" 5 | ] 6 | extensions = [ 7 | "lisp" 8 | ] 9 | packages = [ 10 | "sbcl" 11 | ] 12 | setup = [ 13 | ] 14 | 15 | [run] 16 | command = [ 17 | "sbcl", 18 | "--script", 19 | "./main.lisp" 20 | ] 21 | 22 | [tests] 23 | 24 | [tests.hello] 25 | code = "(format t \"Hello, world!\")" 26 | output = "Hello, world!" 27 | -------------------------------------------------------------------------------- /languages/pascal.toml: -------------------------------------------------------------------------------- 1 | name = "pascal" 2 | entrypoint = "main.pas" 3 | extensions = [ 4 | "pas", 5 | "pp" 6 | ] 7 | packages = [ 8 | "fpc" 9 | ] 10 | setup = [ 11 | ] 12 | 13 | [compile] 14 | command = [ 15 | "fpc" 16 | ] 17 | 18 | [run] 19 | command = [ 20 | "./main" 21 | ] 22 | 23 | [tests] 24 | [tests.hello] 25 | code = "program hello;\nbegin\n\twriteln('hello world');\nend." 26 | output = "hello world\n" 27 | -------------------------------------------------------------------------------- /languages/fortran.toml: -------------------------------------------------------------------------------- 1 | name = "fortran" 2 | entrypoint = "main.f90" 3 | extensions = [ 4 | "f90" 5 | ] 6 | packages = [ 7 | "gfortran" 8 | ] 9 | setup = [ 10 | ] 11 | 12 | [compile] 13 | command = [ 14 | "bash", 15 | "-c", 16 | "gfortran main.f90" 17 | ] 18 | 19 | [run] 20 | command = [ 21 | "./a.out" 22 | ] 23 | 24 | [tests] 25 | 26 | [tests.hello] 27 | code = "program main\nprint '(\"hello\")'\nend program main" 28 | output = "hello\n" 29 | -------------------------------------------------------------------------------- /languages/rlang.toml: -------------------------------------------------------------------------------- 1 | name = "rlang" 2 | entrypoint = "main.r" 3 | extensions = [ 4 | "r" 5 | ] 6 | packages = [ 7 | "r-base", 8 | "r-base-dev", 9 | "r-recommended", 10 | "littler", 11 | "r-cran-littler", 12 | "r-cran-stringr" 13 | ] 14 | 15 | [run] 16 | command = [ 17 | "R", 18 | "--slave", 19 | "-f", 20 | "main.r" 21 | ] 22 | 23 | [tests] 24 | 25 | [tests.hello] 26 | code = "print(\"Hello World\")" 27 | output = "[1] \"Hello World\"\n" 28 | -------------------------------------------------------------------------------- /languages/gatsbyjs.toml: -------------------------------------------------------------------------------- 1 | name = "gatsbyjs" 2 | languages = [ 3 | "nodejs" 4 | ] 5 | entrypoint = "src/pages/index.js" 6 | extensions = [ 7 | "js" 8 | ] 9 | setup = [ 10 | "rm -f /home/runner/.profile /home/runner/.bashrc /home/runner/.bash_logout", 11 | "npm install -g gatsby-cli", 12 | "gatsby new /home/runner && rm LICENSE && rm README.md && rm .prettierrc && rm .gitignore", 13 | "yarn" 14 | ] 15 | 16 | [run] 17 | command = [ 18 | "yarn", 19 | "develop" 20 | ] 21 | -------------------------------------------------------------------------------- /languages/prolog.toml: -------------------------------------------------------------------------------- 1 | name = "prolog" 2 | entrypoint = "main.pro" 3 | extensions = [ 4 | "pro", 5 | "prolog", 6 | "wam" 7 | ] 8 | packages = [ 9 | "gprolog" 10 | ] 11 | 12 | [compile] 13 | command = [ 14 | "gplc", 15 | "--no-top-level", 16 | "-o", 17 | "main" 18 | ] 19 | 20 | [run] 21 | command = [ 22 | "./main" 23 | ] 24 | 25 | [tests] 26 | 27 | [tests.hello] 28 | code = ":- initialization(main).\nmain :- write('hello, world\\n')." 29 | output = "hello, world\n" 30 | -------------------------------------------------------------------------------- /languages/d.toml: -------------------------------------------------------------------------------- 1 | name = "D" 2 | entrypoint = "main.d" 3 | 4 | aliases = [ 5 | "d", 6 | "dlang", 7 | ] 8 | extensions = [ 9 | "d" 10 | ] 11 | packages = [ 12 | "gdc", 13 | "gdb" 14 | ] 15 | 16 | [compile] 17 | command = [ 18 | "gdc", 19 | "-o", 20 | "main" 21 | ] 22 | 23 | [run] 24 | command = [ 25 | "./main" 26 | ] 27 | 28 | [tests] 29 | [tests.hello] 30 | code="import std.stdio: writeln;void main(){writeln(\"hello\");}" 31 | output="hello\n" 32 | 33 | -------------------------------------------------------------------------------- /languages/enzyme.toml: -------------------------------------------------------------------------------- 1 | name = "enzyme" 2 | languages = [ 3 | "nodejs" 4 | ] 5 | entrypoint = "index.js" 6 | extensions = [ 7 | "js" 8 | ] 9 | popularity = 1.0 10 | setup = [ 11 | "yarn add react react-dom react-addons-test-utils jsdom enzyme babel-core babel-preset-latest babel-preset-react babel-polyfill" 12 | ] 13 | 14 | [run] 15 | command = [ 16 | "node", 17 | "index.js" 18 | ] 19 | 20 | [tests] 21 | 22 | [tests.hello] 23 | code = "console.log(\"hello\")" 24 | output = "hello\n" 25 | -------------------------------------------------------------------------------- /languages/love2d.toml: -------------------------------------------------------------------------------- 1 | name = "love2d" 2 | entrypoint = "main.lua" 3 | extensions = [ 4 | "lua" 5 | ] 6 | aptRepos = [ 7 | "ppa:bartbes/love-stable" 8 | ] 9 | packages = [ 10 | "love" 11 | ] 12 | setup = [ 13 | ] 14 | 15 | [run] 16 | command = [ 17 | "love", 18 | "." 19 | ] 20 | 21 | [tests] 22 | 23 | [tests.hello] 24 | skip = true 25 | code = """ 26 | 27 | function love.conf(t) 28 | t.console = true 29 | end 30 | print("hello") 31 | love.event.quit(0) 32 | 33 | """ 34 | output = "hello\n" 35 | -------------------------------------------------------------------------------- /languages/fsharp.toml: -------------------------------------------------------------------------------- 1 | name = "fsharp" 2 | languages = [ 3 | "csharp" 4 | ] 5 | aliases = [ 6 | "f#" 7 | ] 8 | entrypoint = "main.fs" 9 | extensions = [ 10 | "fs" 11 | ] 12 | 13 | packages = [ 14 | "fsharp", 15 | ] 16 | 17 | [compile] 18 | command = [ 19 | "fsharpc", 20 | "--nologo", 21 | "--out:main.exe" 22 | ] 23 | 24 | [run] 25 | command = [ 26 | "mono", 27 | "main.exe" 28 | ] 29 | 30 | [tests] 31 | 32 | [tests.hello] 33 | code = "System.Console.WriteLine(\"hello\")" 34 | output = "hello\n" 35 | -------------------------------------------------------------------------------- /languages/quil.toml: -------------------------------------------------------------------------------- 1 | name = "quil" 2 | languages = [ 3 | "python3" 4 | ] 5 | entrypoint = "main.quil" 6 | extensions = [ 7 | "quil" 8 | ] 9 | packages = [] 10 | setup = [ 11 | "/opt/virtualenvs/python3/bin/pip3 install referenceqvm==0.3 pyquil==1.9.0", 12 | # Avoid using older versions of the typing library. 13 | "/opt/virtualenvs/python3/bin/python3 -m pip uninstall -y typing", 14 | ] 15 | 16 | versionCommand = [ 17 | "/bin/bash", 18 | "-c", 19 | "/opt/virtualenvs/python3/bin/pip3 show pyquil | grep Version " 20 | ] 21 | -------------------------------------------------------------------------------- /languages/reactjs.toml: -------------------------------------------------------------------------------- 1 | name = "reactjs" 2 | languages = [ 3 | "nodejs" 4 | ] 5 | entrypoint = "src/index.js" 6 | extensions = [ 7 | "js" 8 | ] 9 | setup = [ 10 | "rm -rf /home/runner/.profile /home/runner/.bashrc /home/runner/.bash_logout /home/runner/.cache /home/runner/.npm", 11 | "npx create-react-app /home/runner/app", 12 | "rsync --archive /home/runner/app/ /home/runner", 13 | "rm -rf /home/runner/app", 14 | "yarn", 15 | "rm -f README.md" 16 | ] 17 | 18 | [run] 19 | command = [ 20 | "yarn", 21 | "start" 22 | ] 23 | -------------------------------------------------------------------------------- /languages/lua.toml: -------------------------------------------------------------------------------- 1 | name = "lua" 2 | entrypoint = "main.lua" 3 | extensions = [ 4 | "lua" 5 | ] 6 | packages = [ 7 | "lua5.1", 8 | "liblua5.1-0", 9 | "liblua5.1-bitop0", 10 | "lua-socket", 11 | "luarocks" 12 | ] 13 | setup = [ 14 | "luarocks install formatter && luarocks install metalua && luarocks install penlight", 15 | "/usr/bin/build-prybar-lang.sh lua" 16 | ] 17 | 18 | [run] 19 | command = [ 20 | "lua", 21 | "./main.lua" 22 | ] 23 | 24 | [tests] 25 | 26 | [tests.hello] 27 | code = "print(\"hello\")" 28 | output = "hello\n" 29 | -------------------------------------------------------------------------------- /languages/bash.toml: -------------------------------------------------------------------------------- 1 | name = "bash" 2 | entrypoint = "main.sh" 3 | extensions = [ 4 | "sh" 5 | ] 6 | packages = [ 7 | ] 8 | setup = [ 9 | "cd /tmp && wget --quiet https://github.com/ewiger/beautify_bash/archive/master.tar.gz && tar xfz master.tar.gz && cp beautify_bash-master/beautify_bash.py /bin/ && chmod +x /bin/beautify_bash.py && rm -rf beautify_bash-master && rm -rf master.tar.gz" 10 | ] 11 | 12 | [run] 13 | command = [ 14 | "/bin/bash", 15 | "./main.sh" 16 | ] 17 | 18 | [tests] 19 | 20 | [tests.hello] 21 | code = "echo hello" 22 | output = "hello\n" 23 | -------------------------------------------------------------------------------- /languages/reactts.toml: -------------------------------------------------------------------------------- 1 | name = "reactts" 2 | languages = [ 3 | "nodejs" 4 | ] 5 | entrypoint = "src/index.tsx" 6 | extensions = [ 7 | "tsx" 8 | ] 9 | setup = [ 10 | "rm -rf /home/runner/.profile /home/runner/.bashrc /home/runner/.bash_logout /home/runner/.cache /home/runner/.npm", 11 | "npx create-react-app --scripts-version=react-scripts-ts /home/runner/app", 12 | "rsync --archive /home/runner/app/ /home/runner", 13 | "rm -rf /home/runner/app", 14 | "yarn", 15 | "rm -f README.md" 16 | ] 17 | 18 | [run] 19 | command = [ 20 | "yarn", 21 | "start" 22 | ] 23 | -------------------------------------------------------------------------------- /languages/wren.toml: -------------------------------------------------------------------------------- 1 | name = "wren" 2 | entrypoint = "main.wren" 3 | 4 | extensions = [ 5 | "wren" 6 | ] 7 | 8 | setup = [ 9 | "wget https://github.com/wren-lang/wren-cli/releases/download/0.3.0/wren_cli-linux-0.3.0.zip", 10 | "unzip wren_cli-linux-0.3.0.zip", 11 | "install wren_cli-linux-0.3.0/wren_cli /usr/local/bin", 12 | "rm -rf wren_cli-linux-0.3.0" 13 | ] 14 | 15 | [run] 16 | command = [ 17 | "wren_cli", 18 | "main.wren", 19 | ] 20 | 21 | [tests] 22 | [tests.hello] 23 | code = "System.print(\"hello\")" 24 | output = "hello\n" 25 | -------------------------------------------------------------------------------- /languages/crystal.toml: -------------------------------------------------------------------------------- 1 | name = "crystal" 2 | entrypoint = "main.cr" 3 | extensions = [ 4 | "cr" 5 | ] 6 | packages = [ 7 | "libssl-dev", 8 | "libz-dev", 9 | "crystal" 10 | ] 11 | aptKeys = [ 12 | "321DC2EA7F0A4F06714516B8E456AE72856D1476" 13 | ] 14 | aptRepos = [ 15 | "deb https://download.opensuse.org/repositories/devel:languages:crystal/xUbuntu_18.04/ /" 16 | ] 17 | 18 | [run] 19 | command = [ 20 | "crystal", 21 | "run", 22 | "./main.cr" 23 | ] 24 | 25 | [tests] 26 | 27 | [tests.hello] 28 | code = 'puts "hello world"' 29 | output = "hello world\n" 30 | -------------------------------------------------------------------------------- /languages/haskell.toml: -------------------------------------------------------------------------------- 1 | name = "haskell" 2 | entrypoint = "main.hs" 3 | extensions = [ 4 | "hs" 5 | ] 6 | packages = [ 7 | "ghc" 8 | ] 9 | 10 | [compile] 11 | command = [ 12 | "ghc", 13 | "-o", 14 | "main" 15 | ] 16 | 17 | [run] 18 | command = [ 19 | "./main" 20 | ] 21 | 22 | [tests] 23 | 24 | [tests.0] 25 | code = "main = do\n putStrLn \"What's your name?\"\n name <- getLine \n putStrLn ( \"Hey, \" ++ name)" 26 | output = "Hey, goval\n" 27 | input = "goval\n" 28 | 29 | [tests.hello] 30 | code = "main = putStrLn \"hello\"" 31 | output = "hello\n" 32 | -------------------------------------------------------------------------------- /languages/kotlin.toml: -------------------------------------------------------------------------------- 1 | name = "kotlin" 2 | entrypoint = "main.kt" 3 | extensions = [ 4 | "kt" 5 | ] 6 | packages = [ 7 | "openjdk-11-jdk" 8 | ] 9 | setup = [ 10 | "wget https://github.com/JetBrains/kotlin/releases/download/v1.3.72/kotlin-compiler-1.3.72.zip -O /tmp/a.zip", 11 | "unzip /tmp/a.zip -d /opt", 12 | "rm /tmp/a.zip", 13 | "ln -s /opt/kotlinc/bin/kotlin{,c,c-js,c-jvm} /usr/local/bin/" 14 | ] 15 | 16 | versionCommand = ["kotlin", "-version"] 17 | 18 | [tests] 19 | 20 | [tests.hello] 21 | code = "println(\"hello\")" 22 | output = "hello\n" 23 | skip = true 24 | -------------------------------------------------------------------------------- /gen/tests.ejs: -------------------------------------------------------------------------------- 1 | <% for ( let lang of languages ) { -%> 2 | # <%= lang.name %> 3 | <% for ( let tname in lang.tests ) { -%> 4 | <% let test = lang.tests[tname]; -%> 5 | <% if ( test.input ) continue; %> 6 | <% if ( test.skip ) { %> 7 | echo S <%= lang.name %>:<%= tname %> 8 | <% } else { %> 9 | echo "<%= btoa(test.code) %>" | base64 --decode | docker run --rm -i polygott run-project -s -l <%= lang.id %> | diff -u --label "<%= lang.name %>" <( echo "<%= btoa(test.output) %>" | base64 --decode ) - && echo ✓ <%= lang.name %>:<%= tname %> 10 | <% } %> 11 | <% } %> 12 | <% } -%> 13 | -------------------------------------------------------------------------------- /gen/Dockerfile.splice.ejs: -------------------------------------------------------------------------------- 1 | # syntax = docker/dockerfile:1.2@sha256:e2a8561e419ab1ba6b2fe6cbdf49fd92b95912df1cf7d313c3e2230a333fdbcc 2 | 3 | # A Dockerfile that can splice multiple independent layers into a single image. 4 | 5 | 6 | ## Final image where the contents of the tarballs are all extracted together. 7 | FROM polygott:phase1.5 AS polygott 8 | #ADD# 9 | RUN : > /etc/ld.so.cache && \ 10 | ldconfig && \ 11 | mkdir -p /inject /io /mnt/scratch /mnt/cacache 12 | ENV \ 13 | <%- Object.entries(env).map(([key, value]) => `${key}="${value}"`).sort().join(' \\\n ') %> 14 | WORKDIR /home/runner 15 | -------------------------------------------------------------------------------- /languages/deno.toml: -------------------------------------------------------------------------------- 1 | name = "deno" 2 | entrypoint = "index.ts" 3 | extensions = [ 4 | "ts" 5 | ] 6 | setup = [ 7 | "curl -fsSL https://deno.land/x/install/install.sh | DENO_INSTALL=/usr sh -s v1.11.0" 8 | ] 9 | 10 | [languageServer] 11 | command = [ 12 | "deno", 13 | "lsp" 14 | ] 15 | 16 | [run] 17 | command = [ 18 | "deno", 19 | "run", 20 | "--lock=lock.json", 21 | "--lock-write", 22 | "--allow-all", 23 | "index.ts" 24 | ] 25 | 26 | [tests] 27 | [tests.hello] 28 | code = "console.log(\"hello\")" 29 | output = "hello\n" 30 | 31 | versionCommand = [ 32 | "deno", 33 | "--version" 34 | ] 35 | -------------------------------------------------------------------------------- /languages/assembly.toml: -------------------------------------------------------------------------------- 1 | name = "assembly" 2 | entrypoint = "main.asm" 3 | extensions = [ 4 | "asm", 5 | "s" 6 | ] 7 | packages = [ 8 | "nasm", 9 | ] 10 | 11 | [compile] 12 | command = [ 13 | "/bin/bash", 14 | "-c", 15 | "nasm -felf64 -omain.o main.asm && ld -s -omain main.o", 16 | ] 17 | 18 | [run] 19 | command = [ 20 | "./main" 21 | ] 22 | 23 | [tests] 24 | [tests.hello] 25 | code = "section .text\nglobal _start\n_start:\nmov rax, 1\nmov rdi, 1\nmov rsi, buf\nmov rdx, 5\nsyscall\nmov rax, 60\nxor rdi, rdi\nsyscall\nsection .data\nbuf: db \"hello\"" 26 | output = "hello" 27 | -------------------------------------------------------------------------------- /languages/ocaml.toml: -------------------------------------------------------------------------------- 1 | name = "ocaml" 2 | entrypoint = "main.ml" 3 | extensions = [ 4 | "ml" 5 | ] 6 | 7 | aptKeys = [] 8 | aptRepos = [ 9 | "ppa:avsm/ppa" 10 | ] 11 | 12 | 13 | packages = [ 14 | "m4", 15 | "ocaml", 16 | "opam" 17 | ] 18 | 19 | setup = [ 20 | "opam init -c ocaml-system -n --disable-sandboxing", 21 | "/usr/bin/build-prybar-lang.sh ocaml" 22 | ] 23 | 24 | [compile] 25 | command = [ 26 | "ocamlc", 27 | "-o", 28 | "main" 29 | ] 30 | 31 | [run] 32 | command = [ 33 | "./main" 34 | ] 35 | 36 | [tests] 37 | 38 | [tests.hello] 39 | code = """print_string "hello world!\n";;""" 40 | output = "hello world!\n" 41 | -------------------------------------------------------------------------------- /languages/ballerina.toml: -------------------------------------------------------------------------------- 1 | name = "ballerina" 2 | entrypoint = "main.bal" 3 | languages = [ 4 | "java" 5 | ] 6 | extensions = [ 7 | "bal" 8 | ] 9 | setup = [ 10 | "wget https://dist.ballerina.io/downloads/1.2.13/ballerina-linux-installer-x64-1.2.13.deb", 11 | "dpkg -i ballerina-linux-installer-x64-1.2.13.deb", 12 | "rm -r ballerina-linux-installer-x64-1.2.13.deb" 13 | ] 14 | 15 | 16 | [run] 17 | command = [ 18 | "ballerina", 19 | "run", 20 | "main.bal" 21 | ] 22 | 23 | [tests] 24 | 25 | [tests.hello] 26 | code = """ 27 | import ballerina/io; 28 | public function main() { 29 | io:println("Hello, World!"); 30 | } 31 | """ 32 | output = "Hello, World!\n" 33 | -------------------------------------------------------------------------------- /languages/rust.toml: -------------------------------------------------------------------------------- 1 | name = "rust" 2 | entrypoint = "main.rs" 3 | extensions = [ 4 | "rs" 5 | ] 6 | packages = [ 7 | "rust-gdb" 8 | ] 9 | setup = [ 10 | "curl --proto '=https' --tlsv1.2 -Sf https://static.rust-lang.org/dist/rust-1.44.0-x86_64-unknown-linux-gnu.tar.gz | tar xz -C /tmp", 11 | "/tmp/rust-1.44.0-x86_64-unknown-linux-gnu/install.sh", 12 | "rm -rf /tmp/rust-1.44.0-x86_64-unknown-linux-gnu" 13 | ] 14 | 15 | [compile] 16 | command = [ 17 | "rustc", 18 | "-o", 19 | "main" 20 | ] 21 | 22 | [run] 23 | command = [ 24 | "./main" 25 | ] 26 | 27 | [tests] 28 | 29 | [tests.hello] 30 | code = "fn main() {\n println!(\"hello\");\n}" 31 | output = "hello\n" 32 | -------------------------------------------------------------------------------- /languages/tcl.toml: -------------------------------------------------------------------------------- 1 | name = "tcl" 2 | entrypoint = "main.tcl" 3 | extensions = [ 4 | "tcl" 5 | ] 6 | packages = [ 7 | "pkg-config", 8 | "tcl8.6", 9 | "tklib", 10 | "tcllib", 11 | "tcl-dev" 12 | ] 13 | setup = [ 14 | "cp /gocode/src/github.com/replit/prybar/languages/tcl/tcl.pc /usr/lib/pkgconfig/tcl.pc", 15 | "/usr/bin/build-prybar-lang.sh tcl" 16 | ] 17 | 18 | versionCommand = [ 19 | "/bin/bash", 20 | "-c", 21 | "echo \"puts [list tcl $tcl_version]\" | tclsh8.6" 22 | ] 23 | 24 | [run] 25 | command = [ 26 | "prybar-tcl", 27 | "-q", 28 | "./main.tcl" 29 | ] 30 | 31 | [tests] 32 | 33 | [tests.hello] 34 | code = "puts {hello}" 35 | output = "hello\n" 36 | -------------------------------------------------------------------------------- /languages/nodejs.toml: -------------------------------------------------------------------------------- 1 | name = "nodejs" 2 | entrypoint = "index.js" 3 | extensions = [ 4 | "js" 5 | ] 6 | aptKeyUrls = [ 7 | "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" 8 | ] 9 | aptRepos = [ 10 | "deb https://deb.nodesource.com/node_14.x bionic main", 11 | ] 12 | packages = [ 13 | "nodejs" 14 | ] 15 | setup = [ 16 | "npm install -g jest@23.1.0 prettier@1.13.4 babylon@6.15 babel-traverse@6.21 walker@1.0.7 yarn", 17 | "yarn global add jest", 18 | "/usr/bin/build-prybar-lang.sh nodejs" 19 | ] 20 | 21 | [run] 22 | command = [ 23 | "node", 24 | "index.js" 25 | ] 26 | 27 | [tests] 28 | 29 | [tests.hello] 30 | code = "console.log(\"hello\")" 31 | output = "hello\n" 32 | -------------------------------------------------------------------------------- /languages/cpp11.toml: -------------------------------------------------------------------------------- 1 | name = "cpp11" 2 | languages = [ 3 | "c" 4 | ] 5 | entrypoint = "main.cpp" 6 | extensions = [ 7 | "cpp", 8 | "cc", 9 | ] 10 | 11 | [compile] 12 | command = [ 13 | "clang++-7", 14 | "-pthread", 15 | "-std=c++11", 16 | "-o", 17 | "main" 18 | ] 19 | 20 | [run] 21 | command = [ 22 | "./main" 23 | ] 24 | 25 | [tests] 26 | 27 | [tests.hello] 28 | code = "#include \nint main() { std::cout << \"hello\" << std::endl; }" 29 | output = "hello\n" 30 | 31 | [languageServer] 32 | command = [ 33 | "cquery", 34 | "--init={\"progressReportFrequencyMs\": -1,\"cacheDirectory\":\"/tmp/cquery\", \"extraClangArguments\": [\"-std=c++11\", \"-pthread\"]}" 35 | ] 36 | -------------------------------------------------------------------------------- /languages/csharp.toml: -------------------------------------------------------------------------------- 1 | name = "csharp" 2 | aliases = [ 3 | "c#" 4 | ] 5 | entrypoint = "main.cs" 6 | extensions = [ 7 | "cs" 8 | ] 9 | 10 | aptKeys = ['3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF'] 11 | 12 | aptRepos = [ 13 | 'deb https://download.mono-project.com/repo/ubuntu stable-bionic main' 14 | ] 15 | 16 | packages = [ 17 | "mono-complete" 18 | ] 19 | 20 | [compile] 21 | command = [ 22 | "mcs", 23 | "-out:main.exe" 24 | ] 25 | 26 | [run] 27 | command = [ 28 | "mono", 29 | "main.exe" 30 | ] 31 | 32 | [tests] 33 | 34 | [tests.hello] 35 | code = "using System; class MainClass { public static void Main (string[] args) { Console.WriteLine (\"hello\"); } }" 36 | output = "hello\n" 37 | -------------------------------------------------------------------------------- /extra/_test_runner.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import unit_tests 3 | import os 4 | import json 5 | from time import sleep 6 | 7 | suite = unittest.TestLoader().loadTestsFromTestCase( 8 | unit_tests.UnitTests) 9 | f = open(os.devnull,"w") 10 | test_res = unittest.TextTestRunner(stream=f).run(suite) 11 | 12 | # Merge errors and failures and normalize to {name, stack} 13 | failures = [ 14 | { 15 | "name": r[0]._testMethodName, 16 | "stack": r[1], 17 | } for r in test_res.errors + test_res.failures 18 | ] 19 | 20 | print('\n__GOVAL_UNIT_TEST_RESULTS__') 21 | sleep(1) 22 | print(json.dumps({ 23 | "passed": test_res.wasSuccessful(), 24 | "failures": failures, 25 | })) 26 | print() 27 | -------------------------------------------------------------------------------- /languages/elisp.toml: -------------------------------------------------------------------------------- 1 | name = "elisp" 2 | entrypoint = "main.el" 3 | extensions = [ 4 | "el", 5 | "elc" 6 | ] 7 | packages = [ 8 | "emacs26", 9 | "sqlite3", # for UPM 10 | ] 11 | aptRepos = [ 12 | "ppa:kelleyk/emacs" 13 | ] 14 | setup = [ 15 | "git clone https://github.com/cask/cask.git /usr/local/cask", 16 | "ln -s /usr/local/cask/bin/cask /usr/local/bin/cask", 17 | "cask upgrade-cask", 18 | "/usr/bin/build-prybar-lang.sh elisp" 19 | ] 20 | 21 | [run] 22 | command = [ 23 | "emacs", 24 | "-nw", 25 | "-Q", 26 | "--script", 27 | "main.el" 28 | ] 29 | 30 | [tests] 31 | 32 | [tests.math] 33 | code = """ 34 | (princ (format "2 + 2 = %d\\n" (+ 2 2))) 35 | """ 36 | output = "2 + 2 = 4\n" 37 | -------------------------------------------------------------------------------- /packages.txt: -------------------------------------------------------------------------------- 1 | locales 2 | language-pack-en 3 | 4 | jq 5 | unzip 6 | curl 7 | wget 8 | git 9 | subversion 10 | mercurial 11 | rsync 12 | gnupg 13 | build-essential 14 | vim 15 | ca-certificates 16 | chromium-chromedriver 17 | firefox-geckodriver 18 | man 19 | rlwrap 20 | valgrind 21 | libc6-dbg 22 | 23 | busybox 24 | software-properties-common 25 | apt-utils 26 | dirmngr 27 | gpg-agent 28 | 29 | fluxbox 30 | gnuplot-qt 31 | libsdl-dev 32 | libsdl2-dev 33 | mesa-utils 34 | tigervnc-standalone-server 35 | x11-apps 36 | x11-utils 37 | 38 | cmake 39 | ninja-build 40 | 41 | silversearcher-ag 42 | ssh 43 | redis-tools 44 | 45 | libboost-all-dev 46 | 47 | golang-go 48 | 49 | libopus0 50 | libopusfile0 51 | pulseaudio 52 | 53 | ffmpeg 54 | -------------------------------------------------------------------------------- /languages/mercury.toml: -------------------------------------------------------------------------------- 1 | name = "mercury" 2 | entrypoint = "main.m" 3 | extensions = [ 4 | "m" 5 | ] 6 | 7 | aptKeys = ["6507444DBDF4EAD2"] 8 | aptRepos = ["deb http://dl.mercurylang.org/deb/ stretch main"] 9 | packages = [ 10 | "mercury-recommended", 11 | "mercury-examples" 12 | ] 13 | 14 | versionCommand = [ 15 | "mmc", 16 | "--version" 17 | ] 18 | 19 | [compile] 20 | command = [ 21 | "mmc", 22 | "--make", 23 | "main" 24 | ] 25 | 26 | [run] 27 | command = [ 28 | "./main" 29 | ] 30 | 31 | [tests] 32 | 33 | [tests.hello] 34 | code = ":- module main.\n:- interface.\n:- import_module io.\n:- pred 35 | main(io::di, io::uo) is det.\n:- implementation.\nmain(!IO) :-\n io.write_string(\"hello world\n\", !IO)." 36 | output = "hello world\n" 37 | -------------------------------------------------------------------------------- /gen/run-language-server.ejs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | LANGUAGE="$(detect-language "$@")" 6 | 7 | while getopts ":sl:" opt; do 8 | case ${opt} in 9 | l ) 10 | LANGUAGE=$OPTARG 11 | ;; 12 | \? ) 13 | echo "Usage: run-language-server [-l language]" 14 | exit 1 15 | ;; 16 | esac 17 | done 18 | 19 | 20 | case "$LANGUAGE" in 21 | <% for ( let lang of languages ) { -%> 22 | <%- lang.names.map(x => `"${x}"`).join('|') %>) 23 | <% if ( lang.languageServer ) { -%> 24 | exec <%- c(lang.languageServer.command) %> 25 | <% } else { -%> 26 | echo "No language server configured for <%= lang.name %>" >&2 27 | exit 1 28 | <% } -%> 29 | ;; 30 | <% } -%> 31 | *) 32 | echo "Unknown Language: $LANGUAGE" 33 | ;; 34 | esac 35 | -------------------------------------------------------------------------------- /languages/powershell.toml: -------------------------------------------------------------------------------- 1 | name = "powershell" 2 | entrypoint = "main.ps1" 3 | extensions = [ 4 | "ps1", 5 | "psm1", 6 | "psd1" 7 | ] 8 | packages = [ 9 | ] 10 | setup = [ 11 | "curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v7.0.3/powershell-7.0.3-linux-x64.tar.gz", 12 | "mkdir /usr/local/pwsh", 13 | "tar zxf /tmp/powershell.tar.gz -C /usr/local/pwsh", 14 | "ln -s -f /usr/local/pwsh/pwsh /usr/bin/pwsh", 15 | "ln -s -f /usr/local/pwsh/pwsh /usr/bin/powershell", 16 | "rm -f /tmp/powershell.tar.gz" 17 | ] 18 | [run] 19 | command = [ 20 | "pwsh", 21 | "main.ps1" 22 | ] 23 | [tests] 24 | 25 | [tests.hello] 26 | code = "$strString = \"Hello World\"; write-host $strString" 27 | output = "Hello World\n" 28 | -------------------------------------------------------------------------------- /languages/scala.toml: -------------------------------------------------------------------------------- 1 | name = "scala" 2 | languages = [ 3 | "java" 4 | ] 5 | entrypoint = "Main.scala" 6 | extensions = [ 7 | "scala" 8 | ] 9 | setup = [ 10 | "wget -nv https://downloads.lightbend.com/scala/2.13.1/scala-2.13.1.tgz", 11 | "tar -xf scala-2.13.1.tgz", 12 | "cp -R scala-2.13.1/bin/* /usr/local/bin/", 13 | "cp -R scala-2.13.1/lib/* /usr/local/lib/", 14 | "rm -rf scala-2.13.1/", 15 | "/usr/bin/build-prybar-lang.sh scala" 16 | ] 17 | 18 | [compile] 19 | command = [ 20 | "scalac" 21 | ] 22 | 23 | [run] 24 | command = [ 25 | "scala", 26 | "Main" 27 | ] 28 | 29 | [tests] 30 | 31 | [tests.hello] 32 | code = "object Main { def main(args: Array[String]) { println(\"Hello, world!\") } }\n" 33 | output = "Hello, world!\n" 34 | -------------------------------------------------------------------------------- /languages/julia.toml: -------------------------------------------------------------------------------- 1 | name = "julia" 2 | entrypoint = "main.jl" 3 | extensions = [ 4 | "jl" 5 | ] 6 | packages = [ 7 | ] 8 | setup = [ 9 | "wget https://julialang-s3.julialang.org/bin/linux/x64/1.4/julia-1.4.1-linux-x86_64.tar.gz", 10 | "tar xf julia-1.4.1-linux-x86_64.tar.gz", 11 | "cp julia-1.4.1/bin/julia /usr/bin/", 12 | "cp -r julia-1.4.1/lib/* /usr/lib/", 13 | "cp -r julia-1.4.1/include/* /usr/include/", 14 | "cp -r julia-1.4.1/share/* /usr/share/", 15 | "rm -rf ./julia-1.4.1 julia-1.4.1-linux-x86_64.tar.gz", 16 | "/usr/bin/build-prybar-lang.sh julia" 17 | ] 18 | 19 | [run] 20 | command = [ 21 | "prybar-julia", 22 | "-q", 23 | "./main.jl" 24 | ] 25 | 26 | [tests] 27 | 28 | [tests.hello] 29 | code = "println(\"hello\")" 30 | output = "hello\n" 31 | -------------------------------------------------------------------------------- /languages/dart.toml: -------------------------------------------------------------------------------- 1 | name = "dart" 2 | entrypoint = "main.dart" 3 | extensions = [ 4 | "dart" 5 | ] 6 | packages = [ 7 | "dart=2.6.0-1" 8 | ] 9 | aptKeys = [ 10 | "6494C6D6997C215E" 11 | ] 12 | aptRepos = [ 13 | "deb [arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main" 14 | ] 15 | setup = [ 16 | "ln -s /usr/lib/dart/bin/pub /usr/local/bin/pub", 17 | ] 18 | 19 | [languageServer] 20 | command = [ 21 | "/usr/lib/dart/bin/dart", 22 | "/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot", 23 | "--lsp", 24 | ] 25 | 26 | [run] 27 | command = [ 28 | "/usr/lib/dart/bin/dart", 29 | "./main.dart" 30 | ] 31 | 32 | [tests] 33 | 34 | [tests.hello] 35 | code = "void main() { print('Hello, World!'); }" 36 | output = "Hello, World!\n" 37 | -------------------------------------------------------------------------------- /languages/nix.toml: -------------------------------------------------------------------------------- 1 | name = "nix" 2 | entrypoint = "main.sh" 3 | popularity = 5.0 4 | extensions = [ 5 | "sh" 6 | ] 7 | packages = [ 8 | ] 9 | setup = [ 10 | """ 11 | mkdir -m 0755 /nix && chown runner /nix 12 | chown -R runner:runner /home/runner 13 | su runner -c 'curl -L https://nixos.org/nix/install | sh && . /home/runner/.nix-profile/etc/profile.d/nix.sh && nix-channel --update && nix search -u > /dev/null' 14 | """ 15 | ] 16 | 17 | # a rough approximation of how nix will be used 18 | [run] 19 | command = [ 20 | "bash", 21 | "main.sh" 22 | ] 23 | [tests] 24 | [tests.hello] 25 | code = """ 26 | echo '{ pkgs }: { deps = [ pkgs.python39 ]; }' > replit.nix 27 | nix-shell --argstr repldir "$PWD" /opt/nixproxy.nix --command "python --version" 28 | 29 | """ 30 | output = "Python 3.9.6\n" 31 | -------------------------------------------------------------------------------- /languages/nim.toml: -------------------------------------------------------------------------------- 1 | name = "nim" 2 | entrypoint = "main.nim" 3 | extensions = [ 4 | "nim" 5 | ] 6 | 7 | setup = [ 8 | """ 9 | NIM_VER="1.2.0" 10 | wget https://nim-lang.org/download/nim-$NIM_VER.tar.xz 11 | tar xf nim-$NIM_VER.tar.xz 12 | rm -rf nim-$NIM_VER.tar.xz 13 | chown -R root: nim-$NIM_VER/ 14 | cd nim-$NIM_VER 15 | sh build.sh 16 | ./bin/nim c koch.nim 17 | ./koch tools 18 | sh install.sh /usr/local/bin 19 | cp ./bin/* /usr/local/bin 20 | cd .. 21 | rm -rf nim-$NIM_VER 22 | unset NIM_VER""" 23 | ] 24 | 25 | [run] 26 | command = [ 27 | "nim", 28 | "compile", 29 | "--run", 30 | "main.nim" 31 | ] 32 | 33 | [tests] 34 | 35 | [tests.hello] 36 | code = "echo \"hello world\"" 37 | output = "CC: stdlib_io.nim\nCC: stdlib_system.nim\nCC: main.nim\nhello world\n" 38 | -------------------------------------------------------------------------------- /gen/lang-setup.ejs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | shopt -s dotglob 4 | 5 | LANGUAGE=`detect-language` 6 | 7 | while getopts ":sl:" opt; do 8 | case ${opt} in 9 | l ) 10 | LANGUAGE=$OPTARG 11 | ;; 12 | \? ) 13 | echo "Usage: run-project [-s] [-l language]" 14 | exit 1 15 | ;; 16 | esac 17 | done 18 | 19 | case "$LANGUAGE" in 20 | <% for ( let lang of languages ) { -%> 21 | <%- lang.names.map(x => `"${x}"`).join('|') %>) 22 | if [ -d "/opt/homes/<%= lang.name %>" ]; then 23 | cp -a "/opt/homes/<%= lang.name %>"/* /home/runner/ 24 | fi 25 | <% if ( lang.runtimeSetup ) { -%> 26 | <% for ( let line of lang.runtimeSetup ) { -%> 27 | <%- line %> 28 | <% } -%> 29 | <% } -%> 30 | ;; 31 | <% } -%> 32 | *) 33 | echo "Unknown Language: $LANGUAGE" 34 | ;; 35 | esac 36 | -------------------------------------------------------------------------------- /languages/erlang.toml: -------------------------------------------------------------------------------- 1 | name = "erlang" 2 | entrypoint = "main.erl" 3 | extensions = [ 4 | "erl" 5 | ] 6 | aptKeyUrls = [ 7 | "https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc" 8 | ] 9 | aptRepos = [ 10 | "deb https://packages.erlang-solutions.com/ubuntu bionic contrib" 11 | ] 12 | packages = [ 13 | "esl-erlang" 14 | ] 15 | 16 | versionCommand = [ 17 | "erl", 18 | "-version" 19 | ] 20 | 21 | [compile] 22 | command = [ 23 | "erlc", 24 | "main.erl" 25 | ] 26 | 27 | [run] 28 | command = [ 29 | "erl", 30 | "-noshell", 31 | "-s", 32 | "main", 33 | "start", 34 | "-s", 35 | "init", 36 | "stop" 37 | ] 38 | 39 | [tests] 40 | 41 | [tests.hello] 42 | code = "-module(main).\n-export([start/0]).\n\nstart() ->\n io:fwrite(\"hello world\n\")." 43 | output = "hello world\n" 44 | -------------------------------------------------------------------------------- /extra/pulse/client.conf: -------------------------------------------------------------------------------- 1 | # This file is part of PulseAudio. 2 | # 3 | # PulseAudio is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU Lesser General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # PulseAudio is distributed in the hope that it will be useful, but 9 | # WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | # General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU Lesser General Public License 14 | # along with PulseAudio; if not, see . 15 | 16 | autospawn = no 17 | cookie-file = /home/runner/.config/pulse/cookie 18 | -------------------------------------------------------------------------------- /languages/python.toml: -------------------------------------------------------------------------------- 1 | name = "python" 2 | entrypoint = "main.py" 3 | extensions = [ 4 | "py" 5 | ] 6 | packages = [ 7 | "python-pip", 8 | "python-wheel", 9 | "python-dev", 10 | "libtk8.6", 11 | "python-dev", 12 | "libevent-dev", 13 | "gcc", 14 | "python-tk", 15 | "tk-dev" 16 | ] 17 | setup = [ 18 | "pip2 install -U setuptools", 19 | "pip2 install -U configparser", 20 | "pip2 install --no-cache-dir pipreqs-amasad==0.4.10 jedi==0.12.1 pyflakes==2.0.0 rope==0.11.0 yapf==0.25.0 mccabe==0.6.1 nltk numpy scipy requests matplotlib bpython ptpython", 21 | ] 22 | 23 | [run] 24 | command = [ 25 | "python2", 26 | "-B", 27 | "main.py" 28 | ] 29 | 30 | [tests] 31 | 32 | [tests.hello] 33 | code = "print \"hello\"" 34 | output = "hello\n" 35 | 36 | [languageServer] 37 | command = [ 38 | "pyls", 39 | "-v" 40 | ] 41 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/dart: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup dart' 11 | cd "${HOME}" 12 | 13 | ln -s /usr/lib/dart/bin/pub /usr/local/bin/pub 14 | 15 | if [[ -n "$(ls -A /home/runner)" ]]; then 16 | echo Storing home for dart 17 | mkdir -p /opt/homes/dart 18 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/dart 19 | chown runner:runner -R /opt/homes/dart 20 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 21 | ls -A /opt/homes/dart 22 | fi 23 | 24 | chown runner:runner -R /home/runner /config /opt/virtualenvs 25 | if [[ -n "$(ls /tmp/)" ]]; then 26 | rm -rf /tmp/* 27 | fi 28 | 29 | 30 | rm /phase2.sh 31 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/sqlite: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup sqlite' 11 | cd "${HOME}" 12 | 13 | /usr/bin/build-prybar-lang.sh sqlite 14 | 15 | if [[ -n "$(ls -A /home/runner)" ]]; then 16 | echo Storing home for sqlite 17 | mkdir -p /opt/homes/sqlite 18 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/sqlite 19 | chown runner:runner -R /opt/homes/sqlite 20 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 21 | ls -A /opt/homes/sqlite 22 | fi 23 | 24 | chown runner:runner -R /home/runner /config /opt/virtualenvs 25 | if [[ -n "$(ls /tmp/)" ]]; then 26 | rm -rf /tmp/* 27 | fi 28 | 29 | 30 | rm /phase2.sh 31 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/deno: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup deno' 11 | cd "${HOME}" 12 | 13 | curl -fsSL https://deno.land/x/install/install.sh | DENO_INSTALL=/usr sh -s v1.11.0 14 | 15 | if [[ -n "$(ls -A /home/runner)" ]]; then 16 | echo Storing home for deno 17 | mkdir -p /opt/homes/deno 18 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/deno 19 | chown runner:runner -R /opt/homes/deno 20 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 21 | ls -A /opt/homes/deno 22 | fi 23 | 24 | chown runner:runner -R /home/runner /config /opt/virtualenvs 25 | if [[ -n "$(ls /tmp/)" ]]; then 26 | rm -rf /tmp/* 27 | fi 28 | 29 | 30 | rm /phase2.sh 31 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # Exclude EVERYTHING. 2 | * 3 | 4 | # Only allow things that are explicitly referenced from the Dockerfiles. 5 | !extra/_test_runner.py 6 | !extra/apt-install 7 | !extra/build-prybar-lang.sh 8 | !extra/config.toml 9 | !extra/cquery11 10 | !extra/fluxbox/apps 11 | !extra/fluxbox/init 12 | !extra/java-dap 13 | !extra/py-dap 14 | !extra/lang-gitignore 15 | !extra/matplotlibrc 16 | !extra/polygott-gitignore 17 | !extra/pulse/client.conf 18 | !extra/pulse/default.pa 19 | !extra/pycodestyle 20 | !extra/pylintrc 21 | !extra/replit-v2.py 22 | !extra/replit-v2.py 23 | !out/detect-language 24 | !out/phase0.sh 25 | !out/polygott-lang-setup 26 | !out/polygott-survey 27 | !out/polygott-x11-vnc 28 | !out/run-language-server 29 | !out/run-project 30 | !extra/nixproxy.nix 31 | !out/self-test 32 | !out/share/polygott/phase2.d/* 33 | !out/share/polygott/self-test.d/* 34 | !run_dir/ 35 | !run_dir/**/* 36 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/ocaml: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup ocaml' 11 | cd "${HOME}" 12 | 13 | opam init -c ocaml-system -n --disable-sandboxing 14 | /usr/bin/build-prybar-lang.sh ocaml 15 | 16 | if [[ -n "$(ls -A /home/runner)" ]]; then 17 | echo Storing home for ocaml 18 | mkdir -p /opt/homes/ocaml 19 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/ocaml 20 | chown runner:runner -R /opt/homes/ocaml 21 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 22 | ls -A /opt/homes/ocaml 23 | fi 24 | 25 | chown runner:runner -R /home/runner /config /opt/virtualenvs 26 | if [[ -n "$(ls /tmp/)" ]]; then 27 | rm -rf /tmp/* 28 | fi 29 | 30 | 31 | rm /phase2.sh 32 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/lua: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup lua' 11 | cd "${HOME}" 12 | 13 | luarocks install formatter && luarocks install metalua && luarocks install penlight 14 | /usr/bin/build-prybar-lang.sh lua 15 | 16 | if [[ -n "$(ls -A /home/runner)" ]]; then 17 | echo Storing home for lua 18 | mkdir -p /opt/homes/lua 19 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/lua 20 | chown runner:runner -R /opt/homes/lua 21 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 22 | ls -A /opt/homes/lua 23 | fi 24 | 25 | chown runner:runner -R /home/runner /config /opt/virtualenvs 26 | if [[ -n "$(ls /tmp/)" ]]; then 27 | rm -rf /tmp/* 28 | fi 29 | 30 | 31 | rm /phase2.sh 32 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/tcl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup tcl' 11 | cd "${HOME}" 12 | 13 | cp /gocode/src/github.com/replit/prybar/languages/tcl/tcl.pc /usr/lib/pkgconfig/tcl.pc 14 | /usr/bin/build-prybar-lang.sh tcl 15 | 16 | if [[ -n "$(ls -A /home/runner)" ]]; then 17 | echo Storing home for tcl 18 | mkdir -p /opt/homes/tcl 19 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/tcl 20 | chown runner:runner -R /opt/homes/tcl 21 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 22 | ls -A /opt/homes/tcl 23 | fi 24 | 25 | chown runner:runner -R /home/runner /config /opt/virtualenvs 26 | if [[ -n "$(ls /tmp/)" ]]; then 27 | rm -rf /tmp/* 28 | fi 29 | 30 | 31 | rm /phase2.sh 32 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/tcl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",tcl,"* ]]; then 8 | echo S 'tcl:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'tcl' 14 | 15 | # tcl:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'cHV0cyB7aGVsbG99' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'tcl' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'tcl' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'tcl:hello' 33 | else 34 | echo ❌ 'tcl:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /languages/ruby.toml: -------------------------------------------------------------------------------- 1 | name = "ruby" 2 | entrypoint = "main.rb" 3 | extensions = [ 4 | "rb" 5 | ] 6 | packages = [ 7 | "build-essential", 8 | "rake-compiler", 9 | "ruby-dev", 10 | "ruby", 11 | "rubygems-integration", 12 | "rubygems", 13 | "libsqlite3-dev", 14 | ] 15 | setup = [ 16 | """ 17 | # Gemfile.lock files are dependent on the exact bundler version. Always add 18 | # new versions and never remove old versions from this list. 19 | gem install bundler:2.2.3 bundler:2.2.7 20 | gem install --source http://rubygems.org rspec:3.5 stripe rufo:0.12.0 sinatra 21 | gem install solargraph:0.38.1 22 | /usr/bin/build-prybar-lang.sh ruby 23 | """ 24 | ] 25 | 26 | [run] 27 | command = [ 28 | "ruby", 29 | "main.rb" 30 | ] 31 | 32 | [tests] 33 | 34 | [tests.hello] 35 | code = "puts \"hello\"" 36 | output = "hello\n" 37 | 38 | [languageServer] 39 | command = [ 40 | "solargraph", 41 | "stdio" 42 | ] 43 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/lua: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",lua,"* ]]; then 8 | echo S 'lua:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'lua' 14 | 15 | # lua:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'cHJpbnQoImhlbGxvIik=' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'lua' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'lua' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'lua:hello' 33 | else 34 | echo ❌ 'lua:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",bash,"* ]]; then 8 | echo S 'bash:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'bash' 14 | 15 | # bash:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'ZWNobyBoZWxsbw==' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'bash' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'bash' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'bash:hello' 33 | else 34 | echo ❌ 'bash:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/ruby: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",ruby,"* ]]; then 8 | echo S 'ruby:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'ruby' 14 | 15 | # ruby:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'cHV0cyAiaGVsbG8i' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'ruby' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'ruby' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'ruby:hello' 33 | else 34 | echo ❌ 'ruby:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/php: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",php,"* ]]; then 8 | echo S 'php:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'php' 14 | 15 | # php:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'PD9waHAgZWNobyAiaGVsbG8KIjs=' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'php' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'php' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'php:hello' 33 | else 34 | echo ❌ 'php:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/forth: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",forth,"* ]]; then 8 | echo S 'forth:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'forth' 14 | 15 | # forth:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'LiIgaGVsbG8iIENS' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'forth' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'forth' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'forth:hello' 33 | else 34 | echo ❌ 'forth:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /languages/cpp.toml: -------------------------------------------------------------------------------- 1 | name = "cpp" 2 | languages = [ 3 | "c" 4 | ] 5 | aliases = [ 6 | "c++" 7 | ] 8 | entrypoint = "main.cpp" 9 | extensions = [ 10 | "cpp", 11 | "cc", 12 | ] 13 | 14 | [compile] 15 | command = [ 16 | "clang++-7", 17 | "-pthread", 18 | "-std=c++17", 19 | "-o", 20 | "main" 21 | ] 22 | 23 | [run] 24 | command = [ 25 | "./main" 26 | ] 27 | 28 | [tests] 29 | 30 | [tests.0] 31 | code = "#include \n #include \n\n int main() {\n std::string line;\n std::getline(std::cin, line);\n std::cout << line;\n }" 32 | input = "hi\n" 33 | output = "hi" 34 | 35 | [tests.hello] 36 | code = "#include \nint main() { std::cout << \"hello\" << std::endl; }" 37 | output = "hello\n" 38 | 39 | [languageServer] 40 | command = [ 41 | "cquery", 42 | "--init={\"progressReportFrequencyMs\": -1,\"cacheDirectory\":\"/tmp/cquery\", \"extraClangArguments\": [\"-std=c++17\", \"-pthread\"]}" 43 | ] 44 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/deno: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",deno,"* ]]; then 8 | echo S 'deno:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'deno' 14 | 15 | # deno:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'Y29uc29sZS5sb2coImhlbGxvIik=' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'deno' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'deno' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'deno:hello' 33 | else 34 | echo ❌ 'deno:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/raku: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",raku,"* ]]; then 8 | echo S 'raku:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'raku' 14 | 15 | # raku:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'c2F5ICdoZWxsbyB3b3JsZCc7' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'raku' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'raku' \ 24 | <( echo 'aGVsbG8gd29ybGQK' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'raku:hello' 33 | else 34 | echo ❌ 'raku:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/swift: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",swift,"* ]]; then 8 | echo S 'swift:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'swift' 14 | 15 | # swift:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'cHJpbnQoImhlbGxvIik=' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'swift' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'swift' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'swift:hello' 33 | else 34 | echo ❌ 'swift:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/wren: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",wren,"* ]]; then 8 | echo S 'wren:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'wren' 14 | 15 | # wren:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'U3lzdGVtLnByaW50KCJoZWxsbyIp' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'wren' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'wren' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'wren:hello' 33 | else 34 | echo ❌ 'wren:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/julia: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",julia,"* ]]; then 8 | echo S 'julia:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'julia' 14 | 15 | # julia:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'cHJpbnRsbigiaGVsbG8iKQ==' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'julia' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'julia' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'julia:hello' 33 | else 34 | echo ❌ 'julia:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/nextjs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | echo 'Setup parents of nextjs' 9 | rsync --recursive --links --perms --times /opt/homes/nodejs/ /home/runner/ 10 | chown -R $(id -u):$(id -g) /home/runner 11 | 12 | echo 'Setup nextjs' 13 | cd "${HOME}" 14 | 15 | mkdir -p /home/runner/pages 16 | 17 | if [[ -n "$(ls -A /home/runner)" ]]; then 18 | echo Storing home for nextjs 19 | mkdir -p /opt/homes/nextjs 20 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/nextjs 21 | chown runner:runner -R /opt/homes/nextjs 22 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 23 | ls -A /opt/homes/nextjs 24 | fi 25 | 26 | chown runner:runner -R /home/runner /config /opt/virtualenvs 27 | if [[ -n "$(ls /tmp/)" ]]; then 28 | rm -rf /tmp/* 29 | fi 30 | 31 | 32 | rm /phase2.sh 33 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/python: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",python,"* ]]; then 8 | echo S 'python:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'python' 14 | 15 | # python:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'cHJpbnQgImhlbGxvIg==' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'python' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'python' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'python:hello' 33 | else 34 | echo ❌ 'python:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/sqlite: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",sqlite,"* ]]; then 8 | echo S 'sqlite:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'sqlite' 14 | 15 | # sqlite:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'c2VsZWN0ICdoZWxsbyc7' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'sqlite' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'sqlite' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'sqlite:hello' 33 | else 34 | echo ❌ 'sqlite:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/enzyme: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",enzyme,"* ]]; then 8 | echo S 'enzyme:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'enzyme' 14 | 15 | # enzyme:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'Y29uc29sZS5sb2coImhlbGxvIik=' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'enzyme' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'enzyme' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'enzyme:hello' 33 | else 34 | echo ❌ 'enzyme:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/nodejs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",nodejs,"* ]]; then 8 | echo S 'nodejs:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'nodejs' 14 | 15 | # nodejs:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'Y29uc29sZS5sb2coImhlbGxvIik=' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'nodejs' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'nodejs' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'nodejs:hello' 33 | else 34 | echo ❌ 'nodejs:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/flow: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | echo 'Setup parents of flow' 9 | rsync --recursive --links --perms --times /opt/homes/nodejs/ /home/runner/ 10 | chown -R $(id -u):$(id -g) /home/runner 11 | 12 | echo 'Setup flow' 13 | cd "${HOME}" 14 | 15 | npm install -g flow-language-server-amasad flow-bin 16 | 17 | if [[ -n "$(ls -A /home/runner)" ]]; then 18 | echo Storing home for flow 19 | mkdir -p /opt/homes/flow 20 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/flow 21 | chown runner:runner -R /opt/homes/flow 22 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 23 | ls -A /opt/homes/flow 24 | fi 25 | 26 | chown runner:runner -R /home/runner /config /opt/virtualenvs 27 | if [[ -n "$(ls /tmp/)" ]]; then 28 | rm -rf /tmp/* 29 | fi 30 | 31 | 32 | rm /phase2.sh 33 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/clojure: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",clojure,"* ]]; then 8 | echo S 'clojure:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'clojure' 14 | 15 | # clojure:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'KHByaW50bG4gImhlbGxvIik=' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'clojure' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'clojure' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'clojure:hello' 33 | else 34 | echo ❌ 'clojure:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/d: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",d,"* ]]; then 8 | echo S 'D:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'd' 14 | 15 | # D:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'aW1wb3J0IHN0ZC5zdGRpbzogd3JpdGVsbjt2b2lkIG1haW4oKXt3cml0ZWxuKCJoZWxsbyIpO30=' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'd' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'D' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'D:hello' 33 | else 34 | echo ❌ 'D:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/guile: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",guile,"* ]]; then 8 | echo S 'guile:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'guile' 14 | 15 | # guile:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'KGRpc3BsYXkgImhlbGxvIHdvcmxkIik=' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'guile' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'guile' \ 24 | <( echo 'aGVsbG8gd29ybGQ=' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'guile:hello' 33 | else 34 | echo ❌ 'guile:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/rust: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",rust,"* ]]; then 8 | echo S 'rust:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'rust' 14 | 15 | # rust:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'Zm4gbWFpbigpIHsKICBwcmludGxuISgiaGVsbG8iKTsKfQ==' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'rust' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'rust' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'rust:hello' 33 | else 34 | echo ❌ 'rust:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/elixir: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",elixir,"* ]]; then 8 | echo S 'elixir:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'elixir' 14 | 15 | # elixir:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'SU8ucHV0cyAiaGVsbG8gd29ybGQi' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'elixir' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'elixir' \ 24 | <( echo 'aGVsbG8gd29ybGQK' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'elixir:hello' 33 | else 34 | echo ❌ 'elixir:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/express: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",express,"* ]]; then 8 | echo S 'express:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'express' 14 | 15 | # express:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'Y29uc29sZS5sb2coImhlbGxvIik=' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'express' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'express' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'express:hello' 33 | else 34 | echo ❌ 'express:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/rlang: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",rlang,"* ]]; then 8 | echo S 'rlang:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'rlang' 14 | 15 | # rlang:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'cHJpbnQoIkhlbGxvIFdvcmxkIik=' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'rlang' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'rlang' \ 24 | <( echo 'WzFdICJIZWxsbyBXb3JsZCIK' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'rlang:hello' 33 | else 34 | echo ❌ 'rlang:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/nodejs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup nodejs' 11 | cd "${HOME}" 12 | 13 | npm install -g jest@23.1.0 prettier@1.13.4 babylon@6.15 babel-traverse@6.21 walker@1.0.7 yarn 14 | yarn global add jest 15 | /usr/bin/build-prybar-lang.sh nodejs 16 | 17 | if [[ -n "$(ls -A /home/runner)" ]]; then 18 | echo Storing home for nodejs 19 | mkdir -p /opt/homes/nodejs 20 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/nodejs 21 | chown runner:runner -R /opt/homes/nodejs 22 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 23 | ls -A /opt/homes/nodejs 24 | fi 25 | 26 | chown runner:runner -R /home/runner /config /opt/virtualenvs 27 | if [[ -n "$(ls /tmp/)" ]]; then 28 | rm -rf /tmp/* 29 | fi 30 | 31 | 32 | rm /phase2.sh 33 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/c: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",c,"* ]]; then 8 | echo S 'c:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'c' 14 | 15 | # c:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'I2luY2x1ZGUgInN0ZGlvLmgiCmludCBtYWluKHZvaWQpIHsKcHJpbnRmKCJoZWxsb1xuIik7CnJldHVybiAwOwp9' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'c' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'c' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'c:hello' 33 | else 34 | echo ❌ 'c:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/crystal: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",crystal,"* ]]; then 8 | echo S 'crystal:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'crystal' 14 | 15 | # crystal:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'cHV0cyAiaGVsbG8gd29ybGQi' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'crystal' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'crystal' \ 24 | <( echo 'aGVsbG8gd29ybGQK' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'crystal:hello' 33 | else 34 | echo ❌ 'crystal:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/fsharp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",fsharp,"* ]]; then 8 | echo S 'fsharp:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'fsharp' 14 | 15 | # fsharp:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'U3lzdGVtLkNvbnNvbGUuV3JpdGVMaW5lKCJoZWxsbyIp' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'fsharp' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'fsharp' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'fsharp:hello' 33 | else 34 | echo ❌ 'fsharp:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/haskell: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",haskell,"* ]]; then 8 | echo S 'haskell:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'haskell' 14 | 15 | # haskell:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'bWFpbiA9IHB1dFN0ckxuICJoZWxsbyI=' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'haskell' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'haskell' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'haskell:hello' 33 | else 34 | echo ❌ 'haskell:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/ocaml: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",ocaml,"* ]]; then 8 | echo S 'ocaml:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'ocaml' 14 | 15 | # ocaml:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'cHJpbnRfc3RyaW5nICJoZWxsbyB3b3JsZCEKIjs7' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'ocaml' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'ocaml' \ 24 | <( echo 'aGVsbG8gd29ybGQhCg==' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'ocaml:hello' 33 | else 34 | echo ❌ 'ocaml:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/dart: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",dart,"* ]]; then 8 | echo S 'dart:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'dart' 14 | 15 | # dart:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'dm9pZCBtYWluKCkgeyBwcmludCgnSGVsbG8sIFdvcmxkIScpOyB9' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'dart' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'dart' \ 24 | <( echo 'SGVsbG8sIFdvcmxkIQo=' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'dart:hello' 33 | else 34 | echo ❌ 'dart:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/elisp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup elisp' 11 | cd "${HOME}" 12 | 13 | git clone https://github.com/cask/cask.git /usr/local/cask 14 | ln -s /usr/local/cask/bin/cask /usr/local/bin/cask 15 | cask upgrade-cask 16 | /usr/bin/build-prybar-lang.sh elisp 17 | 18 | if [[ -n "$(ls -A /home/runner)" ]]; then 19 | echo Storing home for elisp 20 | mkdir -p /opt/homes/elisp 21 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/elisp 22 | chown runner:runner -R /opt/homes/elisp 23 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 24 | ls -A /opt/homes/elisp 25 | fi 26 | 27 | chown runner:runner -R /home/runner /config /opt/virtualenvs 28 | if [[ -n "$(ls /tmp/)" ]]; then 29 | rm -rf /tmp/* 30 | fi 31 | 32 | 33 | rm /phase2.sh 34 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/elisp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",elisp,"* ]]; then 8 | echo S 'elisp:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'elisp' 14 | 15 | # elisp:math 16 | SUCCESS=true 17 | OUTPUT="$(echo 'KHByaW5jIChmb3JtYXQgIjIgKyAyID0gJWRcbiIgKCsgMiAyKSkpCg==' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'elisp' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'elisp' \ 24 | <( echo 'MiArIDIgPSA0Cg==' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'elisp:math' 33 | else 34 | echo ❌ 'elisp:math' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/go: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup go' 11 | cd "${HOME}" 12 | 13 | cd /tmp && wget -q https://golang.org/dl/go1.14.7.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.14.7.linux-amd64.tar.gz && rm go1.14.7.linux-amd64.tar.gz 14 | /usr/local/go/bin/go get -u github.com/saibing/bingo 15 | 16 | if [[ -n "$(ls -A /home/runner)" ]]; then 17 | echo Storing home for go 18 | mkdir -p /opt/homes/go 19 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/go 20 | chown runner:runner -R /opt/homes/go 21 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 22 | ls -A /opt/homes/go 23 | fi 24 | 25 | chown runner:runner -R /home/runner /config /opt/virtualenvs 26 | if [[ -n "$(ls /tmp/)" ]]; then 27 | rm -rf /tmp/* 28 | fi 29 | 30 | 31 | rm /phase2.sh 32 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/clisp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",clisp,"* ]]; then 8 | echo S 'common lisp:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'clisp' 14 | 15 | # common lisp:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'KGZvcm1hdCB0ICJIZWxsbywgd29ybGQhIik=' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'clisp' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'common lisp' \ 24 | <( echo 'SGVsbG8sIHdvcmxkIQ==' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'common lisp:hello' 33 | else 34 | echo ❌ 'common lisp:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/cpp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",cpp,"* ]]; then 8 | echo S 'cpp:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'cpp' 14 | 15 | # cpp:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'I2luY2x1ZGUgPGlvc3RyZWFtPgppbnQgbWFpbigpIHsgc3RkOjpjb3V0IDw8ICJoZWxsbyIgPDwgc3RkOjplbmRsOyB9' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'cpp' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'cpp' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'cpp:hello' 33 | else 34 | echo ❌ 'cpp:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/fortran: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",fortran,"* ]]; then 8 | echo S 'fortran:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'fortran' 14 | 15 | # fortran:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'cHJvZ3JhbSBtYWluCnByaW50ICcoImhlbGxvIiknCmVuZCBwcm9ncmFtIG1haW4=' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'fortran' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'fortran' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'fortran:hello' 33 | else 34 | echo ❌ 'fortran:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/nim: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",nim,"* ]]; then 8 | echo S 'nim:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'nim' 14 | 15 | # nim:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'ZWNobyAiaGVsbG8gd29ybGQi' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'nim' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'nim' \ 24 | <( echo 'Q0M6IHN0ZGxpYl9pby5uaW0KQ0M6IHN0ZGxpYl9zeXN0ZW0ubmltCkNDOiBtYWluLm5pbQpoZWxsbyB3b3JsZAo=' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'nim:hello' 33 | else 34 | echo ❌ 'nim:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/pascal: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",pascal,"* ]]; then 8 | echo S 'pascal:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'pascal' 14 | 15 | # pascal:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'cHJvZ3JhbSBoZWxsbzsKYmVnaW4KCXdyaXRlbG4oJ2hlbGxvIHdvcmxkJyk7CmVuZC4=' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'pascal' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'pascal' \ 24 | <( echo 'aGVsbG8gd29ybGQK' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'pascal:hello' 33 | else 34 | echo ❌ 'pascal:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /languages/go.toml: -------------------------------------------------------------------------------- 1 | name = "go" 2 | aliases = [ 3 | "golang" 4 | ] 5 | entrypoint = "main.go" 6 | extensions = [ 7 | "go" 8 | ] 9 | 10 | packages = [ 11 | "pkg-config" 12 | ] 13 | setup = [ 14 | "cd /tmp && wget -q https://golang.org/dl/go1.14.7.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.14.7.linux-amd64.tar.gz && rm go1.14.7.linux-amd64.tar.gz", 15 | "/usr/local/go/bin/go get -u github.com/saibing/bingo" 16 | ] 17 | 18 | [compile] 19 | command = [ 20 | "go", 21 | "build", 22 | "-o", 23 | "main" 24 | ] 25 | 26 | [run] 27 | command = [ 28 | "./main" 29 | ] 30 | 31 | [tests] 32 | 33 | [tests.hello] 34 | code = "package main \nimport \"fmt\" \nfunc main() { \nfmt.Println(\"hello\") \n}" 35 | output = "hello\n" 36 | 37 | [tests.version] 38 | code = "package main \nimport (\"fmt\" \n\"runtime\") \nfunc main(){fmt.Print(runtime.Version()[:7])}" 39 | output = "go1.14." 40 | 41 | [languageServer] 42 | command = [ 43 | "/bin/bash", 44 | "-c", 45 | "/opt/homes/go/go/bin/bingo" 46 | ] 47 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/wren: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup wren' 11 | cd "${HOME}" 12 | 13 | wget https://github.com/wren-lang/wren-cli/releases/download/0.3.0/wren_cli-linux-0.3.0.zip 14 | unzip wren_cli-linux-0.3.0.zip 15 | install wren_cli-linux-0.3.0/wren_cli /usr/local/bin 16 | rm -rf wren_cli-linux-0.3.0 17 | 18 | if [[ -n "$(ls -A /home/runner)" ]]; then 19 | echo Storing home for wren 20 | mkdir -p /opt/homes/wren 21 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/wren 22 | chown runner:runner -R /opt/homes/wren 23 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 24 | ls -A /opt/homes/wren 25 | fi 26 | 27 | chown runner:runner -R /home/runner /config /opt/virtualenvs 28 | if [[ -n "$(ls /tmp/)" ]]; then 29 | rm -rf /tmp/* 30 | fi 31 | 32 | 33 | rm /phase2.sh 34 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/cpp11: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",cpp11,"* ]]; then 8 | echo S 'cpp11:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'cpp11' 14 | 15 | # cpp11:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'I2luY2x1ZGUgPGlvc3RyZWFtPgppbnQgbWFpbigpIHsgc3RkOjpjb3V0IDw8ICJoZWxsbyIgPDwgc3RkOjplbmRsOyB9' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'cpp11' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'cpp11' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'cpp11:hello' 33 | else 34 | echo ❌ 'cpp11:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/prolog: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",prolog,"* ]]; then 8 | echo S 'prolog:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'prolog' 14 | 15 | # prolog:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'Oi0gaW5pdGlhbGl6YXRpb24obWFpbikuCm1haW4gOi0gd3JpdGUoJ2hlbGxvLCB3b3JsZFxuJyku' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'prolog' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'prolog' \ 24 | <( echo 'aGVsbG8sIHdvcmxkCg==' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'prolog:hello' 33 | else 34 | echo ❌ 'prolog:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /extra/py-dap: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """A small wrapper around debugpy's cli. 3 | 4 | This wrapper is roughly equivalent to: 5 | 6 | python3 -m debugpy --listen localhost:0 --wait-for-client "$@" 7 | 8 | with the added twist that it reports the port used back through fd 3. 9 | """ 10 | 11 | import os 12 | import os.path 13 | import sys 14 | import runpy 15 | 16 | import debugpy 17 | import debugpy.server 18 | 19 | 20 | def _main() -> None: 21 | # This process' stdout/stderr are already used to deliver 22 | # the debuggee's stdout/stderr. We need to deliver this 23 | # information out of band, through fd 3. 24 | with os.fdopen(3, 'w') as port_fd: 25 | port_fd.write(str(debugpy.listen(('localhost', 0))[1])) 26 | debugpy.wait_for_client() 27 | target_as_str = sys.argv[1] 28 | dir = os.path.dirname(os.path.abspath(target_as_str)) 29 | sys.path.insert(0, os.getcwd()) 30 | runpy.run_path(target_as_str, run_name="__main__") 31 | 32 | 33 | if __name__ == '__main__': 34 | _main() 35 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/java: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",java,"* ]]; then 8 | echo S 'java:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'java' 14 | 15 | # java:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'Y2xhc3MgTWFpbiB7IHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsgU3lzdGVtLm91dC5wcmludGxuKCJoZWxsbyIpOyB9IH0=' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'java' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'java' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'java:hello' 33 | else 34 | echo ❌ 'java:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/kotlin: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup kotlin' 11 | cd "${HOME}" 12 | 13 | wget https://github.com/JetBrains/kotlin/releases/download/v1.3.72/kotlin-compiler-1.3.72.zip -O /tmp/a.zip 14 | unzip /tmp/a.zip -d /opt 15 | rm /tmp/a.zip 16 | ln -s /opt/kotlinc/bin/kotlin{,c,c-js,c-jvm} /usr/local/bin/ 17 | 18 | if [[ -n "$(ls -A /home/runner)" ]]; then 19 | echo Storing home for kotlin 20 | mkdir -p /opt/homes/kotlin 21 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/kotlin 22 | chown runner:runner -R /opt/homes/kotlin 23 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 24 | ls -A /opt/homes/kotlin 25 | fi 26 | 27 | chown runner:runner -R /home/runner /config /opt/virtualenvs 28 | if [[ -n "$(ls /tmp/)" ]]; then 29 | rm -rf /tmp/* 30 | fi 31 | 32 | 33 | rm /phase2.sh 34 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/haxe: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",haxe,"* ]]; then 8 | echo S 'haxe:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'haxe' 14 | 15 | # haxe:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'Y2xhc3MgTWFpbiB7CglzdGF0aWMgZnVuY3Rpb24gbWFpbigpIHsKCQl0cmFjZSgiSGVsbG8sIHdvcmxkISIpOwoJfQp9' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'haxe' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'haxe' \ 24 | <( echo 'TWFpbi5oeDozOiBIZWxsbywgd29ybGQhCg==' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'haxe:hello' 33 | else 34 | echo ❌ 'haxe:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/scala: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",scala,"* ]]; then 8 | echo S 'scala:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'scala' 14 | 15 | # scala:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'b2JqZWN0IE1haW4geyBkZWYgbWFpbihhcmdzOiBBcnJheVtTdHJpbmddKSB7IHByaW50bG4oIkhlbGxvLCB3b3JsZCEiKSB9IH0K' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'scala' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'scala' \ 24 | <( echo 'SGVsbG8sIHdvcmxkIQo=' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'scala:hello' 33 | else 34 | echo ❌ 'scala:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/rust: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup rust' 11 | cd "${HOME}" 12 | 13 | curl --proto '=https' --tlsv1.2 -Sf https://static.rust-lang.org/dist/rust-1.44.0-x86_64-unknown-linux-gnu.tar.gz | tar xz -C /tmp 14 | /tmp/rust-1.44.0-x86_64-unknown-linux-gnu/install.sh 15 | rm -rf /tmp/rust-1.44.0-x86_64-unknown-linux-gnu 16 | 17 | if [[ -n "$(ls -A /home/runner)" ]]; then 18 | echo Storing home for rust 19 | mkdir -p /opt/homes/rust 20 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/rust 21 | chown runner:runner -R /opt/homes/rust 22 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 23 | ls -A /opt/homes/rust 24 | fi 25 | 26 | chown runner:runner -R /home/runner /config /opt/virtualenvs 27 | if [[ -n "$(ls /tmp/)" ]]; then 28 | rm -rf /tmp/* 29 | fi 30 | 31 | 32 | rm /phase2.sh 33 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/erlang: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",erlang,"* ]]; then 8 | echo S 'erlang:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'erlang' 14 | 15 | # erlang:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'LW1vZHVsZShtYWluKS4KLWV4cG9ydChbc3RhcnQvMF0pLgoKc3RhcnQoKSAtPgogIGlvOmZ3cml0ZSgiaGVsbG8gd29ybGQKIiku' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'erlang' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'erlang' \ 24 | <( echo 'aGVsbG8gd29ybGQK' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'erlang:hello' 33 | else 34 | echo ❌ 'erlang:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /languages/pyxel.toml: -------------------------------------------------------------------------------- 1 | name = "pyxel" 2 | entrypoint = "main.py" 3 | extensions = [ 4 | "py" 5 | ] 6 | languages = [ 7 | "python3", 8 | ] 9 | packages = [ 10 | "libtk8.6", 11 | "libevent-dev", 12 | "gcc", 13 | "libglfw3-dev", 14 | "portaudio19-dev", 15 | "libsdl2-image-2.0-0", 16 | ] 17 | popularity = 5.0 18 | setup = [ 19 | "/opt/virtualenvs/python3/bin/python3 -m pip install glfw", 20 | "/opt/virtualenvs/python3/bin/python3 -m pip install git+https://github.com/amasad/pyxel", 21 | # Avoid using older versions of the typing library. 22 | "/opt/virtualenvs/python3/bin/python3 -m pip uninstall -y typing", 23 | ] 24 | [run] 25 | command = [ 26 | "python3", 27 | "-B", 28 | "main.py" 29 | ] 30 | 31 | [tests] 32 | 33 | [tests.0] 34 | code = "print(__name__)" 35 | output = "__main__\n" 36 | 37 | [tests.hello] 38 | code = "print(\"hello\")" 39 | output = "hello\n" 40 | 41 | [tests.pyxel] 42 | code = "import pyxel" 43 | output = "\n" 44 | 45 | [languageServer] 46 | command = [ 47 | "pyls", 48 | "-v" 49 | ] 50 | -------------------------------------------------------------------------------- /languages/raku.toml: -------------------------------------------------------------------------------- 1 | name = "raku" 2 | entrypoint = "main.raku" 3 | extensions = [ 4 | "p6", 5 | "raku" 6 | ] 7 | aptKeys = [ 8 | "A2E8E32E64BE8EFD6C3F1F7E0DD4CA7EB1C6CC6B" 9 | ] 10 | aptRepos = [ 11 | "deb https://dl.cloudsmith.io/public/nxadm-pkgs/rakudo-pkg/deb/ubuntu bionic main" 12 | ] 13 | packages = [ 14 | "libssl-dev", 15 | "rakudo-pkg=2021.3.0-01" 16 | ] 17 | setup = [ 18 | "ln -s /opt/rakudo-pkg/bin/perl6 /usr/local/bin/perl6", 19 | "ln -s /opt/rakudo-pkg/bin/raku /usr/local/bin/raku", 20 | "ln -s /opt/rakudo-pkg/bin/nqp /usr/local/bin/nqp", 21 | "ln -s /opt/rakudo-pkg/bin/moar /usr/local/bin/moar", 22 | "(cd /opt/rakudo-pkg/var/zef && /opt/rakudo-pkg/bin/raku -I. bin/zef --force-install install .)", 23 | "ln -s /opt/rakudo-pkg/share/perl6/site/bin/zef /usr/local/bin/zef", 24 | "zef install \"Linenoise:ver<0.1.1>\"", 25 | ] 26 | 27 | 28 | [run] 29 | command = [ 30 | "raku", 31 | "./main.raku" 32 | ] 33 | 34 | [tests] 35 | 36 | [tests.hello] 37 | code = "say 'hello world';" 38 | output = "hello world\n" 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/powershell: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",powershell,"* ]]; then 8 | echo S 'powershell:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'powershell' 14 | 15 | # powershell:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'JHN0clN0cmluZyA9ICJIZWxsbyBXb3JsZCI7IHdyaXRlLWhvc3QgJHN0clN0cmluZw==' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'powershell' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'powershell' \ 24 | <( echo 'SGVsbG8gV29ybGQK' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'powershell:hello' 33 | else 34 | echo ❌ 'powershell:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup bash' 11 | cd "${HOME}" 12 | 13 | cd /tmp && wget --quiet https://github.com/ewiger/beautify_bash/archive/master.tar.gz && tar xfz master.tar.gz && cp beautify_bash-master/beautify_bash.py /bin/ && chmod +x /bin/beautify_bash.py && rm -rf beautify_bash-master && rm -rf master.tar.gz 14 | 15 | if [[ -n "$(ls -A /home/runner)" ]]; then 16 | echo Storing home for bash 17 | mkdir -p /opt/homes/bash 18 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/bash 19 | chown runner:runner -R /opt/homes/bash 20 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 21 | ls -A /opt/homes/bash 22 | fi 23 | 24 | chown runner:runner -R /home/runner /config /opt/virtualenvs 25 | if [[ -n "$(ls /tmp/)" ]]; then 26 | rm -rf /tmp/* 27 | fi 28 | 29 | 30 | rm /phase2.sh 31 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/python: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup python' 11 | cd "${HOME}" 12 | 13 | pip2 install -U setuptools 14 | pip2 install -U configparser 15 | pip2 install --no-cache-dir pipreqs-amasad==0.4.10 jedi==0.12.1 pyflakes==2.0.0 rope==0.11.0 yapf==0.25.0 mccabe==0.6.1 nltk numpy scipy requests matplotlib bpython ptpython 16 | 17 | if [[ -n "$(ls -A /home/runner)" ]]; then 18 | echo Storing home for python 19 | mkdir -p /opt/homes/python 20 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/python 21 | chown runner:runner -R /opt/homes/python 22 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 23 | ls -A /opt/homes/python 24 | fi 25 | 26 | chown runner:runner -R /home/runner /config /opt/virtualenvs 27 | if [[ -n "$(ls /tmp/)" ]]; then 28 | rm -rf /tmp/* 29 | fi 30 | 31 | 32 | rm /phase2.sh 33 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/enzyme: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | echo 'Setup parents of enzyme' 9 | rsync --recursive --links --perms --times /opt/homes/nodejs/ /home/runner/ 10 | chown -R $(id -u):$(id -g) /home/runner 11 | 12 | echo 'Setup enzyme' 13 | cd "${HOME}" 14 | 15 | yarn add react react-dom react-addons-test-utils jsdom enzyme babel-core babel-preset-latest babel-preset-react babel-polyfill 16 | 17 | if [[ -n "$(ls -A /home/runner)" ]]; then 18 | echo Storing home for enzyme 19 | mkdir -p /opt/homes/enzyme 20 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/enzyme 21 | chown runner:runner -R /opt/homes/enzyme 22 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 23 | ls -A /opt/homes/enzyme 24 | fi 25 | 26 | chown runner:runner -R /home/runner /config /opt/virtualenvs 27 | if [[ -n "$(ls /tmp/)" ]]; then 28 | rm -rf /tmp/* 29 | fi 30 | 31 | 32 | rm /phase2.sh 33 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/nix: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup nix' 11 | cd "${HOME}" 12 | 13 | mkdir -m 0755 /nix && chown runner /nix 14 | chown -R runner:runner /home/runner 15 | su runner -c 'curl -L https://nixos.org/nix/install | sh && . /home/runner/.nix-profile/etc/profile.d/nix.sh && nix-channel --update && nix search -u > /dev/null' 16 | 17 | 18 | if [[ -n "$(ls -A /home/runner)" ]]; then 19 | echo Storing home for nix 20 | mkdir -p /opt/homes/nix 21 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/nix 22 | chown runner:runner -R /opt/homes/nix 23 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 24 | ls -A /opt/homes/nix 25 | fi 26 | 27 | chown runner:runner -R /home/runner /config /opt/virtualenvs 28 | if [[ -n "$(ls /tmp/)" ]]; then 29 | rm -rf /tmp/* 30 | fi 31 | 32 | 33 | rm /phase2.sh 34 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/pygame: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | echo 'Setup parents of pygame' 9 | rsync --recursive --links --perms --times /opt/homes/python3/ /home/runner/ 10 | chown -R $(id -u):$(id -g) /home/runner 11 | 12 | echo 'Setup pygame' 13 | cd "${HOME}" 14 | 15 | /opt/virtualenvs/python3/bin/python3 -m pip install pygame 16 | /opt/virtualenvs/python3/bin/python3 -m pip uninstall -y typing 17 | 18 | if [[ -n "$(ls -A /home/runner)" ]]; then 19 | echo Storing home for pygame 20 | mkdir -p /opt/homes/pygame 21 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/pygame 22 | chown runner:runner -R /opt/homes/pygame 23 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 24 | ls -A /opt/homes/pygame 25 | fi 26 | 27 | chown runner:runner -R /home/runner /config /opt/virtualenvs 28 | if [[ -n "$(ls /tmp/)" ]]; then 29 | rm -rf /tmp/* 30 | fi 31 | 32 | 33 | rm /phase2.sh 34 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/quil: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | echo 'Setup parents of quil' 9 | rsync --recursive --links --perms --times /opt/homes/python3/ /home/runner/ 10 | chown -R $(id -u):$(id -g) /home/runner 11 | 12 | echo 'Setup quil' 13 | cd "${HOME}" 14 | 15 | /opt/virtualenvs/python3/bin/pip3 install referenceqvm==0.3 pyquil==1.9.0 16 | /opt/virtualenvs/python3/bin/python3 -m pip uninstall -y typing 17 | 18 | if [[ -n "$(ls -A /home/runner)" ]]; then 19 | echo Storing home for quil 20 | mkdir -p /opt/homes/quil 21 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/quil 22 | chown runner:runner -R /opt/homes/quil 23 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 24 | ls -A /opt/homes/quil 25 | fi 26 | 27 | chown runner:runner -R /home/runner /config /opt/virtualenvs 28 | if [[ -n "$(ls /tmp/)" ]]; then 29 | rm -rf /tmp/* 30 | fi 31 | 32 | 33 | rm /phase2.sh 34 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/csharp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",csharp,"* ]]; then 8 | echo S 'csharp:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'csharp' 14 | 15 | # csharp:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'dXNpbmcgU3lzdGVtOyBjbGFzcyBNYWluQ2xhc3MgeyBwdWJsaWMgc3RhdGljIHZvaWQgTWFpbiAoc3RyaW5nW10gYXJncykgeyBDb25zb2xlLldyaXRlTGluZSAoImhlbGxvIik7IH0gfQ==' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'csharp' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'csharp' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'csharp:hello' 33 | else 34 | echo ❌ 'csharp:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/ballerina: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",ballerina,"* ]]; then 8 | echo S 'ballerina:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'ballerina' 14 | 15 | # ballerina:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'aW1wb3J0IGJhbGxlcmluYS9pbzsKcHVibGljIGZ1bmN0aW9uIG1haW4oKSB7CiAgICBpbzpwcmludGxuKCJIZWxsbywgV29ybGQhIik7Cn0K' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'ballerina' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'ballerina' \ 24 | <( echo 'SGVsbG8sIFdvcmxkIQo=' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'ballerina:hello' 33 | else 34 | echo ❌ 'ballerina:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /languages/pygame.toml: -------------------------------------------------------------------------------- 1 | name = "pygame" 2 | entrypoint = "main.py" 3 | extensions = [ 4 | "py" 5 | ] 6 | languages = [ 7 | "python3" 8 | ] 9 | packages = [ 10 | "gcc", 11 | "libsdl-ttf2.0-dev", 12 | "libevent-dev", 13 | "libportmidi-dev", 14 | "libsdl1.2-dev", 15 | "libsdl-image1.2-dev", 16 | "libsdl-mixer1.2-dev", 17 | "libtk8.6", 18 | "xfonts-base", 19 | "xfonts-100dpi", 20 | "xfonts-75dpi", 21 | "xfonts-cyrillic", 22 | "fontconfig", 23 | "fonts-freefont-ttf", 24 | "libfreetype6-dev", 25 | ] 26 | popularity = 5.0 27 | setup = [ 28 | "/opt/virtualenvs/python3/bin/python3 -m pip install pygame", 29 | # Avoid using older versions of the typing library. 30 | "/opt/virtualenvs/python3/bin/python3 -m pip uninstall -y typing", 31 | ] 32 | [run] 33 | command = [ 34 | "python3", 35 | "-B", 36 | "main.py" 37 | ] 38 | 39 | [tests] 40 | 41 | [tests.0] 42 | code = "print(__name__)" 43 | output = "__main__\n" 44 | 45 | [tests.hello] 46 | code = "print(\"hello\")" 47 | output = "hello\n" 48 | 49 | [languageServer] 50 | command = [ 51 | "pyls", 52 | "-v" 53 | ] 54 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/nix: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",nix,"* ]]; then 8 | echo S 'nix:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'nix' 14 | 15 | # nix:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'ZWNobyAneyBwa2dzIH06IHsgZGVwcyA9IFsgcGtncy5weXRob24zOSBdOyB9JyA+IHJlcGxpdC5uaXgKbml4LXNoZWxsIC0tYXJnc3RyIHJlcGxkaXIgIiRQV0QiIC9vcHQvbml4cHJveHkubml4IC0tY29tbWFuZCAicHl0aG9uIC0tdmVyc2lvbiIKCg==' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'nix' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'nix' \ 24 | <( echo 'UHl0aG9uIDMuOS42Cg==' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'nix:hello' 33 | else 34 | echo ❌ 'nix:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/pyxel: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | echo 'Setup parents of pyxel' 9 | rsync --recursive --links --perms --times /opt/homes/python3/ /home/runner/ 10 | chown -R $(id -u):$(id -g) /home/runner 11 | 12 | echo 'Setup pyxel' 13 | cd "${HOME}" 14 | 15 | /opt/virtualenvs/python3/bin/python3 -m pip install glfw 16 | /opt/virtualenvs/python3/bin/python3 -m pip install git+https://github.com/amasad/pyxel 17 | /opt/virtualenvs/python3/bin/python3 -m pip uninstall -y typing 18 | 19 | if [[ -n "$(ls -A /home/runner)" ]]; then 20 | echo Storing home for pyxel 21 | mkdir -p /opt/homes/pyxel 22 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/pyxel 23 | chown runner:runner -R /opt/homes/pyxel 24 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 25 | ls -A /opt/homes/pyxel 26 | fi 27 | 28 | chown runner:runner -R /home/runner /config /opt/virtualenvs 29 | if [[ -n "$(ls /tmp/)" ]]; then 30 | rm -rf /tmp/* 31 | fi 32 | 33 | 34 | rm /phase2.sh 35 | -------------------------------------------------------------------------------- /languages/clojure.toml: -------------------------------------------------------------------------------- 1 | name = "clojure" 2 | entrypoint = "main.clj" 3 | extensions = [ 4 | "clj", 5 | "cljc", 6 | "cljs", 7 | "edn" 8 | ] 9 | packages = [ 10 | "openjdk-11-jre-headless" 11 | ] 12 | setup = [ 13 | """ 14 | wget https://download.clojure.org/install/linux-install-1.10.1.478.sh 15 | chmod +x linux-install-1.10.1.478.sh 16 | ./linux-install-1.10.1.478.sh 17 | rm linux-install-1.10.1.478.sh 18 | 19 | # this ensures that we cache the maven deps in the image ($XDG_CONFIG_HOME) 20 | # https://clojure.org/reference/deps_and_cli#_command_line_tools 21 | # pretty ridiculous but what else can you do? 22 | clojure -Sverbose -Sdeps '{:mvn/local-repo "/home/runner/.m2/repository"}' --eval '' 23 | mv /home/runner/.m2/repository "${XDG_CONFIG_HOME}/clojure/repository" 24 | rm -rf /home/runner/.m2 25 | /usr/bin/build-prybar-lang.sh clojure""" 26 | ] 27 | versionCommand = [ 28 | "clojure", 29 | "-e", 30 | "(clojure-version)" 31 | ] 32 | 33 | [run] 34 | command = [ 35 | "clojure", 36 | "main.clj" 37 | ] 38 | 39 | [tests] 40 | 41 | [tests.hello] 42 | code = "(println \"hello\")" 43 | output = "hello\n" 44 | -------------------------------------------------------------------------------- /languages/forth.toml: -------------------------------------------------------------------------------- 1 | name = "forth" 2 | entrypoint = "main.fth" 3 | extensions = [ 4 | "fth", 5 | "4th" 6 | ] 7 | 8 | packages = [ 9 | "libtool-bin", 10 | "libffi-dev", 11 | "automake", 12 | "m4", 13 | "gforth", "gforth-lib", "gforth-common" 14 | ] 15 | 16 | setup = [ 17 | """ 18 | pushd /tmp 19 | wget -O gforth-0.7.9.tar.xz http://www.complang.tuwien.ac.at/forth/gforth/Snapshots/0.7.9_20200716/gforth-0.7.9_20200716.tar.xz 20 | tar -Jxf gforth-0.7.9.tar.xz 21 | rm gforth-0.7.9.tar.xz 22 | mv gforth-0.7.9_* gforth-0.7.9 23 | cd gforth-0.7.9 24 | 25 | cd unix 26 | [ -e stat-fsi.c ] || wget -O stat-fsi.c https://git.savannah.gnu.org/cgit/gforth.git/plain/unix/stat-fsi.c 27 | gcc stat-fsi.c -o stat-fsi 28 | ./stat-fsi > stat.fs 29 | cd .. 30 | 31 | ./autogen.sh 32 | ./configure 33 | make 34 | make more 35 | make install 36 | cd .. 37 | rm -rf /tmp/gforth-0.7.9 38 | popd""" 39 | ] 40 | 41 | [run] 42 | command = [ 43 | "gforth", 44 | "--", 45 | "./main.fth", 46 | "-e", 47 | "bye" 48 | ] 49 | 50 | [tests] 51 | 52 | [tests.hello] 53 | code = ".\" hello\" CR" 54 | output = "hello\n" 55 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/ballerina: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | echo 'Setup parents of ballerina' 9 | rsync --recursive --links --perms --times /opt/homes/java/ /home/runner/ 10 | chown -R $(id -u):$(id -g) /home/runner 11 | 12 | echo 'Setup ballerina' 13 | cd "${HOME}" 14 | 15 | wget https://dist.ballerina.io/downloads/1.2.13/ballerina-linux-installer-x64-1.2.13.deb 16 | dpkg -i ballerina-linux-installer-x64-1.2.13.deb 17 | rm -r ballerina-linux-installer-x64-1.2.13.deb 18 | 19 | if [[ -n "$(ls -A /home/runner)" ]]; then 20 | echo Storing home for ballerina 21 | mkdir -p /opt/homes/ballerina 22 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/ballerina 23 | chown runner:runner -R /opt/homes/ballerina 24 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 25 | ls -A /opt/homes/ballerina 26 | fi 27 | 28 | chown runner:runner -R /home/runner /config /opt/virtualenvs 29 | if [[ -n "$(ls /tmp/)" ]]; then 30 | rm -rf /tmp/* 31 | fi 32 | 33 | 34 | rm /phase2.sh 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Neoreason, Inc 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/webassembly: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup WebAssembly' 11 | cd "${HOME}" 12 | 13 | wget https://github.com/wasmerio/wasmer/releases/download/0.14.0/wasmer-linux-amd64.tar.gz -O /tmp/wasmer.tar.gz 14 | mkdir /usr/local/wasmer 15 | tar -xvf /tmp/wasmer.tar.gz -C /usr/local/wasmer --strip-components=1 16 | ln -s /usr/local/wasmer/wasmer /usr/local/bin/wasmer 17 | rm /tmp/wasmer.tar.gz 18 | 19 | if [[ -n "$(ls -A /home/runner)" ]]; then 20 | echo Storing home for WebAssembly 21 | mkdir -p /opt/homes/WebAssembly 22 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/WebAssembly 23 | chown runner:runner -R /opt/homes/WebAssembly 24 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 25 | ls -A /opt/homes/WebAssembly 26 | fi 27 | 28 | chown runner:runner -R /home/runner /config /opt/virtualenvs 29 | if [[ -n "$(ls /tmp/)" ]]; then 30 | rm -rf /tmp/* 31 | fi 32 | 33 | 34 | rm /phase2.sh 35 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/gatsbyjs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | echo 'Setup parents of gatsbyjs' 9 | rsync --recursive --links --perms --times /opt/homes/nodejs/ /home/runner/ 10 | chown -R $(id -u):$(id -g) /home/runner 11 | 12 | echo 'Setup gatsbyjs' 13 | cd "${HOME}" 14 | 15 | rm -f /home/runner/.profile /home/runner/.bashrc /home/runner/.bash_logout 16 | npm install -g gatsby-cli 17 | gatsby new /home/runner && rm LICENSE && rm README.md && rm .prettierrc && rm .gitignore 18 | yarn 19 | 20 | if [[ -n "$(ls -A /home/runner)" ]]; then 21 | echo Storing home for gatsbyjs 22 | mkdir -p /opt/homes/gatsbyjs 23 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/gatsbyjs 24 | chown runner:runner -R /opt/homes/gatsbyjs 25 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 26 | ls -A /opt/homes/gatsbyjs 27 | fi 28 | 29 | chown runner:runner -R /home/runner /config /opt/virtualenvs 30 | if [[ -n "$(ls /tmp/)" ]]; then 31 | rm -rf /tmp/* 32 | fi 33 | 34 | 35 | rm /phase2.sh 36 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/assembly: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",assembly,"* ]]; then 8 | echo S 'assembly:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'assembly' 14 | 15 | # assembly:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'c2VjdGlvbiAudGV4dApnbG9iYWwgX3N0YXJ0Cl9zdGFydDoKbW92IHJheCwgMQptb3YgcmRpLCAxCm1vdiByc2ksIGJ1Zgptb3YgcmR4LCA1CnN5c2NhbGwKbW92IHJheCwgNjAKeG9yIHJkaSwgcmRpCnN5c2NhbGwKc2VjdGlvbiAuZGF0YQpidWY6IGRiICJoZWxsbyI=' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'assembly' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'assembly' \ 24 | <( echo 'aGVsbG8=' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'assembly:hello' 33 | else 34 | echo ❌ 'assembly:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/ruby: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup ruby' 11 | cd "${HOME}" 12 | 13 | # Gemfile.lock files are dependent on the exact bundler version. Always add 14 | # new versions and never remove old versions from this list. 15 | gem install bundler:2.2.3 bundler:2.2.7 16 | gem install --source http://rubygems.org rspec:3.5 stripe rufo:0.12.0 sinatra 17 | gem install solargraph:0.38.1 18 | /usr/bin/build-prybar-lang.sh ruby 19 | 20 | 21 | if [[ -n "$(ls -A /home/runner)" ]]; then 22 | echo Storing home for ruby 23 | mkdir -p /opt/homes/ruby 24 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/ruby 25 | chown runner:runner -R /opt/homes/ruby 26 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 27 | ls -A /opt/homes/ruby 28 | fi 29 | 30 | chown runner:runner -R /home/runner /config /opt/virtualenvs 31 | if [[ -n "$(ls /tmp/)" ]]; then 32 | rm -rf /tmp/* 33 | fi 34 | 35 | 36 | rm /phase2.sh 37 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/mercury: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",mercury,"* ]]; then 8 | echo S 'mercury:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'mercury' 14 | 15 | # mercury:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'Oi0gbW9kdWxlIG1haW4uCjotIGludGVyZmFjZS4KOi0gaW1wb3J0X21vZHVsZSBpby4KOi0gcHJlZAogIG1haW4oaW86OmRpLCBpbzo6dW8pIGlzIGRldC4KOi0gaW1wbGVtZW50YXRpb24uCm1haW4oIUlPKSA6LQogaW8ud3JpdGVfc3RyaW5nKCJoZWxsbyB3b3JsZAoiLCAhSU8pLg==' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'mercury' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'mercury' \ 24 | <( echo 'aGVsbG8gd29ybGQK' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'mercury:hello' 33 | else 34 | echo ❌ 'mercury:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /languages/swift.toml: -------------------------------------------------------------------------------- 1 | name = "swift" 2 | entrypoint = "main.swift" 3 | extensions = [ 4 | "swift" 5 | ] 6 | packages = [ 7 | "libedit2", 8 | "python2.7-minimal", 9 | "libpython2.7", 10 | "libxml2", 11 | "clang", 12 | "libicu-dev" 13 | ] 14 | setup = [ 15 | "wget https://swift.org/builds/swift-5.0.1-release/ubuntu1804/swift-5.0.1-RELEASE/swift-5.0.1-RELEASE-ubuntu18.04.tar.gz", 16 | "wget https://swift.org/builds/swift-5.0.1-release/ubuntu1804/swift-5.0.1-RELEASE/swift-5.0.1-RELEASE-ubuntu18.04.tar.gz.sig", 17 | "wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import -", 18 | "gpg --verify swift-5.0.1-RELEASE-ubuntu18.04.tar.gz.sig || exit 1", 19 | "tar xzvf swift-5.0.1-RELEASE-ubuntu18.04.tar.gz --strip-components=1 -C /", 20 | "rm swift-5.0.1-RELEASE-ubuntu18.04.tar.gz", 21 | "rm swift-5.0.1-RELEASE-ubuntu18.04.tar.gz.sig", 22 | "chmod -R go+r /usr/lib/swift", 23 | "swift --version" 24 | ] 25 | 26 | [compile] 27 | command = [ 28 | "swiftc", 29 | "-o", 30 | "main" 31 | ] 32 | 33 | [run] 34 | command = [ 35 | "./main" 36 | ] 37 | 38 | [tests] 39 | 40 | [tests.hello] 41 | code = "print(\"hello\")" 42 | output = "hello\n" 43 | -------------------------------------------------------------------------------- /gen/detect-language.ejs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # If the language is explicitly passed in, use that. 6 | LANGUAGE= 7 | while getopts ":sl:" opt; do 8 | case "${opt}" in 9 | l ) 10 | LANGUAGE="${OPTARG}" 11 | ;; 12 | \? ) 13 | echo "Usage: detect-language [-l language]" 14 | exit 1 15 | ;; 16 | esac 17 | done 18 | 19 | case "${LANGUAGE}" in 20 | <% for ( let lang of languages ) { -%> 21 | <%- lang.names.map(x => `"${x}"`).join('|') %>) 22 | echo '<%= lang.id %>'; 23 | exit 0 24 | ;; 25 | <% } -%> 26 | esac 27 | 28 | # No language explicitly provided. Detect the existence of entrypoint files. 29 | <% for ( let lang of lbypop ) { -%> 30 | <% if ( lang.entrypoint ) { -%> 31 | if [ -f <%= lang.entrypoint %> ]; then echo '<%= lang.id %>'; exit 0; fi 32 | <% } -%> 33 | <% } -%> 34 | 35 | # No entrypoint files detected. Try to sniff out the existence of files based 36 | # on extension. 37 | <% for ( let lang of lbypop ) { -%> 38 | <% if ( lang.extensions ) { -%> 39 | <% for ( let ex of lang.extensions ) { -%> 40 | if [ -n "$(find . -name '*.<%= ex %>')" ]; then echo '<%= lang.id %>'; exit 0; fi 41 | <% } -%> 42 | <% } -%> 43 | <% } -%> 44 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/scala: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | echo 'Setup parents of scala' 9 | rsync --recursive --links --perms --times /opt/homes/java/ /home/runner/ 10 | chown -R $(id -u):$(id -g) /home/runner 11 | 12 | echo 'Setup scala' 13 | cd "${HOME}" 14 | 15 | wget -nv https://downloads.lightbend.com/scala/2.13.1/scala-2.13.1.tgz 16 | tar -xf scala-2.13.1.tgz 17 | cp -R scala-2.13.1/bin/* /usr/local/bin/ 18 | cp -R scala-2.13.1/lib/* /usr/local/lib/ 19 | rm -rf scala-2.13.1/ 20 | /usr/bin/build-prybar-lang.sh scala 21 | 22 | if [[ -n "$(ls -A /home/runner)" ]]; then 23 | echo Storing home for scala 24 | mkdir -p /opt/homes/scala 25 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/scala 26 | chown runner:runner -R /opt/homes/scala 27 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 28 | ls -A /opt/homes/scala 29 | fi 30 | 31 | chown runner:runner -R /home/runner /config /opt/virtualenvs 32 | if [[ -n "$(ls /tmp/)" ]]; then 33 | rm -rf /tmp/* 34 | fi 35 | 36 | 37 | rm /phase2.sh 38 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/nim: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup nim' 11 | cd "${HOME}" 12 | 13 | NIM_VER="1.2.0" 14 | wget https://nim-lang.org/download/nim-$NIM_VER.tar.xz 15 | tar xf nim-$NIM_VER.tar.xz 16 | rm -rf nim-$NIM_VER.tar.xz 17 | chown -R root: nim-$NIM_VER/ 18 | cd nim-$NIM_VER 19 | sh build.sh 20 | ./bin/nim c koch.nim 21 | ./koch tools 22 | sh install.sh /usr/local/bin 23 | cp ./bin/* /usr/local/bin 24 | cd .. 25 | rm -rf nim-$NIM_VER 26 | unset NIM_VER 27 | 28 | if [[ -n "$(ls -A /home/runner)" ]]; then 29 | echo Storing home for nim 30 | mkdir -p /opt/homes/nim 31 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/nim 32 | chown runner:runner -R /opt/homes/nim 33 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 34 | ls -A /opt/homes/nim 35 | fi 36 | 37 | chown runner:runner -R /home/runner /config /opt/virtualenvs 38 | if [[ -n "$(ls /tmp/)" ]]; then 39 | rm -rf /tmp/* 40 | fi 41 | 42 | 43 | rm /phase2.sh 44 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/powershell: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup powershell' 11 | cd "${HOME}" 12 | 13 | curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v7.0.3/powershell-7.0.3-linux-x64.tar.gz 14 | mkdir /usr/local/pwsh 15 | tar zxf /tmp/powershell.tar.gz -C /usr/local/pwsh 16 | ln -s -f /usr/local/pwsh/pwsh /usr/bin/pwsh 17 | ln -s -f /usr/local/pwsh/pwsh /usr/bin/powershell 18 | rm -f /tmp/powershell.tar.gz 19 | 20 | if [[ -n "$(ls -A /home/runner)" ]]; then 21 | echo Storing home for powershell 22 | mkdir -p /opt/homes/powershell 23 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/powershell 24 | chown runner:runner -R /opt/homes/powershell 25 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 26 | ls -A /opt/homes/powershell 27 | fi 28 | 29 | chown runner:runner -R /home/runner /config /opt/virtualenvs 30 | if [[ -n "$(ls /tmp/)" ]]; then 31 | rm -rf /tmp/* 32 | fi 33 | 34 | 35 | rm /phase2.sh 36 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/julia: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup julia' 11 | cd "${HOME}" 12 | 13 | wget https://julialang-s3.julialang.org/bin/linux/x64/1.4/julia-1.4.1-linux-x86_64.tar.gz 14 | tar xf julia-1.4.1-linux-x86_64.tar.gz 15 | cp julia-1.4.1/bin/julia /usr/bin/ 16 | cp -r julia-1.4.1/lib/* /usr/lib/ 17 | cp -r julia-1.4.1/include/* /usr/include/ 18 | cp -r julia-1.4.1/share/* /usr/share/ 19 | rm -rf ./julia-1.4.1 julia-1.4.1-linux-x86_64.tar.gz 20 | /usr/bin/build-prybar-lang.sh julia 21 | 22 | if [[ -n "$(ls -A /home/runner)" ]]; then 23 | echo Storing home for julia 24 | mkdir -p /opt/homes/julia 25 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/julia 26 | chown runner:runner -R /opt/homes/julia 27 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 28 | ls -A /opt/homes/julia 29 | fi 30 | 31 | chown runner:runner -R /home/runner /config /opt/virtualenvs 32 | if [[ -n "$(ls /tmp/)" ]]; then 33 | rm -rf /tmp/* 34 | fi 35 | 36 | 37 | rm /phase2.sh 38 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/reactjs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | echo 'Setup parents of reactjs' 9 | rsync --recursive --links --perms --times /opt/homes/nodejs/ /home/runner/ 10 | chown -R $(id -u):$(id -g) /home/runner 11 | 12 | echo 'Setup reactjs' 13 | cd "${HOME}" 14 | 15 | rm -rf /home/runner/.profile /home/runner/.bashrc /home/runner/.bash_logout /home/runner/.cache /home/runner/.npm 16 | npx create-react-app /home/runner/app 17 | rsync --archive /home/runner/app/ /home/runner 18 | rm -rf /home/runner/app 19 | yarn 20 | rm -f README.md 21 | 22 | if [[ -n "$(ls -A /home/runner)" ]]; then 23 | echo Storing home for reactjs 24 | mkdir -p /opt/homes/reactjs 25 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/reactjs 26 | chown runner:runner -R /opt/homes/reactjs 27 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 28 | ls -A /opt/homes/reactjs 29 | fi 30 | 31 | chown runner:runner -R /home/runner /config /opt/virtualenvs 32 | if [[ -n "$(ls /tmp/)" ]]; then 33 | rm -rf /tmp/* 34 | fi 35 | 36 | 37 | rm /phase2.sh 38 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/raku: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup raku' 11 | cd "${HOME}" 12 | 13 | ln -s /opt/rakudo-pkg/bin/perl6 /usr/local/bin/perl6 14 | ln -s /opt/rakudo-pkg/bin/raku /usr/local/bin/raku 15 | ln -s /opt/rakudo-pkg/bin/nqp /usr/local/bin/nqp 16 | ln -s /opt/rakudo-pkg/bin/moar /usr/local/bin/moar 17 | (cd /opt/rakudo-pkg/var/zef && /opt/rakudo-pkg/bin/raku -I. bin/zef --force-install install .) 18 | ln -s /opt/rakudo-pkg/share/perl6/site/bin/zef /usr/local/bin/zef 19 | zef install "Linenoise:ver<0.1.1>" 20 | 21 | if [[ -n "$(ls -A /home/runner)" ]]; then 22 | echo Storing home for raku 23 | mkdir -p /opt/homes/raku 24 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/raku 25 | chown runner:runner -R /opt/homes/raku 26 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 27 | ls -A /opt/homes/raku 28 | fi 29 | 30 | chown runner:runner -R /home/runner /config /opt/virtualenvs 31 | if [[ -n "$(ls /tmp/)" ]]; then 32 | rm -rf /tmp/* 33 | fi 34 | 35 | 36 | rm /phase2.sh 37 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/haxe: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup haxe' 11 | cd "${HOME}" 12 | 13 | pushd /tmp 14 | curl --output hashlink.tar.gz -ks https://codeload.github.com/HaxeFoundation/hashlink/tar.gz/1.11 15 | tar -xz --file=hashlink.tar.gz 16 | rm hashlink.tar.gz 17 | cd hashlink-1.11 18 | sed -i '92s|.*|LFLAGS += -lm -Wl,-rpath,.:'$ORIGIN/../lib':$(PREFIX)/lib -Wl,--export-dynamic -Wl,--no-undefined|' Makefile 19 | make all 20 | make install 21 | cd .. 22 | rm -rf hashlink-1.11 23 | popd 24 | haxelib setup /home/runner 25 | 26 | if [[ -n "$(ls -A /home/runner)" ]]; then 27 | echo Storing home for haxe 28 | mkdir -p /opt/homes/haxe 29 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/haxe 30 | chown runner:runner -R /opt/homes/haxe 31 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 32 | ls -A /opt/homes/haxe 33 | fi 34 | 35 | chown runner:runner -R /home/runner /config /opt/virtualenvs 36 | if [[ -n "$(ls /tmp/)" ]]; then 37 | rm -rf /tmp/* 38 | fi 39 | 40 | 41 | rm /phase2.sh 42 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/reactts: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | echo 'Setup parents of reactts' 9 | rsync --recursive --links --perms --times /opt/homes/nodejs/ /home/runner/ 10 | chown -R $(id -u):$(id -g) /home/runner 11 | 12 | echo 'Setup reactts' 13 | cd "${HOME}" 14 | 15 | rm -rf /home/runner/.profile /home/runner/.bashrc /home/runner/.bash_logout /home/runner/.cache /home/runner/.npm 16 | npx create-react-app --scripts-version=react-scripts-ts /home/runner/app 17 | rsync --archive /home/runner/app/ /home/runner 18 | rm -rf /home/runner/app 19 | yarn 20 | rm -f README.md 21 | 22 | if [[ -n "$(ls -A /home/runner)" ]]; then 23 | echo Storing home for reactts 24 | mkdir -p /opt/homes/reactts 25 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/reactts 26 | chown runner:runner -R /opt/homes/reactts 27 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 28 | ls -A /opt/homes/reactts 29 | fi 30 | 31 | chown runner:runner -R /home/runner /config /opt/virtualenvs 32 | if [[ -n "$(ls /tmp/)" ]]; then 33 | rm -rf /tmp/* 34 | fi 35 | 36 | 37 | rm /phase2.sh 38 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/objective-c: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",objective-c,"* ]]; then 8 | echo S 'objective-c:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'objective-c' 14 | 15 | # objective-c:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'I2ltcG9ydCA8b2JqYy9vYmpjLmg+CiNpbXBvcnQgPG9iamMvT2JqZWN0Lmg+CiNpbXBvcnQgPEZvdW5kYXRpb24vRm91bmRhdGlvbi5oPgppbnQgbWFpbih2b2lkKSB7CglAYXV0b3JlbGVhc2Vwb29sIHsKCQlOU1N0cmluZyogc3RyID0gQCJIZWxsbyBmcm9tIE9iamVjdGl2ZS1DIDIuMCEiOwoJCXB1dHMoW3N0ciBjU3RyaW5nXSk7Cgl9CglyZXR1cm4gMDsKfQo=' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'objective-c' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'objective-c' \ 24 | <( echo 'SGVsbG8gZnJvbSBPYmplY3RpdmUtQyAyLjAhCg==' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'objective-c:hello' 33 | else 34 | echo ❌ 'objective-c:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /gen/self-test-per-lang.ejs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",<%= lang.id %>,"* ]]; then 8 | echo S '<%= lang.name %>:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l '<%= lang.id %>' 14 | 15 | <% for ( let tname in lang.tests ) { -%> 16 | <% let test = lang.tests[tname]; -%> 17 | <% if ( test.input ) continue; -%> 18 | <% if ( test.skip ) { -%> 19 | echo S '<%= lang.name %>:<%= tname %>' 20 | <% } else { -%> 21 | # <%= lang.name %>:<%= tname %> 22 | SUCCESS=true 23 | OUTPUT="$(echo '<%= btoa(test.code) %>' | \ 24 | base64 --decode | \ 25 | run-project -s -l '<%= lang.id %>' \ 26 | )" || SUCCESS=false 27 | if [[ "${SUCCESS}" == "true" ]]; then 28 | echo "${OUTPUT}" | \ 29 | diff --unified --ignore-trailing-space --label '<%= lang.name %>' \ 30 | <( echo '<%= btoa(test.output) %>' | base64 --decode ) \ 31 | - || \ 32 | SUCCESS=false 33 | else 34 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 35 | fi 36 | 37 | if [[ "${SUCCESS}" == "true" ]]; then 38 | echo ✓ '<%= lang.name %>:<%= tname %>' 39 | else 40 | echo ❌ '<%= lang.name %>:<%= tname %>' 41 | CODE=1 42 | fi 43 | <% } -%> 44 | <% } -%> 45 | 46 | exit $CODE 47 | -------------------------------------------------------------------------------- /gen/phase2-per-lang.ejs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | <% if (lang.setup && lang.setup.length) { -%> 8 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 9 | <% if (lang.languages && lang.languages.length) { -%> 10 | echo 'Setup parents of <%= lang.name %>' 11 | <% for (const parentLanguage of (lang.languages || [])) { -%> 12 | rsync --recursive --links --perms --times /opt/homes/<%= parentLanguage %>/ /home/runner/ 13 | <% } -%> 14 | <% } -%> 15 | chown -R $(id -u):$(id -g) /home/runner 16 | 17 | <% if (lang.setup && lang.setup.length) { -%> 18 | echo 'Setup <%= lang.name %>' 19 | cd "${HOME}" 20 | 21 | <% for ( let line of lang.setup ) { -%> 22 | <%- line %> 23 | <% } -%> 24 | 25 | <% } -%> 26 | if [[ -n "$(ls -A /home/runner)" ]]; then 27 | echo Storing home for <%= lang.name %> 28 | mkdir -p /opt/homes/<%= lang.name %> 29 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/<%= lang.name %> 30 | chown runner:runner -R /opt/homes/<%= lang.name %> 31 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 32 | ls -A /opt/homes/<%= lang.name %> 33 | fi 34 | 35 | chown runner:runner -R /home/runner /config /opt/virtualenvs 36 | if [[ -n "$(ls /tmp/)" ]]; then 37 | rm -rf /tmp/* 38 | fi 39 | 40 | <% } -%> 41 | 42 | rm /phase2.sh 43 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/swift: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup swift' 11 | cd "${HOME}" 12 | 13 | wget https://swift.org/builds/swift-5.0.1-release/ubuntu1804/swift-5.0.1-RELEASE/swift-5.0.1-RELEASE-ubuntu18.04.tar.gz 14 | wget https://swift.org/builds/swift-5.0.1-release/ubuntu1804/swift-5.0.1-RELEASE/swift-5.0.1-RELEASE-ubuntu18.04.tar.gz.sig 15 | wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import - 16 | gpg --verify swift-5.0.1-RELEASE-ubuntu18.04.tar.gz.sig || exit 1 17 | tar xzvf swift-5.0.1-RELEASE-ubuntu18.04.tar.gz --strip-components=1 -C / 18 | rm swift-5.0.1-RELEASE-ubuntu18.04.tar.gz 19 | rm swift-5.0.1-RELEASE-ubuntu18.04.tar.gz.sig 20 | chmod -R go+r /usr/lib/swift 21 | swift --version 22 | 23 | if [[ -n "$(ls -A /home/runner)" ]]; then 24 | echo Storing home for swift 25 | mkdir -p /opt/homes/swift 26 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/swift 27 | chown runner:runner -R /opt/homes/swift 28 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 29 | ls -A /opt/homes/swift 30 | fi 31 | 32 | chown runner:runner -R /home/runner /config /opt/virtualenvs 33 | if [[ -n "$(ls /tmp/)" ]]; then 34 | rm -rf /tmp/* 35 | fi 36 | 37 | 38 | rm /phase2.sh 39 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/forth: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup forth' 11 | cd "${HOME}" 12 | 13 | pushd /tmp 14 | wget -O gforth-0.7.9.tar.xz http://www.complang.tuwien.ac.at/forth/gforth/Snapshots/0.7.9_20200716/gforth-0.7.9_20200716.tar.xz 15 | tar -Jxf gforth-0.7.9.tar.xz 16 | rm gforth-0.7.9.tar.xz 17 | mv gforth-0.7.9_* gforth-0.7.9 18 | cd gforth-0.7.9 19 | 20 | cd unix 21 | [ -e stat-fsi.c ] || wget -O stat-fsi.c https://git.savannah.gnu.org/cgit/gforth.git/plain/unix/stat-fsi.c 22 | gcc stat-fsi.c -o stat-fsi 23 | ./stat-fsi > stat.fs 24 | cd .. 25 | 26 | ./autogen.sh 27 | ./configure 28 | make 29 | make more 30 | make install 31 | cd .. 32 | rm -rf /tmp/gforth-0.7.9 33 | popd 34 | 35 | if [[ -n "$(ls -A /home/runner)" ]]; then 36 | echo Storing home for forth 37 | mkdir -p /opt/homes/forth 38 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/forth 39 | chown runner:runner -R /opt/homes/forth 40 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 41 | ls -A /opt/homes/forth 42 | fi 43 | 44 | chown runner:runner -R /home/runner /config /opt/virtualenvs 45 | if [[ -n "$(ls /tmp/)" ]]; then 46 | rm -rf /tmp/* 47 | fi 48 | 49 | 50 | rm /phase2.sh 51 | -------------------------------------------------------------------------------- /extra/fluxbox/init: -------------------------------------------------------------------------------- 1 | session.screen0.toolbar.widthPercent: 100 2 | session.screen0.toolbar.maxOver: false 3 | session.screen0.toolbar.onhead: 1 4 | session.screen0.toolbar.tools: prevworkspace, workspacename, nextworkspace, clock, prevwindow, nextwindow, iconbar, systemtray 5 | session.screen0.toolbar.visible: false 6 | session.screen0.window.focus.alpha: 255 7 | session.screen0.window.unfocus.alpha: 255 8 | session.screen0.windowPlacement: RowSmartPlacement 9 | session.screen0.clientMenu.usePixmap: true 10 | session.screen0.strftimeFormat: %d %b, %a %02k:%M:%S 11 | session.screen0.edgeSnapThreshold: 10 12 | session.screen0.workspaceNames: Workspace 1 13 | session.screen0.allowRemoteActions: false 14 | session.screen0.tooltipDelay: 500 15 | session.screen0.rowPlacementDirection: LeftToRight 16 | session.screen0.focusSameHead: false 17 | session.screen0.opaqueMove: false 18 | session.screen0.focusModel: ClickFocus 19 | session.keyFile: ~/.fluxbox/keys 20 | session.menuFile: ~/.fluxbox/menu 21 | session.appsFile: /etc/X11/fluxbox/apps 22 | session.colorsPerChannel: 4 23 | session.ignoreBorder: false 24 | session.styleFile: /usr/share/fluxbox/styles/Meta 25 | session.forcePseudoTransparency: false 26 | session.tabsAttachArea: Window 27 | session.autoRaiseDelay: 250 28 | session.configVersion: 13 29 | session.tabPadding: 0 30 | session.doubleClickInterval: 250 31 | session.cacheMax: 200 32 | session.cacheLife: 5 33 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/clojure: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup clojure' 11 | cd "${HOME}" 12 | 13 | wget https://download.clojure.org/install/linux-install-1.10.1.478.sh 14 | chmod +x linux-install-1.10.1.478.sh 15 | ./linux-install-1.10.1.478.sh 16 | rm linux-install-1.10.1.478.sh 17 | 18 | # this ensures that we cache the maven deps in the image ($XDG_CONFIG_HOME) 19 | # https://clojure.org/reference/deps_and_cli#_command_line_tools 20 | # pretty ridiculous but what else can you do? 21 | clojure -Sverbose -Sdeps '{:mvn/local-repo "/home/runner/.m2/repository"}' --eval '' 22 | mv /home/runner/.m2/repository "${XDG_CONFIG_HOME}/clojure/repository" 23 | rm -rf /home/runner/.m2 24 | /usr/bin/build-prybar-lang.sh clojure 25 | 26 | if [[ -n "$(ls -A /home/runner)" ]]; then 27 | echo Storing home for clojure 28 | mkdir -p /opt/homes/clojure 29 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/clojure 30 | chown runner:runner -R /opt/homes/clojure 31 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 32 | ls -A /opt/homes/clojure 33 | fi 34 | 35 | chown runner:runner -R /home/runner /config /opt/virtualenvs 36 | if [[ -n "$(ls /tmp/)" ]]; then 37 | rm -rf /tmp/* 38 | fi 39 | 40 | 41 | rm /phase2.sh 42 | -------------------------------------------------------------------------------- /languages/haxe.toml: -------------------------------------------------------------------------------- 1 | name = "haxe" 2 | entrypoint = "Main.hx" 3 | extensions = [ 4 | "hx" 5 | ] 6 | 7 | aptKeys = [] 8 | aptRepos = [ 9 | "ppa:haxe/releases" 10 | ] 11 | 12 | packages = [ 13 | "haxe", 14 | "libpng-dev", "libturbojpeg-dev", "libvorbis-dev", # fmt 15 | "libopenal-dev", # openal 16 | "libsdl2-dev", # sdl 17 | "libmbedtls-dev", # ssl 18 | "libuv1-dev" # uv 19 | ] 20 | 21 | setup = [ 22 | # install hashlink 23 | "pushd /tmp", 24 | "curl --output hashlink.tar.gz -ks https://codeload.github.com/HaxeFoundation/hashlink/tar.gz/1.11", 25 | "tar -xz --file=hashlink.tar.gz", 26 | "rm hashlink.tar.gz", 27 | "cd hashlink-1.11", 28 | "sed -i '92s|.*|LFLAGS += -lm -Wl,-rpath,.:'$ORIGIN/../lib':$(PREFIX)/lib -Wl,--export-dynamic -Wl,--no-undefined|' Makefile", 29 | "make all", 30 | "make install", 31 | "cd ..", 32 | "rm -rf hashlink-1.11", 33 | "popd", 34 | "haxelib setup /home/runner" 35 | ] 36 | 37 | runtimeSetup = [ 38 | "(echo -m Main && echo --interp) > /home/runner/build.hxml" 39 | ] 40 | 41 | versionCommand = [ 42 | "haxe", 43 | "--version" 44 | ] 45 | 46 | [run] 47 | command = [ 48 | "haxe", 49 | "build.hxml" 50 | ] 51 | 52 | [tests] 53 | 54 | [tests.hello] 55 | code = "class Main {\n\tstatic function main() {\n\t\ttrace(\"Hello, world!\");\n\t}\n}" 56 | output = "Main.hx:3: Hello, world!\n" 57 | 58 | [languageServer] 59 | command = [ 60 | "haxe", 61 | "--server-listen", 62 | "stdio" 63 | ] -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/pygame: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",pygame,"* ]]; then 8 | echo S 'pygame:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'pygame' 14 | 15 | # pygame:0 16 | SUCCESS=true 17 | OUTPUT="$(echo 'cHJpbnQoX19uYW1lX18p' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'pygame' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'pygame' \ 24 | <( echo 'X19tYWluX18K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'pygame:0' 33 | else 34 | echo ❌ 'pygame:0' 35 | CODE=1 36 | fi 37 | # pygame:hello 38 | SUCCESS=true 39 | OUTPUT="$(echo 'cHJpbnQoImhlbGxvIik=' | \ 40 | base64 --decode | \ 41 | run-project -s -l 'pygame' \ 42 | )" || SUCCESS=false 43 | if [[ "${SUCCESS}" == "true" ]]; then 44 | echo "${OUTPUT}" | \ 45 | diff --unified --ignore-trailing-space --label 'pygame' \ 46 | <( echo 'aGVsbG8K' | base64 --decode ) \ 47 | - || \ 48 | SUCCESS=false 49 | else 50 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 51 | fi 52 | 53 | if [[ "${SUCCESS}" == "true" ]]; then 54 | echo ✓ 'pygame:hello' 55 | else 56 | echo ❌ 'pygame:hello' 57 | CODE=1 58 | fi 59 | 60 | exit $CODE 61 | -------------------------------------------------------------------------------- /gen/run-project.ejs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | READ_STDIN=0 6 | LANGUAGE=`detect-language` 7 | BUILDER=0 8 | 9 | while getopts ":sl:b" opt; do 10 | case ${opt} in 11 | s ) 12 | READ_STDIN=1 13 | ;; 14 | l ) 15 | LANGUAGE=$OPTARG 16 | ;; 17 | b ) 18 | BUILDER=1 19 | ;; 20 | : ) 21 | echo "Invalid option: $OPTARG requires an argument" 22 | exit 1 23 | ;; 24 | \? ) 25 | echo "Usage: run-project [-sb] [-l language]" 26 | exit 1 27 | ;; 28 | esac 29 | done 30 | 31 | if [ $BUILDER -ne 0 ]; then 32 | if [ -f Makefile ] && [ $( cat /proc/$PPID/comm ) != 'make' ]; then 33 | exec make 34 | fi 35 | 36 | if [ -f CMakeLists.txt ]; then 37 | mkdir /tmp/build 38 | PROJ=$(pwd) 39 | cd /tmp/build 40 | exec bash -c "cmake $PROJ && ninja" 41 | fi 42 | 43 | if [ -f package.json ]; then 44 | if jq -e .scripts.start package.json; then 45 | exec npm start 46 | fi 47 | fi 48 | 49 | fi 50 | 51 | maybe_read_stdin() { 52 | if [ $READ_STDIN -ne 0 ]; then 53 | cat - > /home/runner/$1 54 | fi 55 | } 56 | 57 | case "$LANGUAGE" in 58 | <% for ( let lang of languages ) { -%> 59 | 60 | <%- lang.names.map(x => `"${x}"`).join('|') %>) 61 | maybe_read_stdin <%= lang.entrypoint %> 62 | <% if ( lang.compile ) { -%> 63 | <%- c(lang.compile.command.concat([lang.entrypoint])) %> 1>&2 64 | <% } -%> 65 | <% if ( lang.run ) { -%> 66 | <%- c(lang.run.command) %> 67 | <% } -%> 68 | ;; 69 | <% } -%> 70 | *) 71 | echo "Unknown Language: $LANGUAGE" 72 | ;; 73 | esac 74 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/go: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",go,"* ]]; then 8 | echo S 'go:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'go' 14 | 15 | # go:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'cGFja2FnZSBtYWluIAppbXBvcnQgImZtdCIgCmZ1bmMgbWFpbigpIHsgCmZtdC5QcmludGxuKCJoZWxsbyIpIAp9' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'go' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'go' \ 24 | <( echo 'aGVsbG8K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'go:hello' 33 | else 34 | echo ❌ 'go:hello' 35 | CODE=1 36 | fi 37 | # go:version 38 | SUCCESS=true 39 | OUTPUT="$(echo 'cGFja2FnZSBtYWluIAppbXBvcnQgKCJmbXQiIAoicnVudGltZSIpIApmdW5jIG1haW4oKXtmbXQuUHJpbnQocnVudGltZS5WZXJzaW9uKClbOjddKX0=' | \ 40 | base64 --decode | \ 41 | run-project -s -l 'go' \ 42 | )" || SUCCESS=false 43 | if [[ "${SUCCESS}" == "true" ]]; then 44 | echo "${OUTPUT}" | \ 45 | diff --unified --ignore-trailing-space --label 'go' \ 46 | <( echo 'Z28xLjE0Lg==' | base64 --decode ) \ 47 | - || \ 48 | SUCCESS=false 49 | else 50 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 51 | fi 52 | 53 | if [[ "${SUCCESS}" == "true" ]]; then 54 | echo ✓ 'go:version' 55 | else 56 | echo ❌ 'go:version' 57 | CODE=1 58 | fi 59 | 60 | exit $CODE 61 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/c: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup c' 11 | cd "${HOME}" 12 | 13 | cd /tmp && wget -q https://github.com/cquery-project/cquery/releases/download/v20180302/cquery-v20180302-x86_64-unknown-linux-gnu.tar.xz && tar xf cquery-v20180302-x86_64-unknown-linux-gnu.tar.xz && cd cquery-v20180302-x86_64-unknown-linux-gnu && cp bin/cquery /bin && cp -r lib/* /lib/ && cd /tmp && rm cquery-v20180302-x86_64-unknown-linux-gnu.tar.xz && rm -r cquery-v20180302-x86_64-unknown-linux-gnu 14 | update-alternatives --install /usr/bin/clang-format clang-format `which clang-format-7` 100 15 | mkdir -p /config/cquery && echo -e '%clang\n%c -std=c11\n%cpp -std=c++17\n-pthread' | tee /config/cquery/.cquery 16 | mkdir -p /opt/dap/cpptools && (cd /tmp && wget --quiet https://github.com/microsoft/vscode-cpptools/releases/download/1.3.1/cpptools-linux.vsix && unzip -q cpptools-linux.vsix -d /opt/dap/cpptools && rm cpptools-linux.vsix) && chmod +x /opt/dap/cpptools/extension/debugAdapters/OpenDebugAD7 /opt/dap/cpptools/extension/debugAdapters/mono.linux-x86_64 17 | 18 | if [[ -n "$(ls -A /home/runner)" ]]; then 19 | echo Storing home for c 20 | mkdir -p /opt/homes/c 21 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/c 22 | chown runner:runner -R /opt/homes/c 23 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 24 | ls -A /opt/homes/c 25 | fi 26 | 27 | chown runner:runner -R /home/runner /config /opt/virtualenvs 28 | if [[ -n "$(ls /tmp/)" ]]; then 29 | rm -rf /tmp/* 30 | fi 31 | 32 | 33 | rm /phase2.sh 34 | -------------------------------------------------------------------------------- /gen/languages.d.ejs: -------------------------------------------------------------------------------- 1 | # A file with Makefile dependencies 2 | 3 | # Dependencies between language stamps 4 | <% for (const lang of languages) { -%> 5 | <% if (lang.languages && lang.languages.length) { -%> 6 | build/stamps/build-layer-phase2-<%= lang.id %>: build/stamps/build-layer-phase2-<%= lang.languages[0] %> 7 | <% } -%> 8 | <% } -%> 9 | 10 | # Dependencies between language manifests for diffs. 11 | <% for (const lang of languages) { 12 | let parent = 'phase1.5'; 13 | if (lang.languages && lang.languages.length) { 14 | parent = `phase2-${lang.languages[0]}`; 15 | } -%> 16 | build/diffs/phase2-<%= lang.id %>.tar.bz2: extra/manifest_tool.py build/manifests/phase2-<%= lang.id %>.json.gz build/manifests/<%= parent %>.json.gz | build/diffs/ 17 | docker run --rm \ 18 | --mount "type=bind,src=$(PWD)/extra/manifest_tool.py,target=/usr/bin/manifest_tool.py,ro" \ 19 | --mount "type=bind,src=$(PWD)/build/manifests,target=/mnt/manifests,ro" \ 20 | "polygott:phase2-<%= lang.id %>" \ 21 | /usr/bin/manifest_tool.py diff \ 22 | --parent-manifest=/mnt/manifests/<%= parent %>.json.gz \ 23 | --manifest=/mnt/manifests/phase2-<%= lang.id %>.json.gz > "$@.tmp" 24 | mv "$@.tmp" "$@" 25 | 26 | <% } -%> 27 | build/diffs/phase2-tools.tar.bz2: extra/manifest_tool.py build/manifests/phase2-tools.json.gz build/manifests/phase1.5.json.gz | build/diffs/ 28 | docker run --rm \ 29 | --mount "type=bind,src=$(PWD)/extra/manifest_tool.py,target=/usr/bin/manifest_tool.py,ro" \ 30 | --mount "type=bind,src=$(PWD)/build/manifests,target=/mnt/manifests,ro" \ 31 | "polygott:phase2-tools" \ 32 | /usr/bin/manifest_tool.py diff \ 33 | --parent-manifest=/mnt/manifests/phase1.5.json.gz \ 34 | --manifest=/mnt/manifests/phase2-tools.json.gz > "$@.tmp" 35 | mv "$@.tmp" "$@" 36 | -------------------------------------------------------------------------------- /gen/phase0.ejs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | groupadd -g 1000 runner 6 | useradd -m -d /home/runner -g runner -s /bin/bash runner --uid 1000 --gid 1000 7 | 8 | DEBIAN_FRONTEND=noninteractive apt-get update 9 | DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends <%- basePackages.join(' ') %> 10 | 11 | locale-gen en_US.UTF-8 12 | update-locale LANG=en_US.UTF-8 13 | update-ca-certificates 14 | 15 | wget -nv \ 16 | https://launchpad.net/ubuntu/+archive/primary/+files/libtinfo6_6.1+20181013-2ubuntu2_amd64.deb \ 17 | https://launchpad.net/ubuntu/+archive/primary/+files/libreadline8_8.0-1_amd64.deb \ 18 | https://storage.googleapis.com/container-bins/stderred_1.0_amd64.deb 19 | dpkg -i *.deb 20 | rm *.deb 21 | 22 | mkdir -p /config /opt/homes/default /opt/virtualenvs 23 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/default 24 | chown runner:runner -R /home/runner /opt/homes/default /config /opt/virtualenvs 25 | 26 | <% for (const [key, langs] of Object.entries(aptKeys)) { -%> 27 | apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv <%- c([key]) %> 28 | <% } -%> 29 | 30 | <% for (const [keyUrl, langs] of Object.entries(aptKeyUrls)) { %> 31 | curl -L <%- c([keyUrl]) %> | apt-key add - 32 | <% } -%> 33 | 34 | <% for (const [repo, langs] of Object.entries(aptRepos)) { -%> 35 | add-apt-repository --yes --no-update <%- c([repo]) %> 36 | <% } -%> 37 | 38 | rm -rf /var/lib/apt/lists/* 39 | 40 | # Allow users to override the bash configuration files 41 | echo '[ -f ~/"${REPL_SLUG}/.config/bashrc" ] && . ~/"${REPL_SLUG}/.config/bashrc"' >> ~/.bashrc 42 | echo '[ -f ~/"${REPL_SLUG}/.config/bash_logout" ] && . ~/"${REPL_SLUG}/.config/bash_logout"' >> ~/.bash_logout 43 | echo '[ -f ~/"${REPL_SLUG}/.config/profile" ] && . ~/"${REPL_SLUG}/.config/profile"' >> ~/.profile 44 | 45 | rm /phase0.sh 46 | -------------------------------------------------------------------------------- /languages/c.toml: -------------------------------------------------------------------------------- 1 | name = "c" 2 | entrypoint = "main.c" 3 | extensions = [ 4 | "c" 5 | ] 6 | aptKeyUrls = [ 7 | "https://packagecloud.io/cs50/repo/gpgkey" 8 | ] 9 | aptRepos = [ 10 | "deb https://packagecloud.io/cs50/repo/ubuntu/ bionic main" 11 | ] 12 | packages = [ 13 | "clang-7", 14 | "clang-format-7", 15 | "libcs50", 16 | ] 17 | setup = [ 18 | "cd /tmp && wget -q https://github.com/cquery-project/cquery/releases/download/v20180302/cquery-v20180302-x86_64-unknown-linux-gnu.tar.xz && tar xf cquery-v20180302-x86_64-unknown-linux-gnu.tar.xz && cd cquery-v20180302-x86_64-unknown-linux-gnu && cp bin/cquery /bin && cp -r lib/* /lib/ && cd /tmp && rm cquery-v20180302-x86_64-unknown-linux-gnu.tar.xz && rm -r cquery-v20180302-x86_64-unknown-linux-gnu", 19 | "update-alternatives --install /usr/bin/clang-format clang-format `which clang-format-7` 100", 20 | "mkdir -p /config/cquery && echo -e '%clang\\n%c -std=c11\\n%cpp -std=c++17\\n-pthread' | tee /config/cquery/.cquery", 21 | # Debug Adapter Protocol support 22 | "mkdir -p /opt/dap/cpptools && (cd /tmp && wget --quiet https://github.com/microsoft/vscode-cpptools/releases/download/1.3.1/cpptools-linux.vsix && unzip -q cpptools-linux.vsix -d /opt/dap/cpptools && rm cpptools-linux.vsix) && chmod +x /opt/dap/cpptools/extension/debugAdapters/OpenDebugAD7 /opt/dap/cpptools/extension/debugAdapters/mono.linux-x86_64", 23 | ] 24 | 25 | [compile] 26 | command = [ 27 | "clang-7", 28 | "-pthread", 29 | "-lm", 30 | "-o", 31 | "main" 32 | ] 33 | 34 | [run] 35 | command = [ 36 | "./main" 37 | ] 38 | 39 | [tests] 40 | 41 | [tests.hello] 42 | code = "#include \"stdio.h\"\nint main(void) {\nprintf(\"hello\\n\");\nreturn 0;\n}" 43 | output = "hello\n" 44 | 45 | [languageServer] 46 | command = [ 47 | "cquery", 48 | "--init={\"progressReportFrequencyMs\": -1,\"cacheDirectory\":\"/tmp/cquery\"}" 49 | ] 50 | -------------------------------------------------------------------------------- /run_dir/findreqs.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | from pipreqs import pipreqs 3 | import json 4 | 5 | mapping = { 6 | 'mnist': 'python-mnist', 7 | 'skimage': 'scikit-image', 8 | } 9 | 10 | def main(path, extra_ignore_dirs): 11 | # Get all potential imports. 12 | candidates = pipreqs.get_all_imports(path, extra_ignore_dirs=extra_ignore_dirs, ignore_errors=True) 13 | 14 | if len(candidates) == 0: 15 | print(json.dumps([])) 16 | return 17 | 18 | # Get imports that can be found locally. 19 | # Note: although the pipreqs package gets the mapping first it seems that 20 | # `get_import_local` requires the names without the mapping. Must be a bug. 21 | local = pipreqs.get_import_local(candidates) 22 | 23 | # Now get the mapping (e.g. bs4 -> beatifulsoup4) 24 | # Start with our own custom mapping 25 | candidates = [mapping[name.lower()] if name.lower() in mapping else name for name in candidates] 26 | # pipreqs mapping 27 | candidates = pipreqs.get_pkg_names(candidates) 28 | 29 | # Compute the diff 30 | difference = [x for x in candidates 31 | if x.lower() not in [z['name'].lower() for z in local]] 32 | 33 | # To get the version we need to call pypi but that's too risky to do 34 | # on every call so, for now, we go with the latest version. 35 | # See https://goo.gl/3nJLMq 36 | print(json.dumps([{'version': '*', 'name': name} for name in difference])) 37 | 38 | if __name__ == '__main__': 39 | parser = argparse.ArgumentParser(description='Find all external python imports in a directory') 40 | parser.add_argument('path', metavar='dir', type=str, help='codebase directory') 41 | parser.add_argument('--ignore', type=str, help='comma-seperated dirs to ignore') 42 | 43 | args = parser.parse_args() 44 | extra_ignore_dirs = args.ignore 45 | 46 | if extra_ignore_dirs: 47 | extra_ignore_dirs = extra_ignore_dirs.split(',') 48 | else: 49 | extra_ignore_dirs = [] 50 | 51 | main(args.path, extra_ignore_dirs) 52 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/java: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup java' 11 | cd "${HOME}" 12 | 13 | mkdir -p /config/language-server && cd /config/language-server && wget https://download.eclipse.org/jdtls/milestones/1.1.2/jdt-language-server-1.1.2-202105191944.tar.gz && tar -xzf jdt-language-server-1.1.2-202105191944.tar.gz && rm jdt-language-server-1.1.2-202105191944.tar.gz && chown runner:runner -R /config/language-server 14 | echo ' 4.0.0 mygroupid myartifactid 0.0-SNAPSHOT de.qaware.maven go-offline-maven-plugin 1.2.5 org.apache.maven.surefire surefire-junit4 2.20.1 PLUGIN com.querydsl querydsl-apt 4.2.1 jpa MAIN ' > /tmp/emptypom.xml 15 | mvn -f /tmp/emptypom.xml -Dmaven.repo.local=/home/runner/.m2/repository de.qaware.maven:go-offline-maven-plugin:resolve-dependencies dependency:copy-dependencies 16 | rm /tmp/emptypom.xml 17 | 18 | if [[ -n "$(ls -A /home/runner)" ]]; then 19 | echo Storing home for java 20 | mkdir -p /opt/homes/java 21 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/java 22 | chown runner:runner -R /opt/homes/java 23 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 24 | ls -A /opt/homes/java 25 | fi 26 | 27 | chown runner:runner -R /home/runner /config /opt/virtualenvs 28 | if [[ -n "$(ls /tmp/)" ]]; then 29 | rm -rf /tmp/* 30 | fi 31 | 32 | 33 | rm /phase2.sh 34 | -------------------------------------------------------------------------------- /extra/apt-install: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # bin/compile 3 | 4 | # fail fast 5 | set -e 6 | 7 | # debug 8 | # set -x 9 | 10 | # parse and derive params 11 | BUILD_DIR=/home/runner 12 | CACHE_DIR=/tmp 13 | LP_DIR=`cd $(dirname $0); cd ..; pwd` 14 | 15 | function error() { 16 | echo " ! $*" >&2 17 | exit 1 18 | } 19 | 20 | function topic() { 21 | echo "-----> $*" 22 | } 23 | 24 | function indent() { 25 | c='s/^/ /' 26 | case $(uname) in 27 | Darwin) sed -l "$c";; 28 | *) sed -u "$c";; 29 | esac 30 | } 31 | 32 | APT_CACHE_DIR="$CACHE_DIR/apt/cache" 33 | APT_STATE_DIR="$CACHE_DIR/apt/state" 34 | APT_SOURCELIST_DIR="$CACHE_DIR/apt/sources" # place custom sources.list here 35 | 36 | APT_SOURCES="$APT_SOURCELIST_DIR/sources.list" 37 | 38 | 39 | APT_OPTIONS="-o debug::nolocking=true -o dir::cache=$APT_CACHE_DIR -o dir::state=$APT_STATE_DIR" 40 | APT_OPTIONS="$APT_OPTIONS -o dir::etc::sourcelist=$APT_SOURCES" 41 | 42 | rm -rf $APT_CACHE_DIR 43 | mkdir -p "$APT_CACHE_DIR/archives/partial" 44 | mkdir -p "$APT_STATE_DIR/lists/partial" 45 | mkdir -p "$APT_SOURCELIST_DIR" # make dir for sources 46 | cat "/etc/apt/sources.list" > "$APT_SOURCES" # no cp here 47 | 48 | topic "Updating apt caches" 49 | apt-get $APT_OPTIONS update | indent 50 | 51 | for PACKAGE in $*; do 52 | if [[ $PACKAGE == *deb ]]; then 53 | PACKAGE_NAME=$(basename $PACKAGE .deb) 54 | PACKAGE_FILE=$APT_CACHE_DIR/archives/$PACKAGE_NAME.deb 55 | 56 | topic "Fetching $PACKAGE" 57 | curl -s -L -z $PACKAGE_FILE -o $PACKAGE_FILE $PACKAGE 2>&1 | indent 58 | else 59 | topic "Fetching .debs for $PACKAGE" 60 | apt-get $APT_OPTIONS -y --force-yes -d install --reinstall $PACKAGE | indent 61 | fi 62 | done 63 | 64 | mkdir -p $BUILD_DIR/.apt 65 | 66 | for DEB in $(ls -1 $APT_CACHE_DIR/archives/*.deb); do 67 | topic "Installing $(basename $DEB)" 68 | dpkg -x $DEB $BUILD_DIR/.apt/ 69 | done 70 | 71 | topic "Rewrite package-config files" 72 | find $BUILD_DIR/.apt -type f -ipath '*/pkgconfig/*.pc' | xargs --no-run-if-empty -n 1 sed -i -e 's!^prefix=\(.*\)$!prefix='"$BUILD_DIR"'/.apt\1!g' 73 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/pyxel: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",pyxel,"* ]]; then 8 | echo S 'pyxel:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'pyxel' 14 | 15 | # pyxel:0 16 | SUCCESS=true 17 | OUTPUT="$(echo 'cHJpbnQoX19uYW1lX18p' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'pyxel' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'pyxel' \ 24 | <( echo 'X19tYWluX18K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'pyxel:0' 33 | else 34 | echo ❌ 'pyxel:0' 35 | CODE=1 36 | fi 37 | # pyxel:hello 38 | SUCCESS=true 39 | OUTPUT="$(echo 'cHJpbnQoImhlbGxvIik=' | \ 40 | base64 --decode | \ 41 | run-project -s -l 'pyxel' \ 42 | )" || SUCCESS=false 43 | if [[ "${SUCCESS}" == "true" ]]; then 44 | echo "${OUTPUT}" | \ 45 | diff --unified --ignore-trailing-space --label 'pyxel' \ 46 | <( echo 'aGVsbG8K' | base64 --decode ) \ 47 | - || \ 48 | SUCCESS=false 49 | else 50 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 51 | fi 52 | 53 | if [[ "${SUCCESS}" == "true" ]]; then 54 | echo ✓ 'pyxel:hello' 55 | else 56 | echo ❌ 'pyxel:hello' 57 | CODE=1 58 | fi 59 | # pyxel:pyxel 60 | SUCCESS=true 61 | OUTPUT="$(echo 'aW1wb3J0IHB5eGVs' | \ 62 | base64 --decode | \ 63 | run-project -s -l 'pyxel' \ 64 | )" || SUCCESS=false 65 | if [[ "${SUCCESS}" == "true" ]]; then 66 | echo "${OUTPUT}" | \ 67 | diff --unified --ignore-trailing-space --label 'pyxel' \ 68 | <( echo 'Cg==' | base64 --decode ) \ 69 | - || \ 70 | SUCCESS=false 71 | else 72 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 73 | fi 74 | 75 | if [[ "${SUCCESS}" == "true" ]]; then 76 | echo ✓ 'pyxel:pyxel' 77 | else 78 | echo ❌ 'pyxel:pyxel' 79 | CODE=1 80 | fi 81 | 82 | exit $CODE 83 | -------------------------------------------------------------------------------- /languages/webassembly.toml: -------------------------------------------------------------------------------- 1 | name = "WebAssembly" 2 | entrypoint = "main.wat" 3 | extensions = [ 4 | "wat" 5 | ] 6 | packages = [ 7 | ] 8 | setup = [ 9 | "wget https://github.com/wasmerio/wasmer/releases/download/0.14.0/wasmer-linux-amd64.tar.gz -O /tmp/wasmer.tar.gz", 10 | "mkdir /usr/local/wasmer", 11 | "tar -xvf /tmp/wasmer.tar.gz -C /usr/local/wasmer --strip-components=1", 12 | "ln -s /usr/local/wasmer/wasmer /usr/local/bin/wasmer", 13 | "rm /tmp/wasmer.tar.gz" 14 | ] 15 | 16 | 17 | [run] 18 | command = [ 19 | "wasmer", 20 | "run", 21 | "main.wat" 22 | ] 23 | 24 | [tests] 25 | 26 | [tests.hello] 27 | code = """;; wat2wasm main.wat 28 | 29 | (module $hello 30 | ;; Import the required fd_write WASI function which will write the given io vectors to stdout 31 | ;; The function signature for fd_write is: 32 | ;; (File Descriptor, *iovs, iovs_len, nwritten) -> Returns number of bytes written 33 | (import "wasi_unstable" "fd_write" 34 | (func $fd_write (param i32 i32 i32 i32) (result i32)) 35 | ) 36 | 37 | (memory 1) 38 | (export "memory" (memory 0)) 39 | 40 | ;; Write 'hello world\\n' to memory at an offset of 8 bytes 41 | ;; Note the trailing newline which is required for the text to appear 42 | (data (i32.const 8) "Hello, World") 43 | 44 | (func $main (export "_start") 45 | ;; Creating a new io vector within linear memory 46 | (i32.store (i32.const 0) (i32.const 8)) ;; iov.iov_base - This is a pointer to the start of the 'hello world\\n' string 47 | (i32.store (i32.const 4) (i32.const 12)) ;; iov.iov_len - The length of the 'hello world\\n' string 48 | 49 | (call $fd_write 50 | (i32.const 1) ;; file_descriptor - 1 for stdout 51 | (i32.const 0) ;; *iovs - The pointer to the iov array, which is stored at memory location 0 52 | (i32.const 1) ;; iovs_len - We're printing 1 string stored in an iov - so one. 53 | (i32.const 20) ;; nwritten - A place in memory to store the number of bytes writen 54 | ) 55 | drop ;; Discard the number of bytes written from the top the stack 56 | ) 57 | ) 58 | """ 59 | output = "Hello, World" 60 | -------------------------------------------------------------------------------- /out/Dockerfile.splice: -------------------------------------------------------------------------------- 1 | # syntax = docker/dockerfile:1.2@sha256:e2a8561e419ab1ba6b2fe6cbdf49fd92b95912df1cf7d313c3e2230a333fdbcc 2 | 3 | # A Dockerfile that can splice multiple independent layers into a single image. 4 | 5 | 6 | ## Final image where the contents of the tarballs are all extracted together. 7 | FROM polygott:phase1.5 AS polygott 8 | #ADD# 9 | RUN : > /etc/ld.so.cache && \ 10 | ldconfig && \ 11 | mkdir -p /inject /io /mnt/scratch /mnt/cacache 12 | ENV \ 13 | APT_OPTIONS="-o debug::nolocking=true -o dir::cache=/tmp/apt/cache -o dir::state=/tmp/apt/state -o dir::etc::sourcelist=/tmp/apt/sources/sources.list" \ 14 | CPATH="/home/runner/.apt/usr/include:/home/runner/.apt/usr/include/x86_64-linux-gnu" \ 15 | CPPPATH="/home/runner/.apt/usr/include:/home/runner/.apt/usr/include/x86_64-linux-gnu" \ 16 | DISPLAY=":0" \ 17 | HOME="/home/runner" \ 18 | INCLUDE_PATH="/home/runner/.apt/usr/include:/home/runner/.apt/usr/include/x86_64-linux-gnu" \ 19 | LANG="en_US.UTF-8" \ 20 | LC_ALL="en_US.UTF-8" \ 21 | LD_LIBRARY_PATH="/home/runner/.apt/usr/lib/x86_64-linux-gnu:/home/runner/.apt/usr/lib/i386-linux-gnu:/usr/local/lib:/home/runner/.apt/usr/lib" \ 22 | LIBRARY_PATH="/home/runner/.apt/usr/lib/x86_64-linux-gnu:/home/runner/.apt/usr/lib/i386-linux-gnu:/usr/local/lib:/home/runner/.apt/usr/lib" \ 23 | NIX_PATH="/home/runner/.nix-defexpr/channels" \ 24 | NIX_PROFILES="/nix/var/nix/profiles/default /home/runner/.nix-profile" \ 25 | NIX_SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt" \ 26 | PATH="/home/runner/.nix-profile/bin:/usr/local/go/bin:/opt/virtualenvs/python3/bin:/usr/GNUstep/System/Tools:/usr/GNUstep/Local/Tools:/home/runner/.apt/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ 27 | PKG_CONFIG_PATH="/home/runner/.apt/usr/lib/x86_64-linux-gnu/pkgconfig:/home/runner/.apt/usr/lib/i386-linux-gnu/pkgconfig:/home/runner/.apt/usr/lib/pkgconfig:/home/runner/.apt/usr/share/pkgconfig" \ 28 | PYTHONPATH="/opt/virtualenvs/python3/lib/python3.8/site-packages" \ 29 | USER="runner" \ 30 | VIRTUAL_ENV="/opt/virtualenvs/python3" 31 | WORKDIR /home/runner 32 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/python3: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup python3' 11 | cd "${HOME}" 12 | 13 | ln -s /usr/bin/python3.8 /usr/local/bin/python3 14 | curl https://bootstrap.pypa.io/get-pip.py | python3 15 | python3 -m venv /opt/virtualenvs/python3 16 | git clone https://github.com/replit/pip /tmp/pip && (cd /tmp/pip && /opt/virtualenvs/python3/bin/pip3 install --use-feature=in-tree-build .) && rm -rf /tmp/pip 17 | /opt/virtualenvs/python3/bin/pip3 install --disable-pip-version-check pipreqs-amasad==0.4.10 poetry==1.1.6 18 | /opt/virtualenvs/python3/bin/pip3 install --disable-pip-version-check toml==0.10.2 future==0.18.2 importlib-metadata==3.10.1 parso==0.5.2 pluggy==0.13.1 python-jsonrpc-server==0.3.2 typing-extensions==3.7.4.3 ujson==1.35 zipp==3.4.1 19 | /opt/virtualenvs/python3/bin/pip3 install --disable-pip-version-check jedi==0.15.2 pyflakes==2.1.1 rope==0.18.0 yapf==0.31.0 python-language-server==0.31.10 20 | /opt/virtualenvs/python3/bin/pip3 install --disable-pip-version-check matplotlib nltk numpy requests scipy replit 21 | /opt/virtualenvs/python3/bin/pip3 install --disable-pip-version-check cs50 22 | /opt/virtualenvs/python3/bin/pip3 install --disable-pip-version-check https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow_cpu-2.2.0-cp38-cp38-manylinux2010_x86_64.whl 23 | /opt/virtualenvs/python3/bin/pip3 install --disable-pip-version-check debugpy==1.2.1 24 | /opt/virtualenvs/python3/bin/python3 -m pip uninstall -y typing 25 | /usr/bin/build-prybar-lang.sh python3 26 | 27 | if [[ -n "$(ls -A /home/runner)" ]]; then 28 | echo Storing home for python3 29 | mkdir -p /opt/homes/python3 30 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/python3 31 | chown runner:runner -R /opt/homes/python3 32 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 33 | ls -A /opt/homes/python3 34 | fi 35 | 36 | chown runner:runner -R /home/runner /config /opt/virtualenvs 37 | if [[ -n "$(ls /tmp/)" ]]; then 38 | rm -rf /tmp/* 39 | fi 40 | 41 | 42 | rm /phase2.sh 43 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/python3: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",python3,"* ]]; then 8 | echo S 'python3:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'python3' 14 | 15 | # python3:0 16 | SUCCESS=true 17 | OUTPUT="$(echo 'cHJpbnQoX19uYW1lX18p' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'python3' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'python3' \ 24 | <( echo 'X19tYWluX18K' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'python3:0' 33 | else 34 | echo ❌ 'python3:0' 35 | CODE=1 36 | fi 37 | # python3:hello 38 | SUCCESS=true 39 | OUTPUT="$(echo 'cHJpbnQoImhlbGxvIik=' | \ 40 | base64 --decode | \ 41 | run-project -s -l 'python3' \ 42 | )" || SUCCESS=false 43 | if [[ "${SUCCESS}" == "true" ]]; then 44 | echo "${OUTPUT}" | \ 45 | diff --unified --ignore-trailing-space --label 'python3' \ 46 | <( echo 'aGVsbG8K' | base64 --decode ) \ 47 | - || \ 48 | SUCCESS=false 49 | else 50 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 51 | fi 52 | 53 | if [[ "${SUCCESS}" == "true" ]]; then 54 | echo ✓ 'python3:hello' 55 | else 56 | echo ❌ 'python3:hello' 57 | CODE=1 58 | fi 59 | # python3:version 60 | SUCCESS=true 61 | OUTPUT="$(echo 'aW1wb3J0IHN5czsgcHJpbnQoc3lzLnZlcnNpb24uc3RhcnRzd2l0aCgnMy44Jykp' | \ 62 | base64 --decode | \ 63 | run-project -s -l 'python3' \ 64 | )" || SUCCESS=false 65 | if [[ "${SUCCESS}" == "true" ]]; then 66 | echo "${OUTPUT}" | \ 67 | diff --unified --ignore-trailing-space --label 'python3' \ 68 | <( echo 'VHJ1ZQo=' | base64 --decode ) \ 69 | - || \ 70 | SUCCESS=false 71 | else 72 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 73 | fi 74 | 75 | if [[ "${SUCCESS}" == "true" ]]; then 76 | echo ✓ 'python3:version' 77 | else 78 | echo ❌ 'python3:version' 79 | CODE=1 80 | fi 81 | 82 | exit $CODE 83 | -------------------------------------------------------------------------------- /out/languages.json: -------------------------------------------------------------------------------- 1 | { 2 | "parents": { 3 | "phase2-assembly": "phase1.5", 4 | "phase2-java": "phase1.5", 5 | "phase2-ballerina": "phase2-java", 6 | "phase2-bash": "phase1.5", 7 | "phase2-c": "phase1.5", 8 | "phase2-clisp": "phase1.5", 9 | "phase2-clojure": "phase1.5", 10 | "phase2-cpp": "phase2-c", 11 | "phase2-cpp11": "phase2-c", 12 | "phase2-crystal": "phase1.5", 13 | "phase2-csharp": "phase1.5", 14 | "phase2-d": "phase1.5", 15 | "phase2-dart": "phase1.5", 16 | "phase2-deno": "phase1.5", 17 | "phase2-elisp": "phase1.5", 18 | "phase2-erlang": "phase1.5", 19 | "phase2-elixir": "phase2-erlang", 20 | "phase2-nodejs": "phase1.5", 21 | "phase2-enzyme": "phase2-nodejs", 22 | "phase2-express": "phase1.5", 23 | "phase2-flow": "phase2-nodejs", 24 | "phase2-forth": "phase1.5", 25 | "phase2-fortran": "phase1.5", 26 | "phase2-fsharp": "phase2-csharp", 27 | "phase2-gatsbyjs": "phase2-nodejs", 28 | "phase2-go": "phase1.5", 29 | "phase2-guile": "phase1.5", 30 | "phase2-haskell": "phase1.5", 31 | "phase2-haxe": "phase1.5", 32 | "phase2-jest": "phase2-nodejs", 33 | "phase2-julia": "phase1.5", 34 | "phase2-kotlin": "phase1.5", 35 | "phase2-love2d": "phase1.5", 36 | "phase2-lua": "phase1.5", 37 | "phase2-mercury": "phase1.5", 38 | "phase2-nextjs": "phase2-nodejs", 39 | "phase2-nim": "phase1.5", 40 | "phase2-nix": "phase1.5", 41 | "phase2-objective-c": "phase1.5", 42 | "phase2-ocaml": "phase1.5", 43 | "phase2-pascal": "phase1.5", 44 | "phase2-php": "phase1.5", 45 | "phase2-powershell": "phase1.5", 46 | "phase2-prolog": "phase1.5", 47 | "phase2-python3": "phase1.5", 48 | "phase2-pygame": "phase2-python3", 49 | "phase2-python": "phase1.5", 50 | "phase2-pyxel": "phase2-python3", 51 | "phase2-quil": "phase2-python3", 52 | "phase2-raku": "phase1.5", 53 | "phase2-react_native": "phase2-jest", 54 | "phase2-reactjs": "phase2-nodejs", 55 | "phase2-reactts": "phase2-nodejs", 56 | "phase2-rlang": "phase1.5", 57 | "phase2-ruby": "phase1.5", 58 | "phase2-rust": "phase1.5", 59 | "phase2-scala": "phase2-java", 60 | "phase2-sqlite": "phase1.5", 61 | "phase2-swift": "phase1.5", 62 | "phase2-tcl": "phase1.5", 63 | "phase2-webassembly": "phase1.5", 64 | "phase2-wren": "phase1.5", 65 | "phase2-tools": "phase1.5" 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /out/share/polygott/phase2.d/objective-c: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | export HOME=/home/runner 6 | 7 | rsync --delete --recursive --links --perms --times /opt/homes/default/ /home/runner 8 | chown -R $(id -u):$(id -g) /home/runner 9 | 10 | echo 'Setup objective-c' 11 | cd "${HOME}" 12 | 13 | export LIBOBJC2=https://codeload.github.com/gnustep/libobjc2/tar.gz/v2.0 14 | export GNUSTEP_SOURCES=( 15 | ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-make-2.8.0.tar.gz 16 | ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-base-1.27.0.tar.gz 17 | ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-gui-0.28.0.tar.gz 18 | ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-back-0.28.0.tar.gz 19 | ) 20 | 21 | # Create temporary directory 22 | mkdir /tmp/gnustep-dev && cd /tmp/gnustep-dev 23 | 24 | # Use clang 25 | export CC=clang-8 26 | export CXX=clang++-8 27 | 28 | # Install libobjc2 29 | export LIBOBJC2_NAME=libobjc2-2.0 30 | curl --output ${LIBOBJC2_NAME}.tar.gz -ks $LIBOBJC2 31 | tar -xz --file=${LIBOBJC2_NAME}.tar.gz 32 | cd $LIBOBJC2_NAME 33 | mkdir Build && cd Build 34 | cmake .. 35 | make 36 | make install 37 | cd ../.. 38 | 39 | # Install GNUStep from source 40 | export GNUSTEP_MAKEFILES=/usr/local/share/GNUstep/Makefiles 41 | for dl in "${GNUSTEP_SOURCES[@]}"; do 42 | export pkg=$(basename ${dl##*/} .tar.gz) 43 | echo '---Downloading '${pkg}'---' 44 | ( 45 | curl -ks ${dl} | tar vzx && cd ${pkg} || exit $? 46 | { 47 | ./configure 48 | make 49 | make install 50 | ldconfig 51 | . /usr/local/share/GNUstep/Makefiles/GNUstep.sh 52 | } 53 | ) || exit $? 54 | done 55 | 56 | # Reinstall libdispatch-dev 57 | cd /tmp/gnustep-dev 58 | git clone https://github.com/plaurent/libdispatch.git 59 | cd libdispatch 60 | rm -Rf build 61 | mkdir build && cd build 62 | ../configure --prefix=/usr 63 | make 64 | make install 65 | ldconfig 66 | 67 | # Remove temporary directory 68 | rm -rf /tmp/gnustep-dev 69 | 70 | cd $HOME 71 | 72 | 73 | if [[ -n "$(ls -A /home/runner)" ]]; then 74 | echo Storing home for objective-c 75 | mkdir -p /opt/homes/objective-c 76 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/objective-c 77 | chown runner:runner -R /opt/homes/objective-c 78 | find /home/runner/ -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 79 | ls -A /opt/homes/objective-c 80 | fi 81 | 82 | chown runner:runner -R /home/runner /config /opt/virtualenvs 83 | if [[ -n "$(ls /tmp/)" ]]; then 84 | rm -rf /tmp/* 85 | fi 86 | 87 | 88 | rm /phase2.sh 89 | -------------------------------------------------------------------------------- /run_dir/parser.py: -------------------------------------------------------------------------------- 1 | """ 2 | simple wrapper around the python ast module to return the JSON formated 3 | string of a given python program. 4 | """ 5 | 6 | import ast 7 | import json 8 | 9 | def parse(program): 10 | lines = program.count('\n') + 1 11 | 12 | root_node = ast.parse(program) 13 | root_node = ast.fix_missing_locations(root_node) 14 | root_node = serialize_node(root_node, lines) 15 | 16 | return json.dumps(root_node) 17 | 18 | def serialize_nodes(nodes, lines, parent): 19 | 20 | nodes = [node for node in nodes if isinstance(node, ast.AST)] 21 | 22 | children = [] 23 | 24 | # loop through the nodes in reverse this way we can pass in `sibling` as 25 | # the last node we parsed. Which (in order) is the child's next sibling 26 | node_count = len(nodes) 27 | next_node = None 28 | for i in reversed(range(node_count)): 29 | node = nodes[i] 30 | 31 | child = serialize_node(node, lines, parent, next_node) 32 | children = [child] + children 33 | 34 | next_node = child 35 | 36 | return children 37 | 38 | def serialize_node(node, lines, parent=None, sibling=None): 39 | serialized_node = { 40 | 'type': type(node).__name__, 41 | } 42 | 43 | # position is mostly just a rough estimate and we ignore column entirely 44 | # but it should work well enough for now. All we really care about righ 45 | # now is being able to split code based on function boundaries 46 | start_line = None 47 | start_column = None 48 | end_line = None 49 | end_column = None 50 | 51 | if isinstance(node, (ast.expr, ast.stmt)): 52 | start_line = node.lineno 53 | elif parent is None: 54 | start_line = 1 55 | 56 | if sibling != None: 57 | end_line = sibling['position']['start']['line'] - 1 58 | elif parent != None: 59 | end_line = parent['position']['end']['line'] 60 | else: 61 | end_line = lines 62 | 63 | serialized_node['position'] = { 64 | 'start': {'line': start_line, 'column': start_column}, 65 | 'end': {'line': end_line, 'column': end_column}, 66 | } 67 | 68 | node_fields = ast.iter_fields(node) 69 | 70 | for key, value in node_fields: 71 | if isinstance(value, ast.AST): 72 | serialized_node[key] = serialize_node(value, lines, serialized_node) 73 | elif isinstance(value, list): 74 | serialized_node[key] = serialize_nodes(value, lines, serialized_node) 75 | else: 76 | serialized_node[key] = value 77 | 78 | return serialized_node 79 | -------------------------------------------------------------------------------- /languages/java.toml: -------------------------------------------------------------------------------- 1 | name = "java" 2 | entrypoint = "Main.java" 3 | extensions = [ 4 | "java" 5 | ] 6 | packages = [ 7 | "maven", 8 | "openjdk-11-jdk" 9 | ] 10 | setup = [ 11 | "mkdir -p /config/language-server && cd /config/language-server && wget https://download.eclipse.org/jdtls/milestones/1.1.2/jdt-language-server-1.1.2-202105191944.tar.gz && tar -xzf jdt-language-server-1.1.2-202105191944.tar.gz && rm jdt-language-server-1.1.2-202105191944.tar.gz && chown runner:runner -R /config/language-server", 12 | "echo ' 4.0.0 mygroupid myartifactid 0.0-SNAPSHOT de.qaware.maven go-offline-maven-plugin 1.2.5 org.apache.maven.surefire surefire-junit4 2.20.1 PLUGIN com.querydsl querydsl-apt 4.2.1 jpa MAIN ' > /tmp/emptypom.xml", 13 | "mvn -f /tmp/emptypom.xml -Dmaven.repo.local=/home/runner/.m2/repository de.qaware.maven:go-offline-maven-plugin:resolve-dependencies dependency:copy-dependencies", 14 | "rm /tmp/emptypom.xml" 15 | ] 16 | 17 | [compile] 18 | command = [ 19 | "javac", 20 | "-classpath", 21 | ".:/run_dir/junit-4.12.jar:/run_dir/hamcrest-core-1.3.jar:/run_dir/json-simple-1.1.1.jar", 22 | "-d", 23 | "." 24 | ] 25 | 26 | [run] 27 | command = [ 28 | "java", 29 | "-classpath", 30 | ".:/run_dir/junit-4.12.jar:/run_dir/hamcrest-core-1.3.jar:/run_dir/json-simple-1.1.1.jar", 31 | "Main" 32 | ] 33 | 34 | [tests] 35 | 36 | [tests.hello] 37 | code = "class Main { public static void main(String[] args) { System.out.println(\"hello\"); } }" 38 | output = "hello\n" 39 | 40 | [languageServer] 41 | command = [ 42 | "java", 43 | "-Declipse.application=org.eclipse.jdt.ls.core.id1", 44 | "-Dosgi.bundles.defaultStartLevel=4", 45 | "-Declipse.product=org.eclipse.jdt.ls.core.product", 46 | "-Dcom.microsoft.java.debug.serverAddress=localhost:41010", 47 | "-noverify", 48 | "-Xmx256m", 49 | "-XX:+UseConcMarkSweepGC", 50 | "-jar", 51 | "/config/language-server/plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar", 52 | "-configuration", 53 | "/config/language-server/config_linux", 54 | "-data", 55 | "/home/runner" 56 | ] 57 | -------------------------------------------------------------------------------- /out/share/polygott/self-test.d/webassembly: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CODE=0 6 | 7 | if [[ -n "${LANGS}" && ",${LANGS}," != *",webassembly,"* ]]; then 8 | echo S 'WebAssembly:*' 9 | exit $CODE 10 | fi 11 | 12 | find /home/runner -mindepth 1 -maxdepth 1 -exec rm -rf {} \; 13 | polygott-lang-setup -l 'webassembly' 14 | 15 | # WebAssembly:hello 16 | SUCCESS=true 17 | OUTPUT="$(echo 'Ozsgd2F0Mndhc20gbWFpbi53YXQKCihtb2R1bGUgJGhlbGxvCiAgICA7OyBJbXBvcnQgdGhlIHJlcXVpcmVkIGZkX3dyaXRlIFdBU0kgZnVuY3Rpb24gd2hpY2ggd2lsbCB3cml0ZSB0aGUgZ2l2ZW4gaW8gdmVjdG9ycyB0byBzdGRvdXQKICAgIDs7IFRoZSBmdW5jdGlvbiBzaWduYXR1cmUgZm9yIGZkX3dyaXRlIGlzOgogICAgOzsgKEZpbGUgRGVzY3JpcHRvciwgKmlvdnMsIGlvdnNfbGVuLCBud3JpdHRlbikgLT4gUmV0dXJucyBudW1iZXIgb2YgYnl0ZXMgd3JpdHRlbgogICAgKGltcG9ydCAid2FzaV91bnN0YWJsZSIgImZkX3dyaXRlIgogICAgICAgIChmdW5jICRmZF93cml0ZSAocGFyYW0gaTMyIGkzMiBpMzIgaTMyKSAocmVzdWx0IGkzMikpCiAgICApCgogICAgKG1lbW9yeSAxKQogICAgKGV4cG9ydCAibWVtb3J5IiAobWVtb3J5IDApKQoKICAgIDs7IFdyaXRlICdoZWxsbyB3b3JsZFxuJyB0byBtZW1vcnkgYXQgYW4gb2Zmc2V0IG9mIDggYnl0ZXMKICAgIDs7IE5vdGUgdGhlIHRyYWlsaW5nIG5ld2xpbmUgd2hpY2ggaXMgcmVxdWlyZWQgZm9yIHRoZSB0ZXh0IHRvIGFwcGVhcgogICAgKGRhdGEgKGkzMi5jb25zdCA4KSAiSGVsbG8sIFdvcmxkIikKCiAgICAoZnVuYyAkbWFpbiAoZXhwb3J0ICJfc3RhcnQiKQogICAgICAgIDs7IENyZWF0aW5nIGEgbmV3IGlvIHZlY3RvciB3aXRoaW4gbGluZWFyIG1lbW9yeQogICAgICAgIChpMzIuc3RvcmUgKGkzMi5jb25zdCAwKSAoaTMyLmNvbnN0IDgpKSAgOzsgaW92Lmlvdl9iYXNlIC0gVGhpcyBpcyBhIHBvaW50ZXIgdG8gdGhlIHN0YXJ0IG9mIHRoZSAnaGVsbG8gd29ybGRcbicgc3RyaW5nCiAgICAgICAgKGkzMi5zdG9yZSAoaTMyLmNvbnN0IDQpIChpMzIuY29uc3QgMTIpKSAgOzsgaW92Lmlvdl9sZW4gLSBUaGUgbGVuZ3RoIG9mIHRoZSAnaGVsbG8gd29ybGRcbicgc3RyaW5nCgogICAgICAgIChjYWxsICRmZF93cml0ZQogICAgICAgICAgICAoaTMyLmNvbnN0IDEpIDs7IGZpbGVfZGVzY3JpcHRvciAtIDEgZm9yIHN0ZG91dAogICAgICAgICAgICAoaTMyLmNvbnN0IDApIDs7ICppb3ZzIC0gVGhlIHBvaW50ZXIgdG8gdGhlIGlvdiBhcnJheSwgd2hpY2ggaXMgc3RvcmVkIGF0IG1lbW9yeSBsb2NhdGlvbiAwCiAgICAgICAgICAgIChpMzIuY29uc3QgMSkgOzsgaW92c19sZW4gLSBXZSdyZSBwcmludGluZyAxIHN0cmluZyBzdG9yZWQgaW4gYW4gaW92IC0gc28gb25lLgogICAgICAgICAgICAoaTMyLmNvbnN0IDIwKSA7OyBud3JpdHRlbiAtIEEgcGxhY2UgaW4gbWVtb3J5IHRvIHN0b3JlIHRoZSBudW1iZXIgb2YgYnl0ZXMgd3JpdGVuCiAgICAgICAgKQogICAgICAgIGRyb3AgOzsgRGlzY2FyZCB0aGUgbnVtYmVyIG9mIGJ5dGVzIHdyaXR0ZW4gZnJvbSB0aGUgdG9wIHRoZSBzdGFjawogICAgKQopCg==' | \ 18 | base64 --decode | \ 19 | run-project -s -l 'webassembly' \ 20 | )" || SUCCESS=false 21 | if [[ "${SUCCESS}" == "true" ]]; then 22 | echo "${OUTPUT}" | \ 23 | diff --unified --ignore-trailing-space --label 'WebAssembly' \ 24 | <( echo 'SGVsbG8sIFdvcmxk' | base64 --decode ) \ 25 | - || \ 26 | SUCCESS=false 27 | else 28 | echo "run failed: \"${OUTPUT}\", exit code $?" >&2 29 | fi 30 | 31 | if [[ "${SUCCESS}" == "true" ]]; then 32 | echo ✓ 'WebAssembly:hello' 33 | else 34 | echo ❌ 'WebAssembly:hello' 35 | CODE=1 36 | fi 37 | 38 | exit $CODE 39 | -------------------------------------------------------------------------------- /languages/python3.toml: -------------------------------------------------------------------------------- 1 | name = "python3" 2 | entrypoint = "main.py" 3 | extensions = [ 4 | "py" 5 | ] 6 | aptRepos = [ 7 | "ppa:deadsnakes/ppa" 8 | ] 9 | packages = [ 10 | "python3.8", 11 | "python3.8-dev", 12 | "python3.8-tk", 13 | "python3.8-venv", 14 | "libtk8.6", 15 | "libevent-dev", 16 | "gcc", 17 | "tk-dev" 18 | ] 19 | popularity = 5.0 20 | setup = [ 21 | "ln -s /usr/bin/python3.8 /usr/local/bin/python3", 22 | "curl https://bootstrap.pypa.io/get-pip.py | python3", 23 | "python3 -m venv /opt/virtualenvs/python3", 24 | # Use replit's version of pip. 25 | "git clone https://github.com/replit/pip /tmp/pip && (cd /tmp/pip && /opt/virtualenvs/python3/bin/pip3 install --use-feature=in-tree-build .) && rm -rf /tmp/pip", 26 | # Packages required for replit packaging 27 | "/opt/virtualenvs/python3/bin/pip3 install --disable-pip-version-check pipreqs-amasad==0.4.10 poetry==1.1.6", 28 | # pyls and friends' transient dependencies, explicitly pinned 29 | "/opt/virtualenvs/python3/bin/pip3 install --disable-pip-version-check toml==0.10.2 future==0.18.2 importlib-metadata==3.10.1 parso==0.5.2 pluggy==0.13.1 python-jsonrpc-server==0.3.2 typing-extensions==3.7.4.3 ujson==1.35 zipp==3.4.1", 30 | # pyls and friends 31 | "/opt/virtualenvs/python3/bin/pip3 install --disable-pip-version-check jedi==0.15.2 pyflakes==2.1.1 rope==0.18.0 yapf==0.31.0 python-language-server==0.31.10", 32 | # Preinstalled large popular packages 33 | "/opt/virtualenvs/python3/bin/pip3 install --disable-pip-version-check matplotlib nltk numpy requests scipy replit", 34 | # CS50 used by education institutions 35 | "/opt/virtualenvs/python3/bin/pip3 install --disable-pip-version-check cs50", 36 | # lots of people use tensorflow, but it's too big to install in a repl.it workspace directory 37 | # so we pre-install it here. we chose this wheel based on https://www.tensorflow.org/install/pip#virtual-environment-install 38 | "/opt/virtualenvs/python3/bin/pip3 install --disable-pip-version-check https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow_cpu-2.2.0-cp38-cp38-manylinux2010_x86_64.whl", 39 | # Debug Adapter Protocol support 40 | "/opt/virtualenvs/python3/bin/pip3 install --disable-pip-version-check debugpy==1.2.1", 41 | # Avoid using older versions of the typing library. 42 | "/opt/virtualenvs/python3/bin/python3 -m pip uninstall -y typing", 43 | "/usr/bin/build-prybar-lang.sh python3", 44 | ] 45 | 46 | [run] 47 | command = [ 48 | "python3", 49 | "-B", 50 | "main.py" 51 | ] 52 | 53 | [languageServer] 54 | command = [ 55 | "pyls", 56 | "-v" 57 | ] 58 | 59 | [tests] 60 | 61 | [tests.0] 62 | code = "print(__name__)" 63 | output = "__main__\n" 64 | 65 | [tests.hello] 66 | code = "print(\"hello\")" 67 | output = "hello\n" 68 | 69 | [tests.version] 70 | code = "import sys; print(sys.version.startswith('3.8'))" 71 | output = "True\n" 72 | -------------------------------------------------------------------------------- /languages/objective-c.toml: -------------------------------------------------------------------------------- 1 | name = "objective-c" 2 | entrypoint = "main.m" 3 | extensions = [ 4 | "m", 5 | "mm" 6 | ] 7 | 8 | packages = [ 9 | "clang-8", 10 | "libcairo-dev", 11 | "autoconf", 12 | "libblocksruntime-dev", 13 | "libtiff-dev", 14 | "libpthread-workqueue-dev", 15 | "libicu-dev", 16 | "libgnutls28-dev", 17 | "libjpeg-dev", 18 | "libxft-dev", 19 | "libtool", 20 | "libffi-dev", 21 | "libx11-dev", 22 | "libxml2-dev", 23 | "libxrandr-dev", 24 | "libxt-dev", 25 | "libkqueue-dev", 26 | ] 27 | 28 | setup = [ 29 | ''' 30 | export LIBOBJC2=https://codeload.github.com/gnustep/libobjc2/tar.gz/v2.0 31 | export GNUSTEP_SOURCES=( 32 | ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-make-2.8.0.tar.gz 33 | ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-base-1.27.0.tar.gz 34 | ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-gui-0.28.0.tar.gz 35 | ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-back-0.28.0.tar.gz 36 | ) 37 | 38 | # Create temporary directory 39 | mkdir /tmp/gnustep-dev && cd /tmp/gnustep-dev 40 | 41 | # Use clang 42 | export CC=clang-8 43 | export CXX=clang++-8 44 | 45 | # Install libobjc2 46 | export LIBOBJC2_NAME=libobjc2-2.0 47 | curl --output ${LIBOBJC2_NAME}.tar.gz -ks $LIBOBJC2 48 | tar -xz --file=${LIBOBJC2_NAME}.tar.gz 49 | cd $LIBOBJC2_NAME 50 | mkdir Build && cd Build 51 | cmake .. 52 | make 53 | make install 54 | cd ../.. 55 | 56 | # Install GNUStep from source 57 | export GNUSTEP_MAKEFILES=/usr/local/share/GNUstep/Makefiles 58 | for dl in "${GNUSTEP_SOURCES[@]}"; do 59 | export pkg=$(basename ${dl##*/} .tar.gz) 60 | echo '---Downloading '${pkg}'---' 61 | ( 62 | curl -ks ${dl} | tar vzx && cd ${pkg} || exit $? 63 | { 64 | ./configure 65 | make 66 | make install 67 | ldconfig 68 | . /usr/local/share/GNUstep/Makefiles/GNUstep.sh 69 | } 70 | ) || exit $? 71 | done 72 | 73 | # Reinstall libdispatch-dev 74 | cd /tmp/gnustep-dev 75 | git clone https://github.com/plaurent/libdispatch.git 76 | cd libdispatch 77 | rm -Rf build 78 | mkdir build && cd build 79 | ../configure --prefix=/usr 80 | make 81 | make install 82 | ldconfig 83 | 84 | # Remove temporary directory 85 | rm -rf /tmp/gnustep-dev 86 | 87 | cd $HOME 88 | ''' 89 | ] 90 | 91 | [compile] 92 | command = [ 93 | "clang-8", 94 | "-x", "objective-c", 95 | "`gnustep-config --base-libs`", # Add "`gnustep-config --gui-libs`" if you want to use GUI libraries in your program too. 96 | "-o", "main", 97 | ] 98 | 99 | [run] 100 | command = [ 101 | "./main" 102 | ] 103 | 104 | [tests] 105 | 106 | [tests.hello] 107 | code = """ 108 | #import 109 | #import 110 | #import 111 | int main(void) { 112 | @autoreleasepool { 113 | NSString* str = @"Hello from Objective-C 2.0!"; 114 | puts([str cString]); 115 | } 116 | return 0; 117 | } 118 | """ 119 | output = "Hello from Objective-C 2.0!\n" 120 | -------------------------------------------------------------------------------- /out/phase0.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | shopt -s dotglob 4 | 5 | groupadd -g 1000 runner 6 | useradd -m -d /home/runner -g runner -s /bin/bash runner --uid 1000 --gid 1000 7 | 8 | DEBIAN_FRONTEND=noninteractive apt-get update 9 | DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends apt-utils build-essential busybox ca-certificates chromium-chromedriver cmake curl dirmngr ffmpeg firefox-geckodriver fluxbox git gnupg gnuplot-qt golang-go gpg-agent jq language-pack-en libboost-all-dev libc6-dbg libopus0 libopusfile0 libsdl-dev libsdl2-dev locales man mercurial mesa-utils ninja-build pulseaudio redis-tools rlwrap rsync silversearcher-ag software-properties-common ssh subversion tigervnc-standalone-server unzip valgrind vim wget x11-apps x11-utils 10 | 11 | locale-gen en_US.UTF-8 12 | update-locale LANG=en_US.UTF-8 13 | update-ca-certificates 14 | 15 | wget -nv \ 16 | https://launchpad.net/ubuntu/+archive/primary/+files/libtinfo6_6.1+20181013-2ubuntu2_amd64.deb \ 17 | https://launchpad.net/ubuntu/+archive/primary/+files/libreadline8_8.0-1_amd64.deb \ 18 | https://storage.googleapis.com/container-bins/stderred_1.0_amd64.deb 19 | dpkg -i *.deb 20 | rm *.deb 21 | 22 | mkdir -p /config /opt/homes/default /opt/virtualenvs 23 | rsync --archive --no-specials --no-devices /home/runner/ /opt/homes/default 24 | chown runner:runner -R /home/runner /opt/homes/default /config /opt/virtualenvs 25 | 26 | apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 321DC2EA7F0A4F06714516B8E456AE72856D1476 27 | apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF 28 | apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 6494C6D6997C215E 29 | apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 6507444DBDF4EAD2 30 | apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv A2E8E32E64BE8EFD6C3F1F7E0DD4CA7EB1C6CC6B 31 | 32 | 33 | curl -L https://packagecloud.io/cs50/repo/gpgkey | apt-key add - 34 | 35 | curl -L https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | apt-key add - 36 | 37 | curl -L https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - 38 | 39 | add-apt-repository --yes --no-update 'deb https://packagecloud.io/cs50/repo/ubuntu/ bionic main' 40 | add-apt-repository --yes --no-update 'deb https://download.opensuse.org/repositories/devel:languages:crystal/xUbuntu_18.04/ /' 41 | add-apt-repository --yes --no-update 'deb https://download.mono-project.com/repo/ubuntu stable-bionic main' 42 | add-apt-repository --yes --no-update 'deb [arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main' 43 | add-apt-repository --yes --no-update ppa:kelleyk/emacs 44 | add-apt-repository --yes --no-update 'deb https://packages.erlang-solutions.com/ubuntu bionic contrib' 45 | add-apt-repository --yes --no-update 'deb https://deb.nodesource.com/node_14.x bionic main' 46 | add-apt-repository --yes --no-update ppa:haxe/releases 47 | add-apt-repository --yes --no-update ppa:bartbes/love-stable 48 | add-apt-repository --yes --no-update 'deb http://dl.mercurylang.org/deb/ stretch main' 49 | add-apt-repository --yes --no-update ppa:avsm/ppa 50 | add-apt-repository --yes --no-update ppa:deadsnakes/ppa 51 | add-apt-repository --yes --no-update 'deb https://dl.cloudsmith.io/public/nxadm-pkgs/rakudo-pkg/deb/ubuntu bionic main' 52 | 53 | rm -rf /var/lib/apt/lists/* 54 | 55 | # Allow users to override the bash configuration files 56 | echo '[ -f ~/"${REPL_SLUG}/.config/bashrc" ] && . ~/"${REPL_SLUG}/.config/bashrc"' >> ~/.bashrc 57 | echo '[ -f ~/"${REPL_SLUG}/.config/bash_logout" ] && . ~/"${REPL_SLUG}/.config/bash_logout"' >> ~/.bash_logout 58 | echo '[ -f ~/"${REPL_SLUG}/.config/profile" ] && . ~/"${REPL_SLUG}/.config/profile"' >> ~/.profile 59 | 60 | rm /phase0.sh 61 | --------------------------------------------------------------------------------