New build system in Ziglings

Through the separation of the maker process from the configurer process in the build system (see: PR: 35428), we needed to recreate the Ziglings build process too. That led to a new character in Ziglings: Elrond the Wise from Rivendell. He now owns the entire Ziglings logic. This means, the Zig builder has one step, calling Elrond and passes all information and flags as cli arguments. And then Elrond decides what is to be done, which exercise is next, and so on, and calling the build system back.

I actually like it better than before, since the logic within the build system presented some very specific challenges that have now been eliminated. At first, I was a bit desperate (I admit), but then it clicked, and the rest fell into place as if by itself. And it’s also really fast!

Now I hope, everything works well and robust, and everyone continues to enjoy using Ziglings.

Thanks to Andrew and team, for creating such a nice programming language!

50 Likes

Does this new approach allow for build.zig exercises?

The high level overview seems to allow more flexibility than before so maybe Elrond can now also show us the path to building our projects!

5 Likes

Instead of doing direct Io in the build.zig to reset the progress, use a b.addUpdateSourceFiles step to overwrite the file (it does not support deleting).

Also, it irks me that you are using the presence of -Dreset, instead of it being true. Just use orelse false in its definition. This could probably be its own step tbh, instead of an option.

It occurred to me, that the exercises list could be separated into a zon file