Skip to content

Commit

Permalink
fix: avoid crashing
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Nuno Monteiro <[email protected]>
  • Loading branch information
anmonteiro committed Apr 15, 2023
1 parent 8f1261e commit 453574d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/dune_rules/link_time_code_gen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ let generate_and_compile_module cctx ~precompiled_cmi ~name ~lib ~code ~requires
let* module_ =
let+ modules = Dir_contents.modules_of_lib sctx lib in
let obj_name =
Option.map modules ~f:(fun modules ->
let mli_only = Modules.find modules name |> Option.value_exn in
Module.obj_name mli_only)
Option.bind modules ~f:(fun modules ->
Option.map (Modules.find modules name) ~f:Module.obj_name)
in
let src_dir =
let obj_dir = Compilation_context.obj_dir cctx in
Expand Down
10 changes: 6 additions & 4 deletions test/blackbox-tests/test-cases/builtin-support-override.t
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ Create a library called `findlib.dynload`
> EOF
$ touch exe/the_exe.ml

$ dune build --display short ./exe/the_exe.exe 2>&1 | grep crash
I must not crash. Uncertainty is the mind-killer. Exceptions are the


$ dune build
File "_none_", line 1:
Error: No implementations provided for the following modules:
Dynlink referenced from exe/.the_exe.eobjs/native/findlib_initl.cmx
Findlib referenced from exe/.the_exe.eobjs/native/findlib_initl.cmx
[1]

0 comments on commit 453574d

Please sign in to comment.