Skip to content

Commit

Permalink
feat: support ocaml 2.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ii64 committed Feb 3, 2024
1 parent dd35aa0 commit 9e5ac13
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
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"

0 comments on commit 9e5ac13

Please sign in to comment.