DoxigAlpha

make

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.

Function parameters

Parameters

#
s:*Step

Type definitions in this namespace

Types

#

Functions in this namespace

Functions

#
make
If the Step's `make` function reports `error.MakeFailed`, it indicates they
dump
For debugging purposes, prints identifying information about this Step.
evalZigProcess
Assumes that argv contains `--listen=-` and that the process being spawned
installFile
Wrapper around `std.fs.Dir.updateFile` that handles verbose and error output.
installDir
Wrapper around `std.fs.Dir.makePathStatus` that handles verbose and error output.
cacheHit
Prefer `cacheHitAndWatch` unless you already added watch inputs
cacheHitAndWatch
Clears previous watch inputs, if any, and then populates watch inputs from
writeManifest
Prefer `writeManifestAndWatch` unless you already added watch inputs
writeManifestAndWatch
Clears previous watch inputs, if any, and then populates watch inputs from
singleUnchangingWatchInput
For steps that have a single input that never changes when re-running `make`.
addWatchInput
Places a *file* dependency on the path.
addDirectoryWatchInput
Any changes inside the directory will trigger invalidation.
addDirectoryWatchInputFromPath
Any changes inside the directory will trigger invalidation.
reset
Implementation detail of file watching and forced rebuilds.
recursiveReset
Implementation detail of file watching.

Source

Implementation

#
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");
    }
}