Module Assemblage.Action

module Action: sig .. end
Build action.

An action determines how to output a list of build products from a list of existing input products using a sequence of commands.

Given a notion of product identity (e.g. hash, timestamp, etc.) an action defines a pure function from its input to its outputs, it is assumed that identical inputs yield identical outputs.

In order to be productive it is important to understand the following terminology. With respect to a project:

A build driver is an assemblage driver that given a specification of the project's products yielded by a configuration ensures that all the products exists and are up-to-date according to the project's actions.

FIXME. The following need to clarified




Build actions


type t 
The type for build actions.
val v : ?log:string ->
?ctx:Assemblage.Ctx.t ->
?inputs:Assemblage.Path.t list ->
?outputs:Assemblage.Path.t list ->
Assemblage.Acmd.t list -> t
v ctx inputs outputs cmds is the action that given the existence of inputs creates outputs using the sequence of command cmds. ctx defaults to Ctx.empty, inputs and outputs to the empty list. log is a high-level logging string about the action that may be used by drivers when the action is invoked.

Warning. To ensure determinism and parallelism correctness cmds must ensure that it only reads from the inputs and solely writes to outputs.

val ctx : t -> Assemblage.Ctx.t
ctx a is a's context.
val inputs : t -> Assemblage.Path.t list
inputs a is the list of products input by a's action.
val outputs : t -> Assemblage.Path.t list
outputs a is the list of products output by a's action.
val cmds : t -> Assemblage.Acmd.t list
cmds a is a's commands to generate outputs from the inputs.
val log : t -> string option
log a is a's high-level logging string (if any).
val products : t -> Assemblage.Path.t list
products a is inputs a @ outputs a but tail recursive.

Built-in actions


val symlink : (Assemblage.Path.t -> Assemblage.Path.t -> t)
Assemblage.Conf.value
symlink has an action action src dst that links src to dst using Assemblage.Acmd.ln_rel.

Action lists


val list_inputs : t list -> Assemblage.Path.t list
list_inputs l is the list of inputs of the actions in l. Ordered but may contain duplicates.
val list_outputs : t list -> Assemblage.Path.t list
list_outputs l is the list of outputs of the actions in l. Ordered but may contain duplicates.
val list_products : t list -> Assemblage.Path.t list
list_products l is list_inputs l @ list_outputs l but tail-recursive.