Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1947870

Summary: python3-libs uses Recommends for python3-tkinter(x86-64) and python3(x86-64)
Product: Red Hat Enterprise Linux 9 Reporter: Jan Pazdziora (Red Hat) <jpazdziora>
Component: python3.9Assignee: Python Maintainers <python-maint>
Status: CLOSED WONTFIX QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: jpazdziora, pviktori, pzatko, torsava, zveleba
Target Milestone: betaFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-21 12:36:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Pazdziora (Red Hat) 2021-04-09 12:53:03 UTC
Description of problem:

RHEL 9 Content Structure and Guidelines state that weak dependencies in BaseOS are allowed, but discouraged.

By using the Recommends weak dependencies especially for packages in @core group (Minimal host installation) or their direct dependencies, the recommended package gets pulled into the installed package set depending on the current configuration of the dnf transaction.

The python3-libs package Recommends (python3-tkinter(x86-64) = 3.9.2-1.el9 if tk(x86-64)) and python3(x86-64) = 3.9.2-1.el9.

If those are needed by python3-libs for correct operation (the first one when tk is also installed), Requires should be used.

If they are essential in minimal host installations (or minimal host installations with tk), they should be listed in the @core group in the comps file, not pulled in as a weak side-effect of having python3-libs in @core.

If they are listed primarily for convenience, Suggests might be better option. Or just drop the weak dependency completely.

Note: the python3-libs itself gets installed in minimal host installation (@core) via dnf and python3-dnf and python3 dependency.

Version-Release number of selected component (if applicable):

python3-libs-3.9.2-1.el9.x86_64

How reproducible:

Deterministic.

Steps to Reproduce:
1. rpm -q --recommends python3-libs

Actual results:

(python3-tkinter(x86-64) = 3.9.2-1.el9 if tk(x86-64))
python3(x86-64) = 3.9.2-1.el9

Expected results:

No output.

Additional info:

Comment 2 Petr Viktorin (pviktori) 2021-04-09 13:01:41 UTC
I don't think this is much of an issue, unless tk (and the graphical stack it requires) is also in minimal systems.

Comment 3 Petr Viktorin (pviktori) 2021-04-09 13:04:16 UTC
(that comment was for tkinter; as for the other dependency, python3 is already in @core)

Comment 4 Petr Viktorin (pviktori) 2021-04-09 13:15:04 UTC
This issue does bring up the question of why we have the python3/python3-libs split anyway, and if it wouldn't be better to carve things differently.

For example, I could see moving /usr/bin/python3.9 into (what is now) -libs, on the grounds that `sys.executable` is generally assumed to be available.

Comment 5 Jan Pazdziora (Red Hat) 2021-04-09 16:36:43 UTC
For tkinter, I agree that having it as a rich dependency makes less of a problem of unexpected package slipping into some limited installation. Still, is there a reason to have this as a Recommends and not Requires?

Comment 6 Miro Hrončok 2021-04-12 17:19:11 UTC
> Still, is there a reason to have this as a Recommends and not Requires?

Yes, the reason is that when it is Recommends, users (=admins in this context) of the system can uninstall it. When it is Requires, they generally cannot (unless they also remove tk or force rpm to do the removal despite broken deps).

Comment 7 Jan Pazdziora (Red Hat) 2021-04-12 20:09:42 UTC
The problem of the intended ability of uninstalling those Recommended packages (to minimize or harden installations) is that with current dnf implementation, they will be installed right back during the first update of the python3-libs package. That is, unless install_weak_deps=False is set, which however is not the configuration which is tested across the board.

Comment 8 Miro Hrončok 2021-04-12 20:56:50 UTC
IMHO Recommends with the funny behavior (i.e. bz1699672) is still better than Requires because it allow uninstalling.

I see two options:

Option 1 -- Requires: tkinter is always installed with Python and tk, if you don't want it, you have no options other than removing Python or tk.

Option 2 -- Recommends: tkinter is installed with Python and tk unless you opt-out. If you don't want it, you have options: You can exclude tkinter, you can uninstall tkinter, you can set install_weak_deps=False. Does it creeps back on every upgrade of Python? Yes. But you can still exclude it, uninstall it or use install_weak_deps=False. Worst case scenario? Tou have tkinter installed even if you don't want to, which is no worse than option 1 (because it is option 1, with available revert mechanism).


As a side note, many environments don't even bother with `yum update` because they are created, used and thrown away (e.g. containers), however I realize this is most likely moot because containers won't usually have tk installed.

Comment 9 Petr Viktorin (pviktori) 2021-04-21 12:36:01 UTC
Recommends: (python3-tkinter(x86-64) = 3.9.2-1.el9 if tk(x86-64))

IMO, The rich dependency here is OK. It does not affect minimal systems.


Recommends: python3(x86-64) = 3.9.2-1.el9.

The python3 / python3-libs split is weird, due to some historical reasons. In practice, you'll always have both installed (or none of them).
We will revisit this in Fedora, but I don't think it's wise to rock the boat in RHEL 9 at this point.

Comment 10 Tomas Orsava 2021-04-21 16:45:57 UTC
> Recommends: python3(x86-64) = 3.9.2-1.el9.
> 
> The python3 / python3-libs split is weird, due to some historical reasons.
> In practice, you'll always have both installed (or none of them).
> We will revisit this in Fedora, but I don't think it's wise to rock the boat
> in RHEL 9 at this point.

Indeed. To clarify, this will also not affect minimal systems. If the minimal system uses microdnf, python3-libs will not be installed (and thus won't pull in python3 on update). And if the minimal system still has dnf, both python3 and python3-libs will already be installed.

Comment 11 Miro Hrončok 2022-06-06 08:32:54 UTC
*** Bug 2093821 has been marked as a duplicate of this bug. ***

Comment 12 Miro Hrončok 2023-01-19 16:04:10 UTC
*** Bug 2162261 has been marked as a duplicate of this bug. ***