diff --git a/CHANGES.md b/CHANGES.md index ed69b0eaf7e..65a450604d6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -29,6 +29,9 @@ - `coqdep` now depends only on the filesystem layout of the .v files, and not on their contents (#5547, helps with #5100, @ejgallego) +- The mdx stanza 0.2 can now be used with `(implicit_transitive_deps false)` + (#5558, fixes #5499, @emillon) + 3.0.3 (Unreleased) ------------------ diff --git a/src/dune_rules/mdx.ml b/src/dune_rules/mdx.ml index 616e9d3a922..7e789c6bd60 100644 --- a/src/dune_rules/mdx.ml +++ b/src/dune_rules/mdx.ml @@ -312,10 +312,11 @@ let mdx_prog_gen t ~sctx ~dir ~scope ~expander ~mdx_prog = let module_ = Module.generated ~src_dir:(Path.build dir) main_module_name in let modules = Modules.singleton_exe module_ in let flags = Ocaml_flags.default ~dune_version ~profile:Release in + let lib name = Lib_dep.Direct (loc, Lib_name.of_string name) in let compile_info = Lib.DB.resolve_user_written_deps_for_exes (Scope.libs scope) [ (t.loc, name) ] - (Lib_dep.Direct (loc, Lib_name.of_string "mdx.test") :: t.libraries) + (lib "mdx.test" :: lib "mdx.top" :: t.libraries) ~pps:[] ~dune_version in let* cctx = diff --git a/test/blackbox-tests/test-cases/mdx-stanza/implicit-transitive-deps-false.t b/test/blackbox-tests/test-cases/mdx-stanza/implicit-transitive-deps-false.t index bb292de5876..1c381633709 100644 --- a/test/blackbox-tests/test-cases/mdx-stanza/implicit-transitive-deps-false.t +++ b/test/blackbox-tests/test-cases/mdx-stanza/implicit-transitive-deps-false.t @@ -1,6 +1,5 @@ -Building the executable generated by the MDX stanza fails when implicit -transitive dependencies are disabled due to an implicit dependency on the -`mdx.top` library: +Building the executable generated by the MDX stanza works when implicit +transitive dependencies are disabled. $ cat >dune-project < (lang dune 3.0) @@ -13,19 +12,3 @@ transitive dependencies are disabled due to an implicit dependency on the > EOF $ dune build - File "mdx_gen.ml-gen", line 28, characters 2-19: - 28 | Mdx_top.Directory path) [] - ^^^^^^^^^^^^^^^^^ - Error: Unbound module Mdx_top - [1] - -Adding `mdx.top` as an explicit dependency of the stanza fixes the issue: - - $ cat >dune < (mdx - > (files markdown_file.md) - > (libraries mdx.top)) - > EOF - - $ dune build -