Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

failForeign

Run.failForeign
fn failForeign(
    arena: Allocator,
    conf_run: *const Configuration.Step.Run,
    maker: *Maker,
    step_index: Configuration.Step.Index,
    suggested_flag: []const u8,
    argv0: []const u8,
    artifact_target: *const std.Target,
    host_target: *const std.Target,
) Step.ExtendedMakeError

File

Code

fn failForeign(
    arena: Allocator,
    conf_run: *const Configuration.Step.Run,
    maker: *Maker,
    step_index: Configuration.Step.Index,
    suggested_flag: []const u8,
    argv0: []const u8,
    artifact_target: *const std.Target,
    host_target: *const std.Target,
) Step.ExtendedMakeError {
    const step = maker.stepByIndex(step_index);
    switch (conf_run.flags.stdio) {
        .check, .zig_test => {
            if (conf_run.flags.skip_foreign_checks) return error.MakeSkipped;

            const host_name = try host_target.zigTriple(arena);
            const foreign_name = try artifact_target.zigTriple(arena);

            return step.fail(maker,
                \\unable to spawn foreign binary '{s}' ({s}) on host system ({s})
                \\  consider using {s} or enabling skip_foreign_checks in the Run step
            , .{ argv0, foreign_name, host_name, suggested_flag });
        },
        else => {
            return step.fail(maker, "unable to spawn foreign binary '{s}'", .{argv0});
        },
    }
}