1DOLLY 72PACKAGE ocaml3REQUIRES HOST runtime@04REQUIRES HOST threads@056# OCaml 5.5 from upstream's release, as bytecode: OCaml has no native code7# generator for WebAssembly. configure runs outside, in the pinned Emscripten8# container (prepare-ocaml.sh), and the runtime is patched for Dolly9# (ocaml-dolly.patch). Dolly compiles the runtime, and upstream's boot/ocamlc10# builds the compiler, the libraries and the tools; then the compiler builds11# itself until it reproduces itself. The runtime runs OCaml 5's domains on12# Dolly's threads.13FROM /v0.1.4/demos/tools/Dollyfile-tools-build 81e1c1bc8b06c83b1daead6c8f09bc8b1382e8fe165f896a98109396b58bb30514# A program with C stubs (unix, str, threads) links its runtime with cc.15INSTALL /v0.1.4/Dollyfile-cc dadb1af6ae3450a3a48bf4c955fe40d012a9a20d6dc3eca63c4f2737ab4080cc1617REQUIRES HEADER libc18REQUIRES TOOL   cc19REQUIRES TOOL   cmp20REQUIRES TOOL   gzip21REQUIRES TOOL   install22REQUIRES TOOL   make23REQUIRES TOOL   tar24REQUIRES TOOL   text-page2526SOURCE /v0.1.4/dist/static/ocaml/ocaml.tar.gz beac076436c92b33693c3a2301c9c102749880fe7017df8ce63135e9e6cd21ab /tmp/ocaml.tar.gz27SLOP gzip -dc /tmp/ocaml.tar.gz | tar -xf - -C /28SLOP CWD /tmp/ocaml make -j4 world29# Upstream's fixpoint: the compiler that boot/ocamlc built compiles itself,30# and that compiler again; make fails unless the last two compilers and31# lexers are the same bytes ("Fixpoint reached, bootstrap succeeded.").32SLOP CWD /tmp/ocaml make -j4 bootstrap33SLOP CWD /tmp/ocaml make install3435# The toplevel runs a script; ocamlc links a program with unix and str (a36# custom runtime, which carries the bytecode in a custom section) that spawns37# a command through a pipe, and one that runs a domain and a thread.38FILE /tmp/ocaml-check/answer.ml39    print_int (List.fold_left ( + ) 0 [20; 22])40FILE /tmp/ocaml-check/words.ml41    let () =42      let input, output = Unix.pipe () in43      let pid = Unix.create_process "echo" [| "echo"; "one two  three" |] Unix.stdin output Unix.stderr in44      Unix.close output;45      let line = input_line (Unix.in_channel_of_descr input) in46      let _, status = Unix.waitpid [] pid in47      let words = Str.split (Str.regexp " +") line in48      Printf.printf "%d %s %b\n" (List.length words) (String.concat "," words) (status = Unix.WEXITED 0)49FILE /tmp/ocaml-check/domains.ml50    let sum n = let rec go i total = if i > n then total else go (i + 1) (total + i) in go 1 051    let () =52      let domain = Domain.spawn (fun () -> sum 1000) in53      let result = ref 0 in54      Thread.join (Thread.create (fun () -> result := sum 100) ());55      Printf.printf "%d %d\n" (Domain.join domain) !result56SLOP test "$(ocaml /tmp/ocaml-check/answer.ml)" = 4257SLOP CWD /tmp/ocaml-check ocamlc -I +unix -I +str unix.cma str.cma words.ml -o words && test "$(./words)" = '3 one,two,three true'58SLOP CWD /tmp/ocaml-check ocamlc -I +unix -I +threads unix.cma threads.cma domains.ml -o domains && test "$(./domains)" = '500500 5050'5960EXPORTS TOOL ocaml61EXPORTS TOOL ocamlc62EXPORTS TOOL ocamlc.byte63EXPORTS TOOL ocamlcmt64EXPORTS TOOL ocamlcp65EXPORTS TOOL ocamldep66EXPORTS TOOL ocamldep.byte67EXPORTS TOOL ocamllex68EXPORTS TOOL ocamllex.byte69EXPORTS TOOL ocamlmklib70EXPORTS TOOL ocamlmktop71EXPORTS TOOL ocamlobjinfo72EXPORTS TOOL ocamlobjinfo.byte73EXPORTS TOOL ocamlprof74EXPORTS TOOL ocamlrun75EXPORTS TOOL ocamlyacc76FOLDER /usr/lib/ocaml77SLOP mkdir -p /usr/share/licenses/ocaml78SLOP cp /tmp/ocaml/LICENSE /usr/share/licenses/ocaml/LICENSE79FILE /usr/share/licenses/ocaml/LICENSE80SLOP CWD /usr/share/man/man1 text-page ocaml.1 ocamlc.1 ocamlcp.1 ocamldep.1 ocamllex.1 ocamlmktop.1 ocamlprof.1 ocamlrun.1 ocamlyacc.181FILE /usr/share/man/cat1/ocaml.182FILE /usr/share/man/cat1/ocamlc.183FILE /usr/share/man/cat1/ocamlcp.184FILE /usr/share/man/cat1/ocamldep.185FILE /usr/share/man/cat1/ocamllex.186FILE /usr/share/man/cat1/ocamlmktop.187FILE /usr/share/man/cat1/ocamlprof.188FILE /usr/share/man/cat1/ocamlrun.189FILE /usr/share/man/cat1/ocamlyacc.190