Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rce): support ocaml 2.1.5 #162

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions rce/packages/ocaml/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language = "OCaml"
version = "2.1.5"
compiled = true
extension = "ml"
# opam env --switch=default
environment = [
"PATH=/opt/ocaml/2.1.5/default/bin",
"MANPATH=/opt/ocaml/2.1.5/default/man",
"OCAML_TOPLEVEL_PATH=/opt/ocaml/2.1.5/default/lib/toplevel",
"CAML_LD_LIBRARY_PATH=/opt/ocaml/2.1.5/default/lib/stublibs:/opt/ocaml/2.1.5/default/lib/ocaml/stublibs:/opt/ocaml/2.1.5/default/lib/ocaml",
"OPAM_SWITCH_PREFIX=/opt/ocaml/2.1.5/default",
]
build_command = [ "ocamlc", "-o", "code", "{file}" ]
run_command = [ "./code" ]
test_file = "test.ml"
aliases = [ "ocaml", "oc", "ml" ]
should_limit_memory = false
memory_limit = 0
process_limit = 4096
allowed_entrypoints = -1
27 changes: 27 additions & 0 deletions rce/packages/ocaml/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

set -e

VERSION="2.1.5"
export OPAMROOT=/opt/ocaml/${VERSION}

mkdir -p /opt/ocaml/${VERSION}
cd /opt/ocaml/${VERSION}
echo "PWD: $PWD"

echo "Bootstrapping opam"

curl -L -o install-core.sh https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh
bash ./install-core.sh --version ${VERSION} <<EOF
/opt/ocaml/${VERSION}

EOF

echo "Initializing opam"

/opt/ocaml/${VERSION}/opam init <<EOF
Y

EOF

rm install-core.sh
1 change: 1 addition & 0 deletions rce/packages/ocaml/test.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print_string "Hello world!\n"
Loading