autodist
autodist is the batch builder. It works by jobs, groups of one or more packages, and for each package it calls autospec in the various phases: prepare, update, build, install and send to the repository. It is used by hand, to work on a package or a group of packages with a single command, and above all in the automatic queue that keeps the distribution up to date.
Jobs
A job is a name grouping packages to be built together and in order, for
example qt6 for all the Qt 6 modules or kf6_frameworks for the KDE
Frameworks. A package that isn’t part of any job is a job by itself, with its
own name.
Jobs are defined in autodist.json, served by the distroquery API:
# which jobs a package belongs to
curl -s "https://api.openmamba.org/autodist/jobs?package=qt6-qtbase"
# details of a job
curl -s https://api.openmamba.org/autodist/jobs/webkitgtk
# the whole file
curl -s https://api.openmamba.org/autodistor from the command line:
$ autodist --list-jobs
$ autodist --list-pkgs qt6
$ autodist-jobs show qt6A job looks like this:
"qt6": {
"packages": ["qt6-qtbase", "qt6-qtsvg", "qt6-qtdeclarative"],
"build_and_install": true,
"continue_on_error": true,
"auto_job": true
}| Field | Meaning |
|---|---|
packages | The packages of the job, built in the given order |
build_and_install | Installs each package right after building it, so the following ones build against the new version |
continue_on_error | After an error goes on with the next package instead of stopping the job |
auto_job | When one of its packages has been updated, the automatic queue brings the whole job to the same version (only for jobs whose packages share the version) |
variants | Multiple builds of the same package, each with its own rpm macros (for example [{"with_apiver": "6.0"}, {"with_apiver": "4.1"}]) |
Other sections of autodist.json:
arch_jobs.<arch>: jobs replacing the one with the same name for an architecture;updates.legacy: legacy packages, which stay at an old version and are never updated automatically;updates.repology: packages or upstream versions to ignore (ignore,ignore_version, also with globs like"156.*");unstage.<arch>: packages autoport builds for that architecture without the staging settings.
In job names -, _, . and @ are equivalent: kde6_applications and
kde6-applications are the same job. Jobs are edited from the configuration
page of the development interface,
reserved to administrators.
Saying what to build
One or more jobs are given on the autodist command line:
| Form | Meaning |
|---|---|
glibc | The job (or package) glibc |
glibc#2.43 | The glibc job, brought to version 2.43 |
kde6_applications/okular | Only the okular package of the kde6_applications job |
kde6_applications/okular#26.08.3 | The same, at the given version |
Phases
Each operation option matches one or more autospec actions:
| Option | Phase | autospec | What it does |
|---|---|---|---|
-p | prepare | -a1 | Downloads the published source package from the repository: spec and sources |
-u | update | -a3:4 with the version from the job, or -a2:4 | Updates to the given version, or looks for a new version by itself |
-b | build | -a5:6 -b | Builds and updates the build dependencies |
-i | install | -a11 | Installs the packages on the system |
-s | send | -a10 | Sends the packages to the repository |
-a | autobuild | all | The automatic queue: -p -u -b -s with --severity 1 (see below) |
Options can be combined and phases always run in this order, job by job:
# download the published nasm spec
$ autodist -p nasm
# update nasm to 3.01, build it and send it to devel-makedist
$ autodist -p -u -b -s --server devel-makedist nasm#3.01
# rebuild a job, incrementing the release
$ autodist -p -u -b -r kf6_frameworks
# build the packages of a job, then install them
$ autodist -b -i qt6Useful options:
| Option | Effect |
|---|---|
-r, --rebuild | In the update phase only increments the release, without changing version |
--server <repository> | Destination repository for the send phase |
--repository <repository> | Repository the prepare phase downloads source packages from |
--severity 0|1|2 | What to do after an error: go on, skip the job (default), stop |
--force | Passes --force to autospec |
--arch <arch> | Builds for another architecture |
-t, --test | Shows what it would do, without running anything |
-c, --cleanlogs | Deletes the logs before starting |
-- <arguments> | Arguments passed as they are to autospec |
Logs
autodist records the outcome of every package, phase by phase, under log/
(/var/autodist/log on the build hosts, ~/.autodist/log for other users,
where the directories must already exist):
| File | Content |
|---|---|
autodist.log | The run in progress, or the last one: list of jobs and full output |
autodist-last.log | Summary of the last completed automatic queue |
<phase>/ok/<package>.<arch> | Log of the last successful phase, for example build/ok/nasm.x86_64 |
<phase>/failed/<package>.<arch> | Log of the last failed phase |
For packages inside a job the log name includes the job
(prepare/ok/qt6_qt6-qtbase.x86_64), for variants the variant
(plasma-workspace__1__1.x86_64). The failed/ directories also keep
failures from earlier queues: to know what failed in the last queue look at
autodist-last.log or at the dashboard of the web interface.
The logs of the build hosts can also be read from the autodistd API, without accessing the host:
curl -s "https://api.openmamba.org/autodistd/buildvm-x86_64/v1/packages/nasm/log?stage=build&run=failed"The automatic queue
With -a autodist builds the list of jobs to do by itself and runs them one
by one, with all the phases; on the build hosts autodistd starts it at
regular intervals, on the devel-autodist repository.
The queue includes, in this order:
- the scheduled jobs, set by hand with
autodist-tool scheduleor from the web interface, possibly with the version to reach; - the upstream updates: the packages for which the update sources
(Repology, Anitya, …) report a newer version, collected by
autodist-upstream-updates, plus those added by hand to themanual.inlist; - the
auto_jobjobs left behind one of their packages; - a few rebuilds of the packages built longest ago.
Left out are the packages in the blacklist (/etc/autodist/blacklist),
the legacy packages, those that failed in the last days
(AUTOBUILD_SKIP_DAYS) and those just built successfully
(AUTOBUILD_SUCCESS_DAYS). The maximum number of jobs per pass is
AUTOBUILD_MAXNUM.
For each job the queue runs prepare, update (with changelog entries like
“automatic update by autodist” or “automatic rebuild by autodist”), build and
send: successful packages go to devel-autodist, from which automaint
imports them into devel-makedist. An error skips the rest of the job, which
is retried after AUTOBUILD_SKIP_DAYS days or as soon as it is scheduled
again.
When configured, after each job an AI agent (autodist-agent) analyses the
new failures and tries to fix them; its outcomes show up in the queue
dashboard.
Some packages have sources that can’t be downloaded from a fixed URL (signed
links, CDNs): for these a <package>-autoupdate script goes in SOURCES/;
the queue runs it with the new version as argument before the update, and it
downloads the source with the name Source: expects.
Fixing a package in the queue
The specs of queued packages are downloaded and updated again at every pass,
so a change made by hand in SPECS/ would be lost. To keep it, save it as a
spec patch with autodist-tool makepatch, and the queue applies it
again at every pass:
$ autodist-tool makepatch nasm # show the package's patches
$ autodist-tool makepatch nasm auto # create or update the right patch
$ autodist-tool makepatch nasm remove # remove the patchesPatches come in two kinds, which can’t coexist:
- build: compares the spec with the one before the build and fixes
%build,%install,%filesand the like; the most common case; - update: compares the spec with the one before the update. The queue
applies it instead of the automatic update (
autospec -a3:4), so it must include the version change too.
auto picks the kind by itself, depending on which earlier state of the spec
is available. Patches live in
/var/autodist/devel-autodist/autoupdate/spec-patches-build/ and
spec-patches-update/, and can be seen from the editor of the web interface.
The typical flow:
Read the log
Find the failure in autodist-last.log or in the dashboard, and read the log
of the failed phase.
Check the existing patches
If the package already has a patch, update it instead of creating another one: it may already solve the problem, or conflict with your fix.
Fix the spec
Edit SPECS/<package>.spec without changing the release and without adding
changelog entries: the queue takes care of release and changelog.
Protect the fix or verify it
If you don’t need to verify it right away, save it with autodist-tool makepatch <package> auto and let the next pass build it. If instead you
build right away (autospec -u <package> -a5,6 -b --force-build) and the
build succeeds, send the package to devel-autodist and remove the patch
with makepatch <package> remove: the next pass wouldn’t rebuild a package
that already succeeded, and the patch would stay there interfering with
future updates.
autodist -b on a package while the automatic queue is working on
it: the two builds would use the same files in SPECS/, SOURCES/ and
BUILD/.Scheduling
autodist-tool also manages the queue schedule:
# schedule a job for the next pass, at the given version or as a rebuild
$ autodist-tool schedule qt6#6.12.1
$ autodist-tool schedule nasm
# scheduled jobs, and removing a job
$ autodist-tool schedule
$ autodist-tool unschedule nasm
# exclude a job from automatic builds
$ autodist-tool skip nasmThe schedule is kept by the distroquery API (/autodist/schedule): it is
public for reading, but changing it needs a token. A scheduled job is removed
from the list as soon as the queue has completed it.
A non-urgent change to a package, not worth a rebuild of its own, can be left as a planned change: a free-text note the agent applies to the spec at the next version update, before the build.
$ printf 'versions: 6.18.*\nDisable CONFIG_X86_VERBOSE_BOOTUP.\n' | \
autodist-tool plan kernel set
$ autodist-tool plan # list
$ autodist-tool plan kernel # show; also edit and removeThe first line versions: is optional and limits the versions the change
applies to.
Configuration
autodist reads /etc/autodist/config; the main values:
| Variable | Meaning |
|---|---|
AUTODIST_REPOSITORY | Repository the automatic queue works on (devel-autodist) |
AUTODIST_ARCHS | Supported architectures |
AUTOBUILD_MAXNUM | Maximum number of jobs in a pass |
AUTOBUILD_SKIP_DAYS | Days before retrying a failed job |
AUTOBUILD_SUCCESS_DAYS | Days during which a successful job doesn’t come back in the queue |
AUTODIST_REBUILDOLD_MAX | How many of the packages built longest ago to rebuild at every pass |
DISTROQUERY_API_URL | Address of the distroquery API |
Upload credentials and repository addresses are autospec’s (~/.autospec,
see RPM and autospec); during the update the script
/etc/autodist/scripts/update-specfile adapts some spec fields to the current
conventions.