refactor: move modules: Modules.t from Dune_package.Lib to Lib_info#6605
refactor: move modules: Modules.t from Dune_package.Lib to Lib_info#6605rgrinberg merged 3 commits intoocaml:mainfrom
modules: Modules.t from Dune_package.Lib to Lib_info#6605Conversation
| ~modules | ||
| in | ||
| Dune_package.Lib.of_dune_lib ~info ~modules ~main_module_name | ||
| Dune_package.Lib.of_dune_lib ~info ~main_module_name |
There was a problem hiding this comment.
callout: in this function to_dune_lib, we get ~modules as an argument and ignore modules from info.
I suspect it's correct, since info.modules will always probably be Local, but wanted to call out anyway.
modules: Modules.t from Dune_package.Lib to Lib_infomodules: Modules.t from Dune_package.Lib to Lib_info
src/dune_rules/dir_contents.ml
Outdated
| match Lib_info.modules info with | ||
| | External modules -> Memo.return (Some modules) | ||
| | Local -> ( | ||
| match Path.as_in_build_dir dir with |
There was a problem hiding this comment.
should I be using Path.as_in_build_dir_exn here?
There was a problem hiding this comment.
Good question. The answer is no because it will fail for findlib libraries. We need to improve the types per my comment #6605 (comment) or Ali's suggestion #6605 (comment)
src/dune_rules/lib_info.mli
Outdated
|
|
||
| val modes : _ t -> Lib_mode.Map.Set.t | ||
|
|
||
| val modules : _ t -> Modules.t Source.t |
There was a problem hiding this comment.
Hm, this type isn't quite correct actually. it should really be:
type t =
| Local
| Unavailable
| Present of Modules.t
Since findlib modules do not have this information.
|
I have a similar change in #6489, there I chose: |
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
a1f0b46 to
a8c22c7
Compare
|
Now we can use Path.as_in_build_dir_exn |
…nfo` (ocaml#6605) Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
* main: (54 commits) doc: how we write `to_dyn` and `equal` (ocaml#6621) test(cache): test output of man pages test: dune utop for (subdir ..) (ocaml#6629) refactor: improve style of utop rules (ocaml#6628) test: depend on utop (ocaml#6627) refactor(stdune): Add Appendable_list.cons (ocaml#6624) doc: tighten wording in README.md test: add a repro case for ocaml#6607 (ocaml#6612) doc: cleanup status badges in README.md (ocaml#6618) doc(README): rewrap paragraphs and cleanup links coq: more resilient config query fix: link time code gen (ocaml#6606) fix(melange): run melc ppx with merlin (ocaml#6476) feature(melange): add compile_flags (ocaml#6569) refactor: move `modules: Modules.t` from `Dune_package.Lib` to `Lib_info` (ocaml#6605) Set CLICOLOR_FORCE=0 (ocaml#6608) fix: declare deps for ccomp detection (ocaml#6610) refactor: assume Cmdliner.Arg.conv is abstract (ocaml#6609) refactor: gen_rules pattern matching (ocaml#6604) Add CI for MSVC using dkml-workflows (ocaml#6540) ...
Signed-off-by: Antonio Nuno Monteiro anmonteiro@gmail.com