[arch-general] Updating a (local) repository based on dependency changes

Maarten de Vries maarten at de-vri.es
Wed Feb 23 10:55:25 UTC 2022


On Wed, 23 Feb 2022 at 11:40, Knut Ahlers via arch-general <
arch-general at lists.archlinux.org> wrote:

> Hey there,
>
> Through the latest update in glibc an issue / question emerged for me
> and maybe someone on this list has some input for me how to solve
> this:
>
> We do have a repository with custom built packages (for example a
> custom version of ffmpeg we need for internal purposes)… These
> packages obviously do have dependencies on libraries and break when
> there is a change in a library. In this case: "version `GLIBC_2.34'
> not found".
>
> Is there anyone who solved this already? How is it solved in the
> Archlinux core / community repo?
>
> What is your trigger to rebuild packages and prevent running into some
> command not finding its dependencies? So how do you know when to
> rebuild [some binary package depending on glibc] without manually
> keeping track of the glibc version you've built the package against
> and then triggering the re-build when any of the underlying library
> changes its version?
>
> How does the Archlinux community/core/extra build system keep track of
> this and knows when to rebuild ffmpeg because glibc changed?
>
> Thanks in advance for any input!
>
> Cheers,
>   Knut
>
> --
> Knut Ahlers
> Software & Infrastructure Developer
>
> Web & Blog: https://ahlers.me/
> GPG-Key: 0xD215AD7D
>

Hey,

I'm not related to the Arch Linux project, but I manage a few custom
repositories with additional packages for internal use. I've solved the
problem you describe by mirroring the Arch Linux repositories, and building
the custom packages against that mirror.

Then, about once a week, I run a script which updates the mirror in a
staging location. The script checks the .BUILDINFO for all custom packages.
That gives the version number of dependencies that were installed when the
custom package was built. Those versions are checked against the versions
in the synced Arch Linux repositories. If any of the runtime dependencies
is updated, the package and all its reverse dependencies are flagged to be
rebuild. Then, all flagged packages are rebuild in dependency order in a
clean container (which is configured to use the staging repository).

When the build is done, the staging repository becomes the live mirror.
This is done by overwriting a symlink to make it atomic. I also use btrfs
snapshots to create a staging repository to avoid copying it every time for
a rebuild.

Note that this approach rebuilds more often than necessary. You could
further inspect library dependencies of ELF files if you want to reduce the
amount of rebuilds. However, I prefer to err on the safe side in case ABI
breakage happened without matching soname bump, at the cost of doing more
rebuilds than necessary.

Maybe you can take some inspiration from this :)

Kind regards,
Maarten de Vries


More information about the arch-general mailing list