Function make [src]

If the Step's make function reports error.MakeFailed, it indicates they have already reported the error. Otherwise, we add a simple error report here.

Prototype

pub fn make(s: *Step, options: MakeOptions) error{ MakeFailed, MakeSkipped }!void

Parameters

s: *Stepoptions: MakeOptions

Possible Errors

MakeFailed
MakeSkipped

Source

pub fn make(s: *Step, options: MakeOptions) error{ MakeFailed, MakeSkipped }!void { const arena = s.owner.allocator; var timer: ?std.time.Timer = t: { if (!s.owner.graph.time_report) break :t null; if (s.id == .compile) break :t null; break :t std.time.Timer.start() catch @panic("--time-report not supported on this host"); }; const make_result = s.makeFn(s, options); if (timer) |*t| { options.web_server.?.updateTimeReportGeneric(s, t.read()); } make_result catch |err| switch (err) { error.MakeFailed => return error.MakeFailed, error.MakeSkipped => return error.MakeSkipped, else => { s.result_error_msgs.append(arena, @errorName(err)) catch @panic("OOM"); return error.MakeFailed; }, }; if (!s.test_results.isSuccess()) { return error.MakeFailed; } if (s.max_rss != 0 and s.result_peak_rss > s.max_rss) { const msg = std.fmt.allocPrint(arena, "memory usage peaked at {0B:.2} ({0d} bytes), exceeding the declared upper bound of {1B:.2} ({1d} bytes)", .{ s.result_peak_rss, s.max_rss, }) catch @panic("OOM"); s.result_error_msgs.append(arena, msg) catch @panic("OOM"); } }