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

fails to suggest removal of conflicting repo package, when because of upcoming sys-upgrade it becomes conflicting #861

Open
real-or-random opened this issue Dec 30, 2024 · 5 comments
Labels
bug Something isn't working help wanted

Comments

@real-or-random
Copy link

Pikaur v1.32
Pacman v7.0.0 - libalpm v15.0.0 - pyalpm v0.10.6
Description:

pikaur fails during sysupgrade due to unresolved dependencies (related to qemu).
pacman handles this properly and suggests removing the conflicting package.

Assuming that pikaur shold be a drop-in replacement for pacman, this is a bug.

Attached log:
❯ pikaur -Syu
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 multilib is up to date

🛴 Starting full AUR upgrade...
Reading repository package databases...
Reading local package database...
error: failed to prepare transaction (could not satisfy dependencies)
:: installing qemu-common (9.2.0-1) breaks dependency 'qemu-common=9.1.2-1' required by qemu-system-cris
Compare with plain pacman:
❯ sudo pacman -Syu
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 multilib is up to date
:: Starting full system upgrade...
warning: pacman-mirrorlist: ignoring package upgrade (20220724-1 => 20240717-1)
resolving dependencies...
looking for conflicting packages...
:: qemu-common-9.2.0-1 and qemu-system-cris-9.1.2-1 are in conflict. Remove qemu-system-cris? [y/N] 

@actionless
Copy link
Owner

yup, it looks like a bug, although given that it's quite hard to create an environment for reproducing it, i'm not feeling like debugging this one

@actionless actionless added bug Something isn't working help wanted labels Dec 30, 2024
@actionless
Copy link
Owner

if you or someone else wanna try, here's the main code related to that functionality:

def ask_about_package_conflicts(self) -> None:
if self.aur_packages_names or self.aur_deps_names:
print_stderr(translate("looking for conflicting AUR packages..."))
self.found_conflicts.update(
find_aur_conflicts(
self.install_info.aur_install_info,
self.install_package_names,
skip_checkdeps_for_pkgnames=self.skip_checkfunc_for_pkgnames,
),
)
if not self.found_conflicts:
return
all_new_packages_names = list(self.repo_packages_by_name.keys()) + self.aur_packages_names
for new_pkg_name, new_pkg_conflicts in self.found_conflicts.items():
for pkg_conflict in new_pkg_conflicts:
if pkg_conflict in all_new_packages_names:
print_stderr(color_line(
translate("New packages '{new}' and '{other}' are in conflict.").format(
new=new_pkg_name, other=pkg_conflict),
ColorsHighlight.red))
raise SysExit(131)
for new_pkg_name, new_pkg_conflicts in self.found_conflicts.items():
for pkg_conflict in new_pkg_conflicts:
question = translate(
"{new} and {installed} are in conflict. Remove {installed}?",
).format(
new=new_pkg_name, installed=pkg_conflict,
)
answer = ask_to_continue(
f"{color_line(DECORATION, ColorsHighlight.yellow)} {bold_line(question)}",
default_yes=False,
)
if not answer:
raise SysExit(131)
self.resolved_conflicts.append([new_pkg_name, pkg_conflict])

@actionless
Copy link
Owner

actionless commented Dec 30, 2024

also, the log you uploaded is not useful at all, as it's not following the described format in github template and therefore missing all the useful/required output, i'm just lazy setting up a bot to auto-close the issues which missing those details

@actionless actionless changed the title pikaur fails to suggest removal of conflicting package pikaur fails to suggest removal of conflicting package, if because of upgrade it becomes conflicting Dec 30, 2024
@actionless actionless changed the title pikaur fails to suggest removal of conflicting package, if because of upgrade it becomes conflicting pikaur fails to suggest removal of conflicting package, if because of upcoming sys-upgrade it becomes conflicting Dec 30, 2024
@actionless actionless changed the title pikaur fails to suggest removal of conflicting package, if because of upcoming sys-upgrade it becomes conflicting pikaur fails to suggest removal of conflicting package, when because of upcoming sys-upgrade it becomes conflicting Dec 30, 2024
@real-or-random
Copy link
Author

