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 2, 2024
1 parent a19d1dd commit 2a58491
Show file tree
Hide file tree
Showing 3 changed files with 38 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
17 changes: 17 additions & 0 deletions rce/packages/ocaml/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -e

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

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

/opt/ocaml/2.1.5/opam init

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 2a58491

Please sign in to comment.