Skip to content

C/C++ projects packaged for Zig

Technology

…are belong to us, but we'd be delighted to give them back!

We package C/C++ projects for the Zig build system so that you can reliably compile (and cross-compile!) them with ease.

This both provides convenience for users of the Zig compiler toolchain and also showcases to C/C++ project maintainers what a build.zig file for their project looks like.

As a general answer, we add a dependency on Zig to your project but in exchange we remove a dependency on:

More in general Zig removes all dependency on system-wide settings, while still leaving you the ability to opt-in when you need to.

If you're the maintainer of a project packaged by us and decide that you want to upgrade your build pipeline, then you are free to upstream everything you need from our repos.

If you decide to do so, please let us know by opening an Issue so that we can archive our repo and point people to your upstream. Feel also free to use our repos' Issues section to ask questions about how to integrate everything correctly in your project (say, maybe because we didn't implement a secondary build step for example).

One last thing to note: for us to be able to archive our repository, your integration of our build.zig must not add more system dependencies than our version. So, for example, if our packaged version is able to depend on zstd via allyourcodebase/zstd, then we kindly ask that you either keep depending on it (until its build.zig gets upstreamed) or take advantage of System Library Integration to give the user the choice.

That said, you're obviously welcome to upstream any build code as you see fit even if you don't plan to keep depending on other packages via the Zig build system. We'll still be happy to help you in this case, of course, but we'll also keep maintaining our downstream fork.

If you're a maintainer of the upstream project, (1) shows clearly that you will only need two files (build.zig, build.zig.zon) but it will be up to you to clean up all other build scripts and possibly improve our Zig build script as described above, while (2) will require you to be a bit more careful when upstreaming the work but everything will have been done for you more thoroughly (although you still have the option to just take the Zig build script files and manually review how to integrate them in your upstream project).

Ping kristoff and ask to be added to the organization.

Here are some ground rules to be able to contribute a repo:

Once you're done with the checklist above, please give your repo an appropriate set of tags for ease of discoverability (eg zig, zig-package).


Source: Hacker News — This article was automatically imported from the source. Read full article at original source →

HA
Originally published by Hacker News github.com
Visit original article

Gram Slattery

Leave a Comment