it's quite hard to create an environment for reproducing it

This should do the trick:

  • sudo pacman -S qemu-common
  • sudo downgrade qemu-common -- --nodeps --nodeps and downgrade to 9.1.2-1 (using downgrade from AUR) or just install 9.1.2-1 manually from the package archive
  • sudo pacman -S qemu-system-cris

also, the log you uploaded is not useful at all, as it's not following the described format in github template and therefore missing all the useful/required output

Sorry, here's a debug log (but I doubt it's useful):

❯ pikaur -Su --verbose --pikaur-debug
🛴 debug: main_1000: Setting stdout to utf-8...
🛴 debug: main_1000: already set - nothing to do
🛴 debug: main_1000: Setting stderr to utf-8...
🛴 debug: main_1000: already set - nothing to do
🛴 debug: main_1000: Pikaur operation found for args ['/usr/bin/pikaur', '-Su', '--verbose', '--pikaur-debug']: cli_install_packages
=> sudo --preserve-env=VISUAL,EDITOR -- /usr/bin/pikaur -Su --verbose --pikaur-debug --pikaur-config=/home/tim/.config/pikaur.conf --user-id=1000 --home-dir=/home/tim --xdg-cache-home=/home/tim/.cache --xdg-data-home=/home/tim/.local/share
🛴 debug: main_0: Setting stdout to utf-8...
🛴 debug: main_0: already set - nothing to do
🛴 debug: main_0: Setting stderr to utf-8...
🛴 debug: main_0: already set - nothing to do
🛴 debug: main_0: Pikaur operation found for args ['/usr/bin/pikaur', '-Su', '--verbose', '--pikaur-debug', '--pikaur-config=/home/tim/.config/pikaur.conf', '--user-id=1000', '--home-dir=/home/tim', '--xdg-cache-home=/home/tim/.cache', '--xdg-data-home=/home/tim/.local/share']: cli_install_packages
🛴 debug: news: init
🛴 debug: news: fetch_latest
=> GET https://archlinux.org/feeds/news/
🛴 Starting full AUR upgrade...
🛴 debug: install_info_fetcher: 
Gonna fetch install info for:
    install_package_names=[]
    not_found_repo_pkgs_names=[]
    pkgbuilds_packagelists={}
    manually_excluded_packages_names=[]
    skip_checkdeps_for_pkgnames=[]

Reading repository package databases...
Reading local package database...
🛴 debug: install_info_fetcher: Gonna get repo pkgs install info...
🛴 debug: pacman: Gonna get sysupgrade info...
=> pacman --color=always --sync --sysupgrade --print-format %r/%n
error: failed to prepare transaction (could not satisfy dependencies)
:: installing qemu-common (9.2.0-1) breaks dependency 'qemu-common=9.1.2-1' required by qemu-system-cris

🛴 debug: main_0: Restoring stdout...
🛴 debug: main_0: nothing to do
🛴 debug: main_0: Restoring stderr...
🛴 debug: main_0: nothing to do
🛴 debug: main_1000: Restoring stdout...
🛴 debug: main_1000: nothing to do
🛴 debug: main_1000: Restoring stderr...
🛴 debug: main_1000: nothing to do

@actionless
Copy link
Owner

here's a debug log (but I doubt it's useful):

it's actually useful enough to attempt to even blind-fix it as i now see which command causing it to fail

This should do the trick:

sorry for being unclear, i meant finding long-term reproducibility way for it, like here: https://github.com/actionless/pikaur/blob/master/pikaur_test/test_regressions.py

because the problem is reproducible only with the very certain versions of the packages - such testcase would stop working somewhere in half a year or sooner

with AUR packages it could be done quite easy via writing custom PKGBUILDs for testcases, but repo-related tests like this one would ideally require setting up a stub pacman repo inside test container

@actionless actionless changed the title pikaur fails to suggest removal of conflicting package, when because of upcoming sys-upgrade it becomes conflicting fails to suggest removal of conflicting repo package, when because of upcoming sys-upgrade it becomes conflicting Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted
Projects
None yet
Development

No branches or pull requests

2 participants