You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zig has an interesting approach to building software, is interoperable with C and C++.
Despite not being stabilized yet, it shows great capabilities in multiple areas where precise control of resources is desirable.
Adding a build.zig and a build.zig.zon file to this repo would allow all users to build (and test, maybe) this project with the zig binary.
It would automatically allow the project to be packaged as a Zig dependency that other projects can use in their build scripts.
Implementation Plan
The zig build artifacts can co-exist with the CMake/bazel build currently in place.
What we would do:
Add the build files in the repo root
(optional) Create a build directory if the build script gets too hairy
Add a GitHub workflow that builds the project with the latest released version of Zig
I don't know Zig myself but I'm not opposed to its addition to cpu_features as long as it's not too big. Also I can't commit to supporting it so that would be a community effort.
Would you mind creating a PR so I get a feel of it (doesn't need to be complete).
Side note, I'm not too fond of a build folder because CMake users usually create their project here so its likely to conflict.
Also I can't commit to supporting it so that would be a community effort.
I'd be happy to contribute this change myself, and maintain it if needed.
Zig releases happen on a semester/quarter basis so when those land, maintainers should update the Github action and the build.zig file accordingly.
I can create a draft PR to discuss.
+1 for not using build dir, since we already have a bazel/ and cmake/ top dir, would it be possible to have a zig/ top dir instead ?
Deal, although it's not going to be necessary to have an additional folder at all, only if the build script becomes too complex to have in just 1 file.
Let's say we can start with just 2 files, and if necessary, a top-level zig folder will contain the zig build harness.
Activity
gchatelet commentedon Oct 8, 2025
I don't know
Zigmyself but I'm not opposed to its addition tocpu_featuresas long as it's not too big. Also I can't commit to supporting it so that would be a community effort.Would you mind creating a PR so I get a feel of it (doesn't need to be complete).
Side note, I'm not too fond of a
buildfolder because CMake users usually create their project here so its likely to conflict.Mizux commentedon Oct 8, 2025
+1 for not using
builddir, since we already have abazel/andcmake/top dir, would it be possible to have azig/top dir instead ?inge4pres commentedon Oct 8, 2025
Thanks for your inputs 🙏🏼
I'd be happy to contribute this change myself, and maintain it if needed.
Zig releases happen on a semester/quarter basis so when those land, maintainers should update the Github action and the
build.zigfile accordingly.I can create a draft PR to discuss.
Deal, although it's not going to be necessary to have an additional folder at all, only if the build script becomes too complex to have in just 1 file.
Let's say we can start with just 2 files, and if necessary, a top-level
zigfolder will contain the zig build harness.inge4pres commentedon Oct 8, 2025
Linked PR provides ability to build with Zig 0.15.1.
inge4pres commentedon Oct 14, 2025
@Mizux @gchatelet thanks for the reviews 🙏🏼 the PR requires a new approval as I had pushed one more commit to address a comment after approval.
inge4pres commentedon Oct 14, 2025
Completed with:
opened: