Skip to content

Commit 3cc3d03

Browse files
committed
build: use step options to init step
Step's Options introduced from the following PR ziglang/zig#14647 and more precisely this commit ziglang/zig@02381c0 Also, MakeFn now takes a std.Progress.Node introduces by ziglang/zig@0e07879
1 parent 4083bae commit 3cc3d03

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

build.zig

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,8 @@ pub fn build(b: *Builder) void {
609609
named_verify.dependOn(&verify_step.step);
610610

611611
const chain_verify = b.allocator.create(Step) catch unreachable;
612-
chain_verify.* = Step.initNoOp(.custom, b.fmt("chain {s}", .{key}), b.allocator);
612+
const step_options = Step.Options{ .id = .custom, .name = b.fmt("chain {s}", .{key}), .owner = b };
613+
chain_verify.* = Step.init(step_options);
613614
chain_verify.dependOn(&verify_step.step);
614615

615616
const named_chain = b.step(b.fmt("{s}_start", .{key}), b.fmt("Check all solutions starting at {s}", .{ex.main_file}));
@@ -635,16 +636,18 @@ const ZiglingStep = struct {
635636

636637
pub fn create(builder: *Builder, exercise: Exercise, use_healed: bool) *@This() {
637638
const self = builder.allocator.create(@This()) catch unreachable;
639+
const step_options = Step.Options{ .id = .custom, .name = exercise.main_file, .owner = builder, .makeFn = make };
638640
self.* = .{
639-
.step = Step.init(.custom, exercise.main_file, builder.allocator, make),
641+
.step = Step.init(step_options),
640642
.exercise = exercise,
641643
.builder = builder,
642644
.use_healed = use_healed,
643645
};
644646
return self;
645647
}
646648

647-
fn make(step: *Step) anyerror!void {
649+
fn make(step: *Step, prog_node: *std.Progress.Node) anyerror!void {
650+
_ = prog_node;
648651
const self = @fieldParentPtr(@This(), "step", step);
649652
self.makeInternal() catch {
650653
if (self.exercise.hint.len > 0) {

0 commit comments

Comments
 (0)