From 0fafebe9beddb062cd3ec55e11a6d601d00a7e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Dimino?= Date: Wed, 6 Jun 2018 16:17:40 +0100 Subject: [PATCH] Fix generation of the ppx key for jbuild directories (#860) Signed-off-by: Jeremie Dimino --- src/preprocessing.ml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/preprocessing.ml b/src/preprocessing.ml index 51ab79a0..d8461be8 100644 --- a/src/preprocessing.ml +++ b/src/preprocessing.ml @@ -324,8 +324,13 @@ let gen_rules sctx components = let ppx_driver_exe sctx libs ~dir_kind = let names = - List.rev_map libs ~f:Lib.name - |> List.sort ~compare:String.compare + let names = List.rev_map libs ~f:Lib.name in + match (dir_kind : File_tree.Dune_file.Kind.t) with + | Dune -> List.sort names ~compare:String.compare + | Jbuild -> + match names with + | last :: others -> List.sort others ~compare:String.compare @ [last] + | [] -> [] in let scope_for_key = List.fold_left libs ~init:None ~f:(fun acc lib ->