Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is there a straightforward path to building Zig with polyglot build systems like Bazel and Buck2? I'm worried Zig's reliance on Turing complete build scripts will make building (and caching) such code difficult in those deterministic systems. In Rust, libraries that eschew build.rs are far preferable for this reason. Do Zig libraries typically have a lot of custom build setup?


For bazel:

https://github.com/aherrmann/rules_zig

Real world projects like ZML uses it:

https://github.com/zml/zml


FYI, build scripts are completely optional. Zig can build and run individual source code files regardless of build scripts (`build.zig`). You may need to decipher the build script to extract flags, but that's pretty much it. You can integrate Zig into any workflow that accepts GCC and Clang. (Note: `zig` is also a drop-in replacement C compiler[1])

[1]: https://andrewkelley.me/post/zig-cc-powerful-drop-in-replace...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: