ZON support merged

  1. I’d like to replace my makeshift build.zig.zon parser with the new zon support.

What’s the suitable type for this?

The PR indicates this should be possible:

const zon = @import("build.zig.zon");

which yields error: '@import' of ZON must have a known result type

I got it to work without dependencies in the zon file, but what would the type be for the dependencies field?

const zon: struct {
    name: []const u8,
    version: []const u8,
    paths: []const []const u8,
    dependencies: ???
} = @import("build.zig.zon");

my initial attempts with tuples have failed. Suggestions welcome!

  1. When using @import(“my.zon”), I noticed is that changes to the zon file (one I have in src/) does not cause recompilation, so the cached result is used. Turning the zon file into a module fixes that - this is perhaps by design?
2 Likes