diff --git a/src/dune_engine/action_builder0.ml b/src/dune_engine/action_builder0.ml index 27cd5c6fdd8..51cb4a7aa4a 100644 --- a/src/dune_engine/action_builder0.ml +++ b/src/dune_engine/action_builder0.ml @@ -75,10 +75,10 @@ module T = struct } ;; - let of_memo m = + let of_memo memo = { f = (fun mode -> - let+ x = m in + let+ x = memo in x, Deps_or_facts.empty mode) } ;; diff --git a/src/dune_engine/action_builder0.mli b/src/dune_engine/action_builder0.mli index 35e93862e54..cbc04fe8cdb 100644 --- a/src/dune_engine/action_builder0.mli +++ b/src/dune_engine/action_builder0.mli @@ -50,11 +50,20 @@ val exec_memo : ('i, 'o) memo -> 'i -> 'o t but the contents of [p] is irrelevant. *) val goal : 'a t -> 'a t -(** If you're thinking of using [Process.run] here, check that: (i) you don't in +(** An action builder with no dependencies. Consider passing [Memo.of_thunk] to delay + forcing the computation until the action's dependencies need to be determined. + + If you're thinking of using [Process.run] here, check that: (i) you don't in fact need [Command.run], and that (ii) [Process.run] only reads the declared build rule dependencies. *) val of_memo : 'a Memo.t -> 'a t +(** Like [of_memo_forced] but takes a thunk. *) +val of_memo : (unit -> 'a Memo.t) -> 'a t + +(** Like [of_memo] but accepts functions of any argument. *) +val of_memo_apply : ('a -> 'b Memo.t) -> 'a -> 'b t + (** {1 Execution} *) (** Evaluation mode.