Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AUR] Unattended install script using --noconfirm fails due to: "Inner conflicts found" after wrong dependency detection? #1129

Open
GrabbenD opened this issue Feb 3, 2024 · 4 comments

Comments

@GrabbenD
Copy link

GrabbenD commented Feb 3, 2024

Affected Version

paru v2.0.1 - libalpm v13.0.2

Description

Edit: seems like the actual root of this problem is wrong dependency detection with AUR packages, see comment below

Paru fails to install aur/amdonly-gaming-mesa due to Inner conflicts found despite there not being any existing mesa packages in the system:

$ paru -Ss mesa | grep 'Installed'

These conflicts can be manually resolved by answering Y to all prompts.

As a result this breaks automated install scripts which relay on --noconfirm (as the default selection is N), e.g. when building a system in a chroot environment.

Output

$ paru --noconfirm --sync aur/amdonly-gaming-mesa
:: Resolving dependencies...
:: Calculating conflicts...
:: Calculating inner conflicts...

:: Conflicts found:
    amdonly-gaming-mesa: mesa (mesa-libgl)  mesa  mesa (mesa-libgl)  

:: Conflicting packages will have to be confirmed manually
error: can not install conflicting packages with --noconfirm

Config

/etc/paru.conf (default/untouched)

#
# $PARU_CONF
# /etc/paru.conf
# ~/.config/paru/paru.conf
#
# See the paru.conf(5) manpage for options

#
# GENERAL OPTIONS
#
[options]
PgpFetch
Devel
Provides
DevelSuffixes = -git -cvs -svn -bzr -darcs -always -hg -fossil
#AurOnly
#BottomUp
#RemoveMake
#SudoLoop
#UseAsk
#SaveChanges
#CombinedUpgrade
#CleanAfter
#UpgradeMenu
#NewsOnUpgrade

#LocalRepo
#Chroot
#Sign
#SignDb
#KeepRepoCache

#
# Binary OPTIONS
#
#[bin]
#FileManager = vifm
#MFlags = --skippgpcheck
#Sudo = doas

/etc/pacman.conf (CachyOS repos)

#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir     = /
#DBPath      = /var/lib/pacman/
#CacheDir    = /var/cache/pacman/pkg/
#LogFile     = /var/log/pacman.log
#GPGDir      = /etc/pacman.d/gnupg/
#HookDir     = /etc/pacman.d/hooks/
HoldPkg     = pacman glibc
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
#UseDelta    = 0.7
Architecture = x86_64 x86_64_v3

# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg   =
#IgnoreGroup =

#NoUpgrade   =
#NoExtract   =

# Misc options
#UseSyslog
Color
ILoveCandy
#NoProgressBar
#CheckSpace
VerbosePkgLists
DisableDownloadTimeout
ParallelDownloads = 10

# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel    = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required

# Main (CachyOS)

#[cachyos-testing-v3]
#Include = /etc/pacman.d/mirrorlist
[cachyos-v3]
Include = /etc/pacman.d/cachyos-v3-mirrorlist
[cachyos-core-v3]
Include = /etc/pacman.d/cachyos-v3-mirrorlist
[cachyos-extra-v3]
Include = /etc/pacman.d/cachyos-v3-mirrorlist
[cachyos-community-v3]
Include = /etc/pacman.d/cachyos-v3-mirrorlist
[cachyos]
Include = /etc/pacman.d/cachyos-mirrorlist

# Fallback (Arch Linux)

#[testing]
#Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
#[community-testing]
#Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist

# Wine
#[multilib-testing]
#Include = /etc/pacman.d/mirrorlist
[multilib]
Include = /etc/pacman.d/mirrorlist

@GrabbenD
Copy link
Author

GrabbenD commented Feb 3, 2024

Edit: I had to dig further to find the real reason, see comment below

This issue can also be reproduced with aur/mesa-git in a clean pacstrapped chroot:

$ paru --query --info mesa
error: package 'mesa' was not found

$ paru --noconfirm --sync aur/mesa-git
:: Resolving dependencies...
:: Calculating conflicts...
:: Calculating inner conflicts...

:: Conflicts found:
    mesa-git: mesa (mesa-libgl)  mesa  mesa (mesa-libgl)  

:: Conflicting packages will have to be confirmed manually
error: can not install conflicting packages with --noconfirm

Once the package assembly is done, it will ask us to remove mesa despite it not being present before installing aur/mesa-git:

