summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ocamlbuild/solver.ml12
1 files changed, 12 insertions, 0 deletions
diff --git a/ocamlbuild/solver.ml b/ocamlbuild/solver.ml
index 1f4f4ef03..8077bd2ed 100644
--- a/ocamlbuild/solver.ml
+++ b/ocamlbuild/solver.ml
@@ -82,12 +82,24 @@ let rec self depth on_the_go_orig target =
| Target _ | Choice _ | Leaf _ -> ()
in until_works rs (backtrace :: backtraces)
in until_works matching_rules []
+
+(* Build the first target that is buildable *)
and self_first depth on_the_go already_failed rs =
match rs with
| [] -> Bad (Failed (Choice already_failed))
| r :: rs ->
try self depth on_the_go r; Good r
with Failed backtrace -> self_first depth on_the_go (backtrace :: already_failed) rs
+
+(* This variant is the one (once partially applied) called the 'build'
+ * function in the rule actions.
+ *
+ * This one takes a list of list of pathnames to build.
+ * This is a parallel conjonction of sequential alternatives.
+ * This means that in each sublist of pathnames, the first
+ * target that is buildable will be picked. The outer list
+ * denotes that one can build each target in parallel.
+ *)
and self_firsts depth on_the_go rss =
let results = List.map (self_first depth on_the_go []) rss in
let cmds, thunks =