Skip to content

Commit

Permalink
test(x-compilation): resolution failure for transitive ppx_runtime_li…
Browse files Browse the repository at this point in the history
…braries

Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
  • Loading branch information
anmonteiro committed Jun 9, 2023
1 parent 6282041 commit 079376b
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(lang dune 1.0)

(package
(name other-ppx))
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(library
(name other_ppx_eq)
(public_name other-ppx.eq)
(libraries other-ppx.api)
(ppx.driver
(main Other_ppx_eq.main))
(kind ppx_deriver))
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
let deriver = "eq"

let main () =
let out = ref "" in
let args =
[ ("-o", Arg.Set_string out, "")
; ("--impl", Arg.Set_string (ref ""), "")
; ("--as-ppx", Arg.Set (ref false), "")
; ("--cookie", Arg.Set (ref false), "")
]
in
let anon _ = () in
Arg.parse (Arg.align args) anon "";
let out = open_out !out in
close_out out;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(library
(name other_ppx_api)
(public_name other-ppx.api)
(wrapped false)
(ppx_runtime_libraries other_ppx_runtime))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let () = ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(library
(name other_ppx_runtime)
(public_name other-ppx.runtime)
(wrapped false))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let () = ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Demonstrate a bad interaction between cross-compilation and
ppx_runtime_libraries

$ mkdir -p etc/findlib.conf.d
$ export OCAMLFIND_CONF=$PWD/etc/findlib.conf
$ touch etc/findlib.conf etc/findlib.conf.d/foo.conf

$ mkdir lib
$ cat > dune-project <<EOF
> (lang dune 3.8)
> (package (name ppx-cross))
> EOF

$ cat > lib/dune <<EOF
> (library
> (name lib)
> (public_name ppx-cross.lib)
> (preprocess (pps other-ppx.eq)))
> EOF
$ touch lib/lib.ml

$ dune build @install -x foo
File "other-ppx/src/api/dune", line 5, characters 24-41:
5 | (ppx_runtime_libraries other_ppx_runtime))
^^^^^^^^^^^^^^^^^
Error: Library "other_ppx_runtime" not found.
-> required by library "other-ppx.api" in _build/default/other-ppx/src/api
-> required by library "ppx-cross.lib" in _build/default.foo/lib
-> required by _build/default.foo/META.ppx-cross
-> required by _build/install/default.foo/lib/ppx-cross/META
-> required by _build/default.foo/ppx-cross-foo.install
-> required by alias install (context default.foo)
[1]

0 comments on commit 079376b

Please sign in to comment.