let rec print_backtrace f =
function
| Target (name, backtrace) ->
fprintf f "@\n- @[<2>Failed to build the target %s%a@]" name print_backtrace backtrace
| Leaf r ->
fprintf f "@\n- @[<2>Building %a@]" Resource.print r
| Depth (r, backtrace) ->
fprintf f "@\n- @[<v2>Building %a:%a@]" Resource.print r print_backtrace backtrace
| Choice [backtrace] -> print_backtrace f backtrace
| Choice backtraces ->
fprintf f "@\n- @[<v2>Failed to build all of these:";
List.iter (print_backtrace f) backtraces;
fprintf f "@]"