==> Finished making: mesa-git 24.1.0_devel.184174.8368a972943.d41d8cd-1 (Sat 03 Feb 2024 09:00:46 PM CET)
==> Cleaning up...
loading packages...
resolving dependencies...
looking for conflicting packages...
:: mesa-git and mesa are in conflict. Remove mesa? [y/N] 

Looks like the culprit is that Paru fails to realize that mesa-libgl is provided by aur/mesa-git

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=mesa-git

provides=('mesa' 'vulkan-intel' 'vulkan-radeon' 'vulkan-mesa-layers' 'libva-mesa-driver' 'mesa-vdpau' 'vulkan-swrast' 'vulkan-driver' 'mesa-libgl' 'opengl-driver')

As seen here, Paru thinks the regular mesa package is needed for mesa-libgl which is wrong:

$ paru --sync --search mesa-libgl
extra/mesa 1:23.3.5-1 [17.88 MiB 93.44 MiB]
    An open-source implementation of the OpenGL specification

@GrabbenD GrabbenD changed the title Inconsistency between Paru & Yay: "Inner conflicts found" "Inner conflicts found" when there's multiple repositories/providers for a package Feb 3, 2024
@GrabbenD GrabbenD changed the title "Inner conflicts found" when there's multiple repositories/providers for a package Unattended install script with --noconfirm fails due to: "Inner conflicts found" Feb 3, 2024
@GrabbenD GrabbenD changed the title Unattended install script with --noconfirm fails due to: "Inner conflicts found" [AUR] Unattended install script using --noconfirm fails due to: "Inner conflicts found" after wrong dependency detection? Feb 3, 2024
@GrabbenD
Copy link
Author

GrabbenD commented Feb 3, 2024

Turns out this issue is deeper after all

When you try to build aur/mesa-git you can clearly tell it's pulling in extra/mesa:

$ paru --query --info mesa
error: package 'mesa' was not found

$ paru --sync aur/mesa-git
:: Inner conflicts found:
    mesa: mesa-git (mesa)  mesa-git (mesa-libgl)  
    mesa-git: mesa (mesa-libgl)  

:: Conflicting packages will have to be confirmed manually

Repo (41)                       Old Version  New Version                                Make Only
(...)
extra/mesa                                   1:23.3.5-1                                 No
(...)

Once that's pulled in we can investigate the root cause:

$ pactree -r mesa
mesa
└─libglvnd
  ├─libva
  └─mesa

$ pactree -r libglvnd
libglvnd
├─libva
└─mesa
  └─libglvnd

$ paru --query --info mesa | grep 'Required'
Required By     : libglvnd

libglvnd is responsible for:

:: mesa-git and mesa are in conflict. Remove mesa? [y/N] 

This can also be confirmed with:

$ paru --sync libglvnd
resolving dependencies...
looking for conflicting packages...
warning: dependency cycle detected:
warning: mesa will be installed before its libglvnd dependency

Reported here: https://aur.archlinux.org/packages/mesa-git#comment-954811
And here: https://gitlab.archlinux.org/archlinux/packaging/packages/libglvnd/-/issues/2


This would be a killer-feature if Paru could detect such loops ahead of time

(Meaning if Paru had the ability to warn the user about libglvnd causing extra/mesa to be wrongfully included as a dependency as it conflicts with the target package, aur/mesa-git. The original Conflicts found sent me into a massive rabbit-hole since it wasn't clear what was going wrong. Only after hours of troubleshooting was I able to solve this dependency cycle).

@silikeite
Copy link

Having the same issue but with aur/fcitx5-mozc-ut's dependency on aur/mozc-ut, where paru insists on installing aur/mozc instead.

@GrabbenD
Copy link
Author

GrabbenD commented Apr 19, 2024

Package maintainers believe it's package manager's duty to fix this loop: libglvnd/-/issues/2

Workaround

Hack 1

This is just useful for CI/CD.

Manually avoid child dependency libglvnd (of target/parent package aur/mesa-git) from installing the cirkular dependency (extra/mesa):

$ paru --sync --noconfirm --needed --assume-installed mesa,opengl-driver --asdeps libglvnd
$ paru --sync --noconfirm --needed aur/mesa-git

Hack 2

This allows CI/CD to automatically bypass build blocker (from --noconfirm) but you'll waste computational/disk resources on unneeded dependencies and possibly agree to wrong actions.

Unattendedly skip all prompts:

$ yes | paru --sync --needed aur/mesa-git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants