Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: create lock dir parent if missing #10876

Merged
merged 3 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/dune_pkg/lock_dir.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ Create a lock directory that didn't originally exist
> (lang dune 3.10)
> (lock_dir
> (repositories mock))
> (lock_dir
> (path "dev/dune.lock")
> (repositories mock))
> (repository
> (name mock)
> (source "file://$(pwd)/mock-opam-repository"))
> EOF
$ dune pkg lock "dev/dune.lock"
Solution for dev/dune.lock:
(no dependencies to lock)
maiste marked this conversation as resolved.
Show resolved Hide resolved
$ dune pkg lock
Solution for dune.lock:
(no dependencies to lock)
Expand Down
Loading