Skip to content

Commit

Permalink
test: show melange.emit error with dialects
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
  • Loading branch information
anmonteiro committed Mar 22, 2024
1 parent cd6f2e4 commit 0d4c945
Showing 1 changed file with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Show missing dependency in Melange when sandboxing is enabled

$ cat > dune-project <<EOF
> (lang dune 3.11)
> (using melange 0.1)
> (dialect
> (name myd)
> (implementation
> (preprocess (run cat %{input-file}))
> (extension myd))
> (interface
> (preprocess (run cat %{input-file}))
> (extension mydi)))
> EOF
$ cat > dune <<EOF
> (melange.emit
> (target output)
> (alias mel)
> (libraries foo)
> (emit_stdlib false))
> EOF
$ mkdir lib
$ cat > lib/dune <<EOF
> (library
> (name foo)
> (modes melange))
> EOF
$ cat > lib/foo.myd <<EOF
> let name = Bar.name
> EOF
$ cat > lib/bar.ml <<EOF
> let name = "Zoe"
> EOF
$ dune build @mel
Error: ocamldep returned unexpected output for _build/default/lib/foo.myd:
> lib/foo.myd.ml: Bar
-> required by _build/default/output/lib/foo.js
-> required by alias mel
[1]

0 comments on commit 0d4c945

Please sign in to comment.