Skip to content

Commit

Permalink
fix(melange): don't crash when transitive PPX isn't found
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
  • Loading branch information
anmonteiro committed Jun 12, 2023
1 parent 1d2217f commit 5f94231
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/dune_rules/melange/melange_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ let setup_emit_js_rules ~dir_contents ~dir ~scope ~sctx mel =
let* modules_for_js, _obj_dir =
modules_for_js_and_obj_dir ~sctx ~dir_contents ~scope mel
in
Resolve.push_frames resolve_error @@ fun () ->
let module_systems = mel.module_systems in
let output = `Private_library_or_emit target_dir in
let loc = mel.loc in
Expand Down
13 changes: 9 additions & 4 deletions test/blackbox-tests/test-cases/melange/transitive-ppx.t
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ Test interaction of melange.emit library ppx dependencies
> EOF
$ touch lib/impl/subdir.ml

Depending on the `subdir` library (preprocessed by a missing PPX) crashes dune

$ cat > lib/test/dune <<EOF
> (melange.emit
> (target dist)
Expand All @@ -30,5 +28,12 @@ Depending on the `subdir` library (preprocessed by a missing PPX) crashes dune
> (libraries subdir))
> EOF

$ dune build 2>&1 | grep "must not crash"
I must not crash. Uncertainty is the mind-killer. Exceptions are the
$ dune build
File "lib/impl/dune", line 5, characters 18-29:
5 | (preprocess (pps not-present)))
^^^^^^^^^^^
Error: Library "not-present" not found.
-> required by _build/default/lib/test/dist/lib/test/.dist.mobjs/melange.js
-> required by alias lib/test/all
-> required by alias default
[1]

0 comments on commit 5f94231

Please sign in to comment.