diff --git a/src/gen_rules.ml b/src/gen_rules.ml index 8ccb6aa6..3584172b 100644 --- a/src/gen_rules.ml +++ b/src/gen_rules.ml @@ -1008,12 +1008,9 @@ module Gen(P : Params) = struct ; if_ (native && Module.has_impl m) [ Module.cm_file_unsafe m ~obj_dir Cmx ] ; List.filter_map Ml_kind.all ~f:(Module.cmt_file m ~obj_dir) - ; [ let file = - match m.intf with - | Some f -> f - | None -> Option.value_exn m.impl - in - Path.relative dir file.name ] + ; List.filter_map [m.intf;m.impl] ~f:(function + | None -> None + | Some f -> Some (Path.relative dir f.name)) ]) ; if_ byte [ lib_archive ~dir lib ~ext:".cma" ] ; if_ (Library.has_stubs lib) [ stubs_archive ~dir lib ] diff --git a/test/blackbox-tests/test-cases/gen-opam-install-file/run.t b/test/blackbox-tests/test-cases/gen-opam-install-file/run.t index c86360f3..6ee52ff4 100644 --- a/test/blackbox-tests/test-cases/gen-opam-install-file/run.t +++ b/test/blackbox-tests/test-cases/gen-opam-install-file/run.t @@ -22,6 +22,7 @@ "_build/install/default/lib/foo/foo.cmt" "_build/install/default/lib/foo/foo.cmti" "_build/install/default/lib/foo/foo.mli" + "_build/install/default/lib/foo/foo.ml" "_build/install/default/lib/foo/foo.cma" "_build/install/default/lib/foo/foo.cmxa" "_build/install/default/lib/foo/foo.a"