Zp - A source-based package manager written in Zig

Hello Zig community.

I want to share my project zp, a minimal source-based package manager written in Zig. It is inspired by CRUX, KISS Linux, and Void xbps-src. Instead of downloading prebuilt binaries, zp fetches the source tarball, automatically detects the build system (autotools, cmake, meson, make), compiles it, and installs it on the system. The package database is aggregated from three upstream sources: Void, CRUX, and KISS, with a strict priority order: void > crux > kiss.

Recently I added parallel downloads using std.Thread. Now when installing multiple packages at once, they are downloaded concurrently. The actual building and installation steps run sequentially and use mutexes to safely access shared resources like the package database and the staging directories. I also overhauled the error handling. All functions now return explicit error sets instead of relying on anyerror, which makes debugging much easier and provides clearer failure messages.

The project targets Zig 0.16 and uses the new std.Io API. It compiles to a single static binary with no runtime dependencies. It also tracks installed files to ensure clean uninstallation.

You can find the source code here: GitHub - nevvixsz/zp: A minimal, source-based package manager · GitHub

The project is still in active development, so I would appreciate any feedback or architectural suggestions.

P.S. If you liked the project, please star it on GitHub :slight_smile:

1 Like

A few weeks ago, I posted about my Zig project, zp (on reddit), and received an honest (and harsh) critique. Because of that, I spent some time improving it (and my friend also joined the development) to make it truly solid.

What has changed:

  • Implemented a modular structure: now each command resides in its own separate file.
  • Made commands readable: zp add, zp remove, zp sync, zp update, zp list, etc., instead of -i, -r, -u, -U, -l.
  • The remove command is now written in pure Zig. No more rm -rf and unsafe deletions.
  • Added proper autotools support.
  • Largely eliminated the numerous bash scripts from the codebase, though some remain in init.zig (we plan to implement our own parser for this soon).

GitHub: GitHub - understratum/zp: A minimal, source-based package manager · GitHub

Thank you to everyone who provided genuine, constructive feedback last time. It truly made the project better.

6 Likes

This looks like a pretty cool project. I think ill give it a try on my LFS partition.

Does your build tool support musl as the a libc option?