Creating distro build tooling for a small community
Key points
Chimera Linux's founder has published a long post, dated 7 October 2026, explaining why the project builds everything with its own tool, cbuild: the principles behind it, how it grew out of experience with Void Linux's xbps-src, why Chimera moved to apk, and how the build infrastructure works.
Design principles
- Chimera is a small project that serves its community, so maintenance cost has to stay low and the barrier to packaging is meant to be low: every user can be a packager.
- One tool does everything: the repository, the build environment, repository generation and signing, parts of the version-control handling and routine maintenance. There are no external helpers.
- Most packaging mistakes are hard errors. Builds are heavily sandboxed, the build environment is kept consistent, unit tests run by default, and formatting, dependencies and metadata (down to dependency ordering and the SPDX licence expression) are checked automatically.
cbuildruns on any Linux system. It is a developer tool for work that gets shared upstream, with no guarantees for local-only use.- The project's whole remote infrastructure can be reproduced locally in about an hour, and most of it in about five minutes.
A first package, as shown in the post
git clone https://github.com/my-user/cports
cd cports
./cbuild keygen
./cbuild bootstrap
./cbuild pkg user/my-cool-program
git checkout -b my-cool-program
./cbuild commit user/my-cool-program
git push origin my-cool-programUpdating a package and building in bulk
./cbuild bump-pkgver user/my-program 4.20.69
./cbuild prepare-upgrade user/my-program
./cbuild pkg user/my-program
./cbuild commit user/my-program
./cbuild update-check main/firefox
./cbuild bulk-pkg git:origin/master..HEAD
./cbuild bulk-pkg status:outdated- Other maintenance commands prune the local repository, bump versions and revisions, inspect dependency graphs, update sha256 checksums and check whether the local repository can be unstaged against the remote one.
What the author found lacking in xbps-src
- The author maintained Void's ppc64le port downstream from about 2018 to 2023, became an upstream Void maintainer, started Chimera in 2021 and left the Void team in 2023.
- The shell-based system was slow: parsing every template could take up to half an hour.
- It was permissive: network access during the whole build, a read-write build container with nothing guaranteeing its state afterwards, and few lints on the resulting packages.
- Useful tooling and extra lints live separately in
xtoolsand are not mandatory. - Templates often rely on in-place
sedcalls instead of patches, and patches are applied fuzzily. - The builders do not run each package's test suite (only pull-request CI does), and every architecture other than x86_64 and i686 is cross-compiled.
- Staging covers only shared-library SONAME changes, and removing obsolete packages was done by hand.
How cbuild answers that
- It began as a ground-up rewrite of
xbps-srcin Python; templates are Python scripts too. - Speed: several thousand templates are parsed and their metadata dumped in under a second.
- Strictness: no network from the configure step on, write access only to the build directory (and the destination directory during install), sandboxing with namespaces through Bubblewrap.
- Portability: the only dependencies are Python without external modules, Bubblewrap, Git and the package manager binary.
- Everything is signed as it is built; unsigned packages are not allowed.
- Chimera started on ppc64le only, and further targets were added later.
Why apk replaced xbps
- FreeBSD's
pkgwas the original idea, but was not ready for this use and its upstream advised choosing something else. apkhas a real dependency solver, so fewer workarounds are needed from packagers.- Shared libraries and commands are virtual packages (
so:libfoo.so.1=1,cmd:foo) that can be searched and installed by name, with no central SONAME mapping file. apkhas real triggers that run once at the end of a transaction;xbps-srcemulates them with per-package scripts that run repeatedly, in the middle of it.
Build infrastructure
- The orchestrator is Buildbot, under one rule: what the packager runs is exactly what the remote build machine runs.
- A webhook reports that
cportschanged, without saying what. Each worker (one per architecture) pulls the tree, runs./cbuild bootstrap-update, lists the work with./cbuild bulk-print-ver status:unbuilt, builds each entry into a staging area and then tries to unstage. - Unstaging fails if a provider was removed while something still depends on it, so reverse dependencies are always rebuilt before anything is published.
- The repository is then pruned and synced to the primary mirror: new packages first, then the indexes, then deletion of old packages.
- Listing and building can be done locally with one command:
./cbuild bulk-pkg status:unbuilt- Builders: x86_64 (16-core EPYC root server at Netcup), aarch64 (80-core Ampere Altra), ppc64le (18-core/72-thread POWER9) and loongarch64 (Loongson 3A6000), all running Chimera; riscv64 is a 64-core Milk-V Pioneer provided by Zach van Rijn of Adélie Linux, running Fedora.
- The builders are not exposed to the Internet; the orchestrator and the primary repository each sit on their own machine, and each architecture has its own signing key.
Summary by DistroNews, based on the original post.
A lot of people have been commenting on this over time so I figured I would put together a little post summarizing my thoughts on the matter and everything else. The post is going to be quite large. Every section can be read more or less separately, but they are all connected to each other. Catering to the community Chimera is a small project. It exists primarily to serve its community and not any external entity. Making sure the maintenance cost is as low as possible is crucial. Chimera and its tooling are designed to automate away most of the boring stuff and make sure the packager’s job is pleasant and not bothersome. In a way, we aim to empower every user to be a packager. The barrier of entry is meant to be very low. Some things that implies (I will try really hard to make this reasonable to follow, unfortunately the years have left their mark and I might be taking some assumptions for granted, so please bear with me; this also applies in the later sections): Everyone uses the same tools. Inefficient UX patterns are identified, and either fixed, or cbuild is extended to mitigate them. Feedback is taken into account. Everything is cbuild. One tool does everything, in a streamlined way. Managing the repository, the build environment, the repo generation and signing, even parts of the VCS handling and common maintenance tasks. No external helper stuff. The remote build infrastructure just runs cbuild and not much else. The tooling does much of the bulk of making sure your packaging is correct and clean, most issues are hard errors. Heavy sandboxing, build environment consistency, unit tests by default, etc. You can run it on any Linux. If you run it on Chimera, you can immediately test your work. You can take the repo and bring it somewhere else. That also means the builder machines in the remote infra can run anything. Chimera is a collective effort. You can expected to share the stuff you make, and get it upstreamed to us.
This is the opening of the story. The full text is on the original page.
Read the original at chimera-linux.org