aura icon indicating copy to clipboard operation
aura copied to clipboard

Dep resolution fails when binary packages have AUR dependencies

Open RubenKelevra opened this issue 1 year ago • 5 comments

I'm currently using Aura 4.0.0 on CachyOS. CachyOS includes some AUR packages, which they review and provide as binary packages in the default repositories. It's a bit like Chaotic-AUR, but on a smaller scale.

However, I'm having trouble with Aura when it comes to handling dependencies from the AUR. Specifically, if I try to install a package that depends on something in the AUR, Aura fails to find it.

For example, when I try to install the tribler package, which depends on python-libnacl, Aura can't resolve the dependency:

$ aura -Ss tribler
cachyos/tribler 7.14.0-1
    P2P/Bittorrent/YouTube client
aura -Syu tribler
[sudo] password for ruben: 
:: Synchronizing package databases...
 cachyos-v4 is up to date
 cachyos-core-v4 is up to date
 cachyos-extra-v4                                                                                                   2.2 MiB  2.26 MiB/s 00:01 [---------------------------------------------------------------------------------------] 100%
 cachyos                                                                                                          491.9 KiB   825 KiB/s 00:01 [---------------------------------------------------------------------------------------] 100%
 core is up to date
 extra                                                                                                              7.2 MiB  1506 KiB/s 00:05 [---------------------------------------------------------------------------------------] 100%
 multilib is up to date
:: Starting full system upgrade...
warning: aura-git: ignoring package upgrade (4.0.r0.geaac6297-1 => 4.0.0.rc2.r1.g8cb24082-1)
resolving dependencies...
warning: cannot resolve "python-libnacl", a dependency of "tribler"
:: The following package cannot be upgraded due to unresolvable dependencies:
      tribler

:: Do you want to skip the above package for this upgrade? [y/N] ^C
Interrupt signal received

aura :: A call to pacman gave a non-zero exit code.

But it does exist in the AUR:

$ aura -As libnacl
aur/python-libnacl 2.1.0-1 (0 | 0.00) 
    A simple ctypes based python binding to libsodium

But I can't install the dependency manually, because Aura doesn't support --asdeps: https://github.com/fosskers/aura/issues/870

RubenKelevra avatar Jul 31 '24 15:07 RubenKelevra

Since the package you're installing is technically "non-AUR" from the perspective of libalpm, AUR's dependency resolution wouldn't be involved at all. The output you're seeing here is entirely pacman's. Do packages in Cachy have AUR dependencies that it doesn't supply itself?

fosskers avatar Jul 31 '24 20:07 fosskers

Do packages in Cachy have AUR dependencies that it doesn't supply itself?

Yeah, that's entirely possible - same goes (I think) for the ChaoticAUR. The reason for this is that nobody checks for changing dependencies, so as long as they build fine they will be just updated and provided. Only if the build process itself fails, they'll have a look.

paru runs btw in the same issue. Not sure about yay - which is by default provided by CachyOS.

RubenKelevra avatar Aug 01 '24 18:08 RubenKelevra

Aura 4 actually builds a full dependency graph, even including non-AUR packages, but unfortunately it assumes that all repo packages are to be installed before any AUR ones, and does those as a single step in the beginning. It was never thought that repo/AUR installation steps would be interspersed. I will think about this.

fosskers avatar Aug 01 '24 21:08 fosskers

I mean just remove the differentiating between AUR and Repos, while creating the graph. While building try to find the packages first in the repos and if that fails query the AUR.

Then start at the tips of the branches and check each level for AUR packages, like so:

Layer 0:                R
                    /      \
Layer 1:           A         R
                 /   \     /   \
Layer 2:        R     A   A     R
               / \   / \ / \   / \
Layer 3:      R   A R   A R   R   A
             / \ / \/ \ / \/ \ / \ / \
Layer 4:    R  R A  A R  R R  A A  R  R
           /\/\/\/\/\/\/\/\/\/\/\/\/\/\
Layer 5:  R A A A R R A A R R R R R R A R

You go to Layer 5 of the tree and build+install the A(ur) packages, if there are none, the R(epo) packages are queued in a list.

Then you go to Layer 4 and check for A(ur) packages and if there are none, the repo packages are queued in a list etc. until you find a layer with the first Aur package.

In this case you install all repo packages from that layer, and all previously queued with --asdeps and then build and install all AUR packages from that layer.

Then you jump to the next layer. And so on.

RubenKelevra avatar Aug 02 '24 16:08 RubenKelevra

I stumbled across another package which has this issue now:

The package I'm maintaining, borg2, is in the Chaotic AUR due to its long build time. It now got a dependency for a python package with the key/value store they are using - but that's not in the Chaotic AUR.

Due to this limitation of Aura, installing Borg2 with version 2.0.0b12 would fail now for users if they use the Chaotic Aur.

RubenKelevra avatar Oct 19 '24 13:10 RubenKelevra