From eb124e8431fcb4b69c9723f894453e87091ea7c6 Mon Sep 17 00:00:00 2001 From: Etienne Marais Date: Tue, 3 Sep 2024 12:27:38 +0200 Subject: [PATCH] fix: lock creates parent dir if missing Signed-off-by: Etienne Marais --- src/dune_pkg/lock_dir.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dune_pkg/lock_dir.ml b/src/dune_pkg/lock_dir.ml index 5a5774fba095..d41971506e4d 100644 --- a/src/dune_pkg/lock_dir.ml +++ b/src/dune_pkg/lock_dir.ml @@ -611,7 +611,9 @@ module Write_disk = struct in match Path.(parent (source lock_dir_path_src)) with | Some parent_dir -> - fun () -> Temp.with_temp_dir ~parent_dir ~prefix:"dune" ~suffix:"lock" ~f:build + fun () -> + Path.mkdir_p parent_dir; + Temp.with_temp_dir ~parent_dir ~prefix:"dune" ~suffix:"lock" ~f:build | None -> User_error.raise [ Pp.textf "Temporary directory can't be created by deriving the lock dir path" ]