This commit is contained in:
swrup 2025-11-11 02:07:51 +01:00
parent aa2ff7b2f0
commit 2f3113f55d
11742 changed files with 1223940 additions and 0 deletions

View file

@ -0,0 +1,40 @@
We try to load a module defined in an executable
$ cat >dune-project <<EOF
> (lang dune 3.3)
> EOF
$ cat >bar.ml <<EOF
> let v = 42
> EOF
$ cat >foo.ml <<EOF
> let foo = Bar.v + 42
> EOF
$ cat >dune <<EOF
> (executable
> (name foo))
> EOF
$ dune ocaml top-module foo.ml
#directory "$TESTCASE_ROOT/_build/default/.topmod/foo.ml";;
#load "$TESTCASE_ROOT/_build/default/.foo.eobjs/byte/dune__exe.cmo";;
#load "$TESTCASE_ROOT/_build/default/.foo.eobjs/byte/dune__exe__Bar.cmo";;
#load "$TESTCASE_ROOT/_build/default/.topmod/foo.ml/dune__exe__Foo.cmo";;
open Dune__exe
;;
$ ls _build/default/.topmod/foo.ml/
dune__exe.cmi
dune__exe__Bar.cmi
dune__exe__Foo.cmi
dune__exe__Foo.cmo
$ dir=_build/default/.foo.eobjs/byte/
$ ls $dir/*.cmi
_build/default/.foo.eobjs/byte//dune__exe.cmi
_build/default/.foo.eobjs/byte//dune__exe__Bar.cmi
$ ls $dir/*.cmo
_build/default/.foo.eobjs/byte//dune__exe.cmo
_build/default/.foo.eobjs/byte//dune__exe__Bar.cmo