diff --git a/test/blackbox-tests/test-cases/per-module-lib-deps/transparent-alias.t b/test/blackbox-tests/test-cases/per-module-lib-deps/transparent-alias.t new file mode 100644 index 00000000000..8c8400d91f0 --- /dev/null +++ b/test/blackbox-tests/test-cases/per-module-lib-deps/transparent-alias.t @@ -0,0 +1,51 @@ +Baseline: transparent module aliases and library dependency recompilation. + +When a module re-exports a library via a transparent alias (module M = Mylib), +consumers that use the alias must be recompiled when the library changes. + +See: https://github.com/ocaml/dune/issues/4572 + + $ cat > dune-project < (lang dune 3.23) + > EOF + + $ mkdir lib + $ cat > lib/dune < (library (name mylib)) + > EOF + $ cat > lib/mylib.ml < let v = 42 + > EOF + $ cat > lib/mylib.mli < val v : int + > EOF + + $ cat > dune < (executable (name main) (libraries mylib)) + > EOF + $ cat > re.ml < module M = Mylib + > EOF + $ cat > re.mli < module M = Mylib + > EOF + $ cat > main.ml < let () = print_int Re.M.v + > EOF + + $ dune build ./main.exe + +Change mylib's interface: + + $ cat > lib/mylib.mli < val v : int + > val w : string + > EOF + $ cat > lib/mylib.ml < let v = 42 + > let w = "" + > EOF + +The incremental build must succeed: + + $ dune build ./main.exe