Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare for a new breaking change in Zig #276

Closed
perillo opened this issue May 3, 2023 · 7 comments
Closed

prepare for a new breaking change in Zig #276

perillo opened this issue May 3, 2023 · 7 comments

Comments

@perillo
Copy link
Contributor

perillo commented May 3, 2023

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
Copy link
Contributor Author

perillo commented May 3, 2023

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

@perillo perillo closed this as completed May 3, 2023
@chrboesch
Copy link
Collaborator

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?

@perillo
Copy link
Contributor Author

perillo commented May 3, 2023

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.

@chrboesch
Copy link
Collaborator

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.

@perillo perillo reopened this May 5, 2023
@perillo
Copy link
Contributor Author

perillo commented May 5, 2023

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).

@chrboesch
Copy link
Collaborator

chrboesch commented May 5, 2023

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

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: #278

@perillo
Copy link
Contributor Author

perillo commented May 5, 2023

I did not see your PR.

I solved the problem by watching all activity on ziglings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants