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

Incorrect «--resolve» for set of packages, like «libtool rpm-build» #2002

Open
belonesox opened this issue Oct 11, 2023 · 2 comments
Open

Comments

@belonesox
Copy link

Consider the case:

  • we need to download set of packages with dependencies
  • then install it from local repo
  • let it be just couple of packages → «libtool» «rpm-build»

I try:

  • «dnf download --downloaddir ./dir4rpms --resolve libtool rpm-build» (according «dnf download --alldeps --resolve» ignores conditional requires? #1998 --resolve without --alldeps should work)
  • creating offline repo with «baseurl=file://$PWD/dir4rpms»
  • installing from local offline repo «dnf install --disablerepo="*" --enablerepo="offline" libtool rpm-build» — failed.
Error:
 Problem: package redhat-rpm-config-262-1.fc39.noarch from offline requires (annobin-plugin-gcc if gcc), but none of the providers can be installed
  - package redhat-rpm-config-262-1.fc39.noarch from offline requires (gcc-plugin-annobin if gcc), but none of the providers can be installed
  - package rpm-build-4.19.0-1.fc39.x86_64 from offline requires system-rpm-config, but none of the providers can be installed
  - package libtool-2.4.7-7.fc39.x86_64 from offline requires gcc(major) = 13, but none of the providers can be installed

I checked it on FC37, FC38, FC39

Script to reproduce:
https://gist.github.com/belonesox/0ff847cb441b13f26c697ad0f07c7d03

#!/bin/sh
set +ex
rm -rf ./dir4rpms
toolbox rm -f test-fc39 -y || true
SETPACKAGES="libtool rpm-build"
#dnf-utils rpm-build
toolbox create test-fc39 --distro fedora --release 39 
toolbox run -c test-fc39 sudo dnf install createrepo -y
toolbox run -c test-fc39 sudo dnf download  --downloaddir ./dir4rpms --arch=x86_64  --arch=x86_64 --arch=noarch --resolve $SETPACKAGES -y

#Does not work either
#toolbox run -c test-fc39 sudo dnf download  --downloaddir ./dir4rpms --arch=x86_64  --arch=x86_64 --arch=noarch --resolve libtool --resolve rpm-build -y

toolbox run -c test-fc39 sudo createrepo ./dir4rpms
toolbox run -c test-fc39 sudo bash -c 'sudo echo -e "[offline]\nname=offline\nbaseurl=file://$PWD/dir4rpms/\nenabled=0\ngpgcheck=0\nrepo_gpgcheck=0\n" > /etc/yum.repos.d/offline.repo'
toolbox run -c test-fc39 sudo dnf install --refresh --nogpgcheck --disablerepo="*" --enablerepo="offline"  -y --allowerasing $SETPACKAGES

Is it bug or feature?
What I am doing wrong?

@m-blaha
Copy link
Member

m-blaha commented Oct 11, 2023

After some experiments, I think you do not do anything wrong, there are just some bugs (actually two of them) in the download command :)

Bug 1 (demonstrates in case the downgrade is part of the installation):
dnf download downloads only packages that are in transaction table marked as install and upgrade. In case the result of dnf install libtool is downgrade of some package, this package is not downloaded.
I hit this bug when trying reproduce your issue on old F38 image.

Bug 2 (the one you hit):
Packages from the downloaded set are processed independently, one by one. This means that the conditional requirement of (gcc-plugin-annobin if gcc) is not downloaded (because gcc is not present on the system and is not part of the transaction).

Thanks for the report, the issue is valid.

@m-blaha
Copy link
Member

m-blaha commented Oct 26, 2023

On the other hand, resolving downloaded packages independently enables us to download even conflicting packages. That means to resolve this issue we need to make selection of the algorithm configurable.

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

No branches or pull requests

3 participants