From 5f9423130d839c1b24e32f9b4036413a168beeeb Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Mon, 12 Jun 2023 16:05:10 -0700 Subject: [PATCH] fix(melange): don't crash when transitive PPX isn't found Signed-off-by: Antonio Nuno Monteiro --- src/dune_rules/melange/melange_rules.ml | 1 - .../test-cases/melange/transitive-ppx.t | 13 +++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/dune_rules/melange/melange_rules.ml b/src/dune_rules/melange/melange_rules.ml index 60dbced7fd25..9315e42055d6 100644 --- a/src/dune_rules/melange/melange_rules.ml +++ b/src/dune_rules/melange/melange_rules.ml @@ -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 diff --git a/test/blackbox-tests/test-cases/melange/transitive-ppx.t b/test/blackbox-tests/test-cases/melange/transitive-ppx.t index e788db5a6850..938069fc38e6 100644 --- a/test/blackbox-tests/test-cases/melange/transitive-ppx.t +++ b/test/blackbox-tests/test-cases/melange/transitive-ppx.t @@ -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 < (melange.emit > (target dist) @@ -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]