zig 0.17.0: b.args -> addPassthruArgs, std.meta.fields -> @typeInfo

Two breaking changes from the 0.17 release: Build.args removed from
configure phase (Run step passthru args), and std.meta.fields
deprecated in favor of @typeInfo (Enum now exposes field_names /
field_values arrays instead of StructField objects). Unit tests +
test_linear selftest pass under 0.17.0.

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta Code <noreply@letta.com>
This commit is contained in:
pierreandLetta Code committed 2026-11-01 19:09:16 +03:00
1 parent 5669c18b3e
commit d15d3880e4
2 files changed
+6 -3

No files matched your search

+1 -1
View File
@@ -36,7 +36,7 @@ pub fn build(b: *std.Build) void {
const run_example = b.addRunArtifact(example); const run_example = b.addRunArtifact(example);
run_example.step.dependOn(b.getInstallStep()); run_example.step.dependOn(b.getInstallStep());
if (b.args) |args| run_example.addArgs(args); run_example.addPassthruArgs();
const run_step = b.step("run", "Run the stripsolver example"); const run_step = b.step("run", "Run the stripsolver example");
run_step.dependOn(&run_example.step); run_step.dependOn(&run_example.step);
+5 -2
View File
@@ -217,8 +217,11 @@ pub fn run(
while (true) { while (true) {
const op_byte = try vm.readByte(); const op_byte = try vm.readByte();
const op: Op = inline for (std.meta.fields(Op)) |field| { const op: Op = inline for (
if (field.value == op_byte) break @field(Op, field.name); @typeInfo(Op).@"enum".field_names,
@typeInfo(Op).@"enum".field_values,
) |field_name, field_value| {
if (field_value == op_byte) break @field(Op, field_name);
} else return error.PickleBadOpcode; } else return error.PickleBadOpcode;
switch (op) { switch (op) {
.proto => _ = try vm.readByte(), .proto => _ = try vm.readByte(),