Skip to content
autoport

autoport

autoport brings packages to the other architectures. A package is first updated and built on x86_64; autoport takes its already published source package and rebuilds it, on the build host of each architecture, for i586 and aarch64. The same tool is also used to rebuild the dependents of a library that changed ABI.

autoport uses autodist for the single phases and adds dependency handling: if a package lacks a build dependency not yet available for the architecture, it ports that first.

How a port works

For each package autoport runs:

  1. prepare: downloads the source package from the repository it works on (autodist -p);
  2. update, for rebuilds only: increments the release and adds the changelog entry (autodist -u -r);
  3. build and send: builds for the host architecture and sends (autodist -b -s --arch <arch>);
  4. install: installs the packages produced, so the following ones can build against them.

If the build fails because of missing dependencies, the packages providing them are added to the jobs and the round starts again: at every step autoport retries the failed jobs until they are all completed or a step brings nothing new.

Where the result goes depends on the kind of job:

  • plain port: the release doesn’t change, so autoport sends only the binary packages, to the same repository holding the source package;
  • rebuild (-u, -ud): the release goes up, and binary and source packages go to the repository given with -d.

Command line use

autoport [options] [-r repository] [-d repository] job ...
# port nasm, published in devel-makedist, to the architecture of this host
$ autoport -r devel-makedist nasm

# rebuild two packages, with incremented release and changelog
$ autoport -r devel-makedist -u "rebuilt with libbar 2.0" foo baz

# rebuild all the dependents of libbar that need it
$ autoport -r devel-autodist -ud libbar
OptionEffect
-r <repository>Repository to take source packages from (default base)
-d <repository>Repository to send rebuilds to (default the same as -r)
-u "<changelog>"Rebuilds the given jobs, incrementing the release, with this changelog entry
-udRebuilds the dependents of the given packages that need it
-bBatch mode: ports everything missing in the repository (see below)
-npDoesn’t download again the spec of command line jobs, if already present
-npaLike -np, for all jobs
-nrDoesn’t port missing dependencies
-fForces operations, also for packages already sent
-x <arch>Cross build for another architecture
-vMore verbose output

Rebuilding dependents

When a library changes soversion (libbar.so.1 → libbar.so.2), the packages using it must be rebuilt. The API lists them among the repository problems as “need to be rebuilt”:

curl -s https://api.openmamba.org/problems/devel-autodist

autoport -ud libbar reads from the API which dependents of libbar need a rebuild for the host architecture and rebuilds them all, adding to each one a build dependency on the new version (for example BuildRequires: libbar-devel >= 2.0-1mamba): this way porting to the other architectures uses the right library too. The changelog entry says which dependencies it was rebuilt with.

Before the rebuild the new library must be installed on the build host, alongside the old one until all the dependents have been rebuilt. On the build hosts autoport-upgrade-libraries does this by itself before every pass.

Batch mode

On the build hosts autoport runs in batch mode, started by autodistd at regular intervals (usually every hour). For each repository configured in the environment, autoport -b -r <repository>:

  1. updates the host system and installs the new libraries (autoport-upgrade-libraries);
  2. asks the API which packages of the repository are missing or behind for the host architecture;
  3. ports them all, with their dependencies, up to a maximum number of steps (AUTOPORT_MAX_STEPS);
  4. when configured, has the AI agent analyse the failures.

The current environments:

HostArchitectureRepositories
buildvm-x86_64x86_64devel-makedist, devel-kernel, devel-autodist
buildvm-i586i586devel-makedist, devel-kernel, devel-autodist, devel-misc
buildvm-aarch64aarch64devel-makedist, devel-kernel, devel-autodist, devel-misc

On x86_64 the porting environment builds packages uploaded without x86_64 binaries, for example from another architecture or as source only. The current list can be read from the autodistd API:

curl -s https://api.openmamba.org/autodistd/buildvm-i586/v1/environments

Environments are defined in /etc/autodist/autoport on the host, with the AUTOPORT_ARCH, AUTOPORT_REPOSITORIES, AUTOPORT_CHROOT, AUTOPORT_CROSS and similar arrays: an environment can build natively, in a chroot (autoport-chroot <chroot> opens a shell inside it) or as a cross build.

Staging

To bootstrap a new architecture from scratch, ports can be built in staging: with AUTOPORT_STAGEVARS="--define stage1=1" the specs that support it (%if "%{?stage1}" == "1", for example gcc) produce a reduced build, with fewer dependencies, to be rebuilt in full once the distribution for that architecture is complete. Packages in the unstage.<arch> list of autodist.json are always built without staging.

Following and fixing ports

The state of the ports is shown in the environment dashboard of the development interface, with the queue grouped by repository, or by the API:

# queue of the last pass, by repository
curl -s "https://api.openmamba.org/autodistd/buildvm-i586/v1/environments/0/queue?source=last"

# log of a failed port
curl -s "https://api.openmamba.org/autodistd/buildvm-i586/v1/packages/foo/log?stage=build&run=failed&arch=i586"

From the dashboard enabled developers can also:

  • Hold: keep a failed port off the queue until it is fixed or released;
  • Fork: move a package’s build out of the pass into a job of its own, to follow and fix it without blocking the others.

A failed port is fixed on the published source package, not with the autodist queue patches:

Download the source package

From the repository holding that version of the package:

$ autospec -u foo -a1 --server devel-makedist

Fix the spec without changing the release

The x86_64 package with the same release stays valid. If the fix is needed on one architecture only, put it in a conditional block:

%ifarch %{ix86}
%patch 1 -p1
%endif

Rebuild and upload only the source package

$ autospec -u foo -a5 --norpm --force
$ autospec -u foo -a10 --norpm --server devel-makedist

At the next pass autoport picks up the fixed source package.

Last updated on