From a1e732ff8c5702bf6675956458ba171e04b1d02c Mon Sep 17 00:00:00 2001 From: Etienne Millon Date: Mon, 10 Jul 2023 15:40:25 +0200 Subject: [PATCH] fix(staged_pps): expand path relative to root Fixes #8158 This is an error introduced in #8109, not part of a release. Signed-off-by: Etienne Millon --- src/dune_rules/preprocessing.ml | 3 ++- test/blackbox-tests/test-cases/github8158.t | 8 ++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/dune_rules/preprocessing.ml b/src/dune_rules/preprocessing.ml index 790bae9afa9..9bebaae7f33 100644 --- a/src/dune_rules/preprocessing.ml +++ b/src/dune_rules/preprocessing.ml @@ -635,7 +635,8 @@ let pp_one_module sctx ~lib_name ~scope ~preprocessor_deps Expander.expand_and_eval_set expander driver.info.as_ppx_flags ~standard:(Action_builder.return [ "--as-ppx" ]) and* () = preprocessor_deps in - Command.expand_no_targets ~dir:(Path.build dir) + Command.expand_no_targets + ~dir:(Path.build (Super_context.context sctx).build_dir) (S [ Dep (Path.build exe); As driver_flags; As flags ])) in [ "-ppx"; String.quote_list_for_shell args ] diff --git a/test/blackbox-tests/test-cases/github8158.t b/test/blackbox-tests/test-cases/github8158.t index 0e58359afd5..51df3d880d7 100644 --- a/test/blackbox-tests/test-cases/github8158.t +++ b/test/blackbox-tests/test-cases/github8158.t @@ -33,10 +33,6 @@ directory. > EOF $ touch bin/e.ml -This fails, but should work (and print nothing): +This works: - $ dune exec bin/e.exe 2>&1 | sed -e 's/camlppx....../camlppxXXXXXX/g' -e 's/build_......_dune/build_XXXXXX_dune/g' - File "bin/.e.eobjs/_unknown_", line 1, characters 0-0: - sh: 1: ../.ppx/059965dd2a1761d0e00c111505aef5ac/ppx.exe: not found - File "bin/e.ml", line 1: - Error: I/O error: ../.ppx/059965dd2a1761d0e00c111505aef5ac/ppx.exe --as-ppx '/tmp/build_XXXXXX_dune/build_XXXXXX_dune/camlppxXXXXXX' '/tmp/build_XXXXXX_dune/build_XXXXXX_dune/camlppxXXXXXX' + $ dune exec bin/e.exe