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

Support RPMTRANS_FLAG_DEPLOOPS #1271

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

opoplawski
Copy link
Contributor

I think this could be helpful for debugging some installer issues - e.g. https://bugzilla.redhat.com/show_bug.cgi?id=2244744

@ppisar
Copy link
Contributor

ppisar commented Feb 26, 2024

Does it help anything? According to rpm sources, it only changes logging the loops from a debug level to a warning level.

Copy link
Member

@pmatilai pmatilai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It helps diagnostics on packaging dependency loops, which are getting ever more popular.

For everybody's sanity, this should've been added to yum twenty years ago, but I think Python 2 had issues with the (1 << 31) enum value.

@j-mracek
Copy link
Contributor

Thank you Panu for your comment. I think we can add the support.

@pmatilai
Copy link
Member

pmatilai commented Feb 27, 2024

To elaborate: currently when somebody reports a bug that is an obvious (to me anyway) dependency loop situation, it's often reported against anaconda from where it then gets tossed to whatever random package is failing (which usually has nothing to do with it) and then after a few false tries it ends up on rpm for comments.
At which point I get to figure out how to reproduce it with dnf, then do 'dnf --installroot=/test --downloadonly ', followed by 'rpm -Uv --test --deploops $(find /test/var/cache/dnf -name "*.rpm")' to get the loop analysis from rpm.

With this two-liner patch, anaconda can enable it for all installs so instead of the above circus, folks can just inspect the anaconda log. And for dnf-reproducers, it's equally just an additional --setopts away.

@ppisar
Copy link
Contributor

ppisar commented Feb 27, 2024

I understand what it is good for. My question targets to DNF5: Does DNF5 display RPM warnings or is it rather librpm to print directly to stderr and mixing up, potentially in the middle of a word, with DNF5 output? Does DNF5 log RPM debug messages into DNF5 log? If it logs, then the user should find the strongly connected components debugging there already without this patch.

@j-mracek
Copy link
Contributor

j-mracek commented Feb 27, 2024

There is a similar patch for DNF4. I've approve it - rpm-software-management/dnf#2057.

@ppisar
Copy link
Contributor

ppisar commented Feb 27, 2024

Orion, does your patch prints anything related to SCC? I cannot reproduce it with:

~test/dnf5/redhat-linux-build/dnf5/dnf5 --use-host-config --setopt=tsflags=deploops --disablerepo=rawhide --enablerepo='fedora' --enablerepo='updates' --enablerepo=updates-testing --releasever=40 --installroot=/tmp/r install postfix

Instead I get an error:

>>> Stop pre-install scriptlet: ca-certificates-0:2023.2.62_v7.0.401-6.fc40.noarch
>>> Error in pre-install scriptlet: ca-certificates-0:2023.2.62_v7.0.401-6.fc40.noarch return code 2
>>> Running pre-install scriptlet: rpm-0:4.19.1.1-1.fc40.x86_64
>>> Stop pre-install scriptlet: rpm-0:4.19.1.1-1.fc40.x86_64
>>> Error in pre-install scriptlet: rpm-0:4.19.1.1-1.fc40.x86_64 return code 2

But that error does not depend --setopt=tsflags=deploops.

Were Fedora 40 repositories fixed in between?

@pmatilai
Copy link
Member

pmatilai commented Feb 27, 2024

Oh, right, forgot about dnf eating up rpm's output so it ends up in a log someplace. In that case dnf could just leave the flag always on, that'd be okay too.

@opoplawski
Copy link
Contributor Author

Honestly, this is completely untested. I figured though that is was at least the first step for trying to get the desired output.

@ppisar
Copy link
Contributor

ppisar commented Feb 27, 2024

The log is also missing the rpm log:

2024-02-27T16:02:06+0000 [21663] INFO RPM callback open file "/tmp/r/var/cache/libdnf5/fedora-6c3a9e5977a00788/packages/ca-certificates-2023.2.62_v7.0.401-6.fc40.noarch.rpm"
2024-02-27T16:02:07+0000 [21663] INFO RPM callback close file
2024-02-27T16:02:07+0000 [21663] ERROR [rpm] ca-certificates-2023.2.62_v7.0.401-6.fc40.noarch: install failed
2024-02-27T16:02:07+0000 [21663] INFO RPM callback open file "/tmp/r/var/cache/libdnf5/fedora-6c3a9e5977a00788/packages/rpm-4.19.1.1-1.fc40.x86_64.rpm"
2024-02-27T16:02:07+0000 [21663] INFO RPM callback close file
2024-02-27T16:02:07+0000 [21663] ERROR [rpm] rpm-4.19.1.1-1.fc40.x86_64: install failed

@opoplawski
Copy link
Contributor Author

2024-02-27T16:02:06+0000 [21663] INFO RPM callback open file "/tmp/r/var/cache/libdnf5/fedora-6c3a9e5977a00788/packages/ca-certificates-2023.2.62_v7.0.401-6.fc40.noarch.rpm"
2024-02-27T16:02:07+0000 [21663] INFO RPM callback close file
2024-02-27T16:02:07+0000 [21663] ERROR [rpm] ca-certificates-2023.2.62_v7.0.401-6.fc40.noarch: install failed
2024-02-27T16:02:07+0000 [21663] INFO RPM callback open file "/tmp/r/var/cache/libdnf5/fedora-6c3a9e5977a00788/packages/rpm-4.19.1.1-1.fc40.x86_64.rpm"
2024-02-27T16:02:07+0000 [21663] INFO RPM callback close file
2024-02-27T16:02:07+0000 [21663] ERROR [rpm] rpm-4.19.1.1-1.fc40.x86_64: install failed

This is exactly the error that this added option would hopefully help us debug. We would hope to see rpm output like:

Running transaction test
warning: SCC #1: 133 members (28 external dependencies)
warning:        alternatives-1.26-3.fc40.x86_64
warning:                -> glibc-2.39-2.fc40.x86_64
warning:        postfix-2:3.8.5-3.fc40.x86_64
warning:                => systemd-255.3-1.fc40.x86_64
warning:                -> policycoreutils-3.6-3.fc40.x86_64
warning:                -> cyrus-sasl-lib-2.1.28-19.fc40.x86_64
...
warning:        bzip2-libs-1.0.8-18.fc40.x86_64
warning:                -> glibc-2.39-2.fc40.x86_64
Transaction test succeeded.
Running transaction

Unfortunately it appears that dnf5 has become FTBFS in rawhide. I guess I'll try shifting to F40 itself.

@ppisar
Copy link
Contributor

ppisar commented Feb 29, 2024

Unfortunately it appears that dnf5 has become FTBFS in rawhide. I guess I'll try shifting to F40 itself.

F40 suffers from the same FTBFS triggered by swig 4.2.1. You need to apply upstream commit 2ee2bd9 if you work on Fedora sources.

@j-mracek
Copy link
Contributor

j-mracek commented Apr 9, 2024

I think that the patch is OK and can be merged to DNF5

@j-mracek j-mracek self-assigned this Apr 9, 2024
@j-mracek j-mracek added this pull request to the merge queue Apr 9, 2024
Merged via the queue into rpm-software-management:main with commit bee73b0 Apr 9, 2024
13 of 22 checks passed
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

Successfully merging this pull request may close these issues.

4 participants