You are not logged in.

#1 2015-10-15 19:21:14

karkhaz
Member
Registered: 2014-01-25
Posts: 79

[SOLVED] How to fix circular dependencies when building all packages?

Hi, I'm trying to build all Arch Linux packages in the official repository from source using makepkg.

Some of the PKGBUILDs have circular makedepends. For example, systemd -> cryptsetup -> util-linux -> systemd.

If I were just building one of these packages (e.g. systemd), this wouldn't be a problem, as I would just install the binaries of cryptsetup and util-linux and then proceed to build systemd. (i.e. use makepkg -s).

However, supposing that I want to build the whole system from source, one makepkg at a time. How do I resolve such circular dependencies in general? I'm wondering how Arch devs do it.

Here's my current idea: cryptsetup is a library, so build everything that it depends on first, starting with a systemd binary to bootstrap. Then use the newly built cryptsetup to build systemd. Then use that new systemd to rebuild everything up to cryptsetup again.

In general, whenever I find a dependency between an_application -> a_library in a circular dependency chain, break that dependency, and use the binary package for an_application to bootstrap the build.

The reason why I'm asking instead of just trying it out is that I would need to manually work out what packages provide a library (just looking in the provides list for .so files isn't a good enough heuristic) and so I'm wondering if people have insights about this before I start smile

Last edited by karkhaz (2015-10-26 23:08:10)

Offline

#2 2015-10-15 19:51:13

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: [SOLVED] How to fix circular dependencies when building all packages?

I am not a developer of Archlinux so I am not entirely sure; but probably packages are just build on a whole working system. These packages belong to the base group. You are somehow obliged to proceed this way, because if you have nothing installed at all, you computer doesn't boot. Same for gcc, you need it to compile it. The process has been bootstrapped in the past probably using another distro and the first distro was bootstrapped back in the 90's using a proprietary Unix system and the first Unix system or compiler (in '70s I believe) was written in assembly using something still more rudimentary which was probably written directly in binary maybe using punched cards (in the late '40s). I give you the general idea here... I do not mean to be very precise...

Offline

#3 2015-10-15 19:59:01

karkhaz
Member
Registered: 2014-01-25
Posts: 79

Re: [SOLVED] How to fix circular dependencies when building all packages?

olive wrote:

I am not a developer of Archlinux so I am not entirely sure; but probably packages are just build on a whole working system. These packages belong to the base group.

Well, one would need both base and base-devel. I've just noticed that cryptsetup is in base, so maybe that strategy is helpful: start off with just the binary packages from base and base-devel to bootstrap everything else, and also to bootstrap all other packages in base and base-devel. I'll try this out and see if this solves all the circular dependencies, thanks!

Offline

#4 2015-10-15 20:32:40

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: [SOLVED] How to fix circular dependencies when building all packages?

Some PKGBUILDS contain infos about the build order, like glibc.
Here are some scripts and links you might want to have a look at:
https://projects.archlinux.org/dbscript … ackages.py (run by https://projects.archlinux.org/dbscript … rity-check (output))
'arch-nspawn', 'mkarchroot', 'lddd' and others from https://projects.archlinux.org/devtools.git/tree/ (package available)
https://wiki.archlinux.org/index.php/DeveloperWiki


1000

Offline

#5 2015-10-26 23:07:28

karkhaz
Member
Registered: 2014-01-25
Posts: 79

Re: [SOLVED] How to fix circular dependencies when building all packages?

byte: thanks for these resources, sorry for the late reply!

I did see the information in the glibc PKGBUILD, but was hoping for something more machine-readable. The output from check_packages.py was what I was looking for.

Actually, it doesn't describe circular makedepends: for example, note that extra/python-setuptools and extra/python-packaging depend on each other to build. But it's easy to modify.

My current strategy shall be: start out with the binaries for base and base-devel to bootstrap the build process, and build everything else based off of those packages. If I find a circular depends or makedepends like the python-setuptools above, then just grab a binary of python-setuptools, use it to build the other package, then use the build of the second package to build the first.

Marking as solved, thanks!

Offline

Board footer

Powered by FluxBB