Using build.zig.zon to Report Your Zig Package Version at Runtime

How to embed build.zig.zon into your Zig build process, and make your package version accessible at runtime. Update: Thanks to Mason for letting me know , none of the below is necessary with current Zig master. On Zig master , you can now access @import("build.zig.zon").version directly! The below applies to the current 0.14.0 release of Zig only. How hard can it be for a program to print its own…