Skip to content

Commit

Permalink
Add a comment about [mkdir_p]
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Mokhov <[email protected]>
  • Loading branch information
snowleopard committed Apr 28, 2021
1 parent 8df9345 commit 21260c1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/dune_engine/build_system.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ module Fs : sig
val assert_exists : loc:Loc.t -> Path.t -> unit Memo.Build.t
end = struct
let mkdir_p_def =
(* CR-someday amokhov: It's difficult to think about the correctness of this
memoized function. Right now, we never invalidate it, so if we delete a
stale build directory, we'll not be able to recreate it later. Perhaps,
we should create directories as part of running actions that need them.
That would be less efficient, as we'd call [mkdir] on the same directory
multiple times, but it would be easier to guarantee correctness.
Note: if we find a way to reliably invalidate this function, its output
should continue to have no cutoff because the callers might depend not
just on the existence of the directory but on its *continuous* existence. *)
Memo.create_no_cutoff "mkdir_p"
~input:(module Path.Build)
(fun p ->
Expand Down

0 comments on commit 21260c1

Please sign in to comment.