ziglings icon indicating copy to clipboard operation
ziglings copied to clipboard

prepare for a new breaking change in Zig

Open perillo opened this issue 2 years ago • 7 comments

Today was merged commit ziglang/zig@13eb7251d.

This will break build.zig and test/tests.zig. I will write a fix, so that when the Github Actions fail I will push it.

perillo avatar May 03 '23 09:05 perillo

Never mind: the API change is isolated to `std.Build.

perillo avatar May 03 '23 09:05 perillo

BTW, I want to write an exercise about testing in Zig. That means I need a new flag run_test to activate a test step. Do you have an idea for realizing?

chrboesch avatar May 03 '23 13:05 chrboesch

BTW, I want to write an exercise about testing in Zig. That means I need a new flag run_test to activate a test step. Do you have an idea for realizing?

You can add a type:

pub const Kind = enum {
    exe,
    lib,
    obj,
    @"test",
};

This is defined in std.Build.CompileStep. lib obj are currently not necessary. Then you can add a new Exercise.kind field with default value set to .exe.

If it is not urgent, I can help writing the code in build.zig in a PR.

I suggest opening a new issue and creating a custom branch in github.com/ratfactor/ziglings if you decide to write the code yourself.

You can add a new ZiglingStep.run_test method, for running the zig test command.

perillo avatar May 03 '23 15:05 perillo

If it is not urgent

No, it's not.

can help writing the code in build.zig in a PR.

Sounds great.

I suggest opening a new issue and creating a custom branch

I will do that.

chrboesch avatar May 03 '23 16:05 chrboesch

In commit ziglang/zig@3f3b1a680, std.Build.XyzStep have been deprecated for `std.Build.Step.Xyz.

In future, this will be a real incompatible API change, but it will probably take a long time (see the still existing std.Build.Builder).

perillo avatar May 05 '23 07:05 perillo

Thanks for the information. Well, there is a lot of work in the future to keep Ziglings alive. :sweat_smile:

I can help writing the code in build.zig in a PR.

BTW, did you see my PR for expanding the build system? I did not want to link it here.

Update: Now you have reopened this issue, then I also can link the PR here: https://github.com/ratfactor/ziglings/pull/278

chrboesch avatar May 05 '23 09:05 chrboesch

I did not see your PR.

I solved the problem by watching all activity on ziglings.

perillo avatar May 05 '23 10:05 perillo