#766 Advise/Prohibit not to use versioned Recommends (or any other weak deps)
Closed: rejected 5 years ago Opened 6 years ago by ignatenkobrain.

Today I observed non user-friendly behavior, I have updated sssd*, but didn't do update of libsss*. dnf autoremove suggested to remove all those packages because they were recommended. However, if I update libsss* packages as well, nothing would be removed.

This is due sssd-common having Recommends: libsss_sudo = 1.16.1-4.fc29.

My proposal is to add sentence like this into guidelines somewhere: Packagers SHOULD NOT put version in weak dependencies.


Recommends with version are just for sssd sub-packages which are build from the same SRPM.

There are also other recommends but without any version specified

sssd-ipa
Recommends: bind-utils

sssd-ad
Recommends: bind-utils
Recommends: adcli

But I would ask different question.

What would you recommend for optional sub-packages which should have the same EVR as other package from the same SRPM

Recommends with version are just for sssd sub-packages which are build from the same SRPM.

Yes, but since there is no strict dependency between them, if you update just sssd (without libsss), latter will become "autoremoved".

What would you recommend for optional sub-packages which should have the same EVR as other package from the same SRPM

Not to specify version in Recommends. If you know that it won't work with old/new/different version, then you should put Conflicts in-place (Conflicts: (libsss_sudo < %{?epoch:%{epoch}:}%{version}-%{release} with libsss_sudo > %{?epoch:%{epoch}:}%{version}-%{release})).

Hmm, I wonder why it is not reproducible on f27 (I did not test on rawhide because I have git master on my laptop)

[root@37658145dcd4 /]# dnf install -y sssd -e0 -d0 sssd
Failed to connect to bus: No such file or directory
[root@37658145dcd4 /]# rpm -qa sssd libsss_\*
libsss_sudo-1.16.1-3.fc27.x86_64
libsss_nss_idmap-1.16.1-3.fc27.x86_64
sssd-1.16.1-3.fc27.x86_64
libsss_autofs-1.16.1-3.fc27.x86_64
libsss_idmap-1.16.1-3.fc27.x86_64
libsss_certmap-1.16.1-3.fc27.x86_64

[root@37658145dcd4 /]# dnf update --enablerepo=updates-testing -y sssd -e1 -d1 sssd\*
Last metadata expiration check: 0:00:00 ago on Mon May  7 11:21:42 2018.
Dependencies resolved.
================================================================================
 Package                Arch       Version            Repository           Size
================================================================================
Upgrading:
 libipa_hbac            x86_64     1.16.1-4.fc27      updates-testing      86 k
 libsss_idmap           x86_64     1.16.1-4.fc27      updates-testing      91 k
 python3-sssdconfig     noarch     1.16.1-4.fc27      updates-testing     103 k
 sssd                   x86_64     1.16.1-4.fc27      updates-testing      78 k
 sssd-ad                x86_64     1.16.1-4.fc27      updates-testing     208 k
 sssd-client            x86_64     1.16.1-4.fc27      updates-testing     146 k
 sssd-common            x86_64     1.16.1-4.fc27      updates-testing     1.3 M
 sssd-common-pac        x86_64     1.16.1-4.fc27      updates-testing     150 k
 sssd-ipa               x86_64     1.16.1-4.fc27      updates-testing     299 k
 sssd-krb5              x86_64     1.16.1-4.fc27      updates-testing     119 k
 sssd-krb5-common       x86_64     1.16.1-4.fc27      updates-testing     156 k
 sssd-ldap              x86_64     1.16.1-4.fc27      updates-testing     171 k
 sssd-nfs-idmap         x86_64     1.16.1-4.fc27      updates-testing      84 k
 sssd-proxy             x86_64     1.16.1-4.fc27      updates-testing     114 k

Transaction Summary
================================================================================
Upgrade  14 Packages

Total download size: 3.1 M
Downloading Packages:
--------------------------------------------------------------------------------
Total                                           925 kB/s | 3.1 MB     00:03     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Failed to connect to bus: No such file or directory

Upgraded:
  libipa_hbac.x86_64 1.16.1-4.fc27         libsss_idmap.x86_64 1.16.1-4.fc27    
  python3-sssdconfig.noarch 1.16.1-4.fc27  sssd.x86_64 1.16.1-4.fc27            
  sssd-ad.x86_64 1.16.1-4.fc27             sssd-client.x86_64 1.16.1-4.fc27     
  sssd-common.x86_64 1.16.1-4.fc27         sssd-common-pac.x86_64 1.16.1-4.fc27 
  sssd-ipa.x86_64 1.16.1-4.fc27            sssd-krb5.x86_64 1.16.1-4.fc27       
  sssd-krb5-common.x86_64 1.16.1-4.fc27    sssd-ldap.x86_64 1.16.1-4.fc27       
  sssd-nfs-idmap.x86_64 1.16.1-4.fc27      sssd-proxy.x86_64 1.16.1-4.fc27      

Complete!
[root@37658145dcd4 /]# rpm -qa sssd libsss_\*
libsss_sudo-1.16.1-3.fc27.x86_64
libsss_idmap-1.16.1-4.fc27.x86_64
libsss_nss_idmap-1.16.1-3.fc27.x86_64
libsss_autofs-1.16.1-3.fc27.x86_64
sssd-1.16.1-4.fc27.x86_64
libsss_certmap-1.16.1-3.fc27.x86_64

[root@37658145dcd4 /]# rpm -q --recommends sssd-common
libsss_autofs(x86-64) = 1.16.1-4.fc27
libsss_sudo = 1.16.1-4.fc27
sssd-nfs-idmap = 1.16.1-4.fc27

@ignatenkobrain , maybe you found same bug in dependency solver

That is a bug of the behavior, not something we should advise against. I have a package X and I want to recommend package Y in a specific version. That is a legitimate use case.

because you upgraded whole system, try running dnf update sssd\* and then dnf autoremove

because you upgraded whole system, try running dnf update sssd* and then dnf autoremove

It was an initial update in container. But there is an separate update with updates testing dnf update --enablerepo=updates-testing -y sssd -e1 -d1 sssd\*

@lslebodn I don't see output of dnf autoremove.

@lslebodn I don't see output of dnf autoremove.

Yes, libsss_{sudo,autofs} would be removed.
But I wonder why these pacakges were not updated because there are also conflicts in these packages.

[root@40230bf63d6e /]# dnf update --enablerepo=updates-testing -y -e1 -d1 sssd\*
Last metadata expiration check: 0:00:00 ago on Mon May  7 11:48:04 2018.
Dependencies resolved.
================================================================================
 Package                Arch       Version            Repository           Size
================================================================================
Upgrading:
 libipa_hbac            x86_64     1.16.1-4.fc27      updates-testing      86 k
 libsss_idmap           x86_64     1.16.1-4.fc27      updates-testing      91 k
 python3-sssdconfig     noarch     1.16.1-4.fc27      updates-testing     103 k
 sssd                   x86_64     1.16.1-4.fc27      updates-testing      78 k
 sssd-ad                x86_64     1.16.1-4.fc27      updates-testing     208 k
 sssd-client            x86_64     1.16.1-4.fc27      updates-testing     146 k
 sssd-common            x86_64     1.16.1-4.fc27      updates-testing     1.3 M
 sssd-common-pac        x86_64     1.16.1-4.fc27      updates-testing     150 k
 sssd-ipa               x86_64     1.16.1-4.fc27      updates-testing     299 k
 sssd-krb5              x86_64     1.16.1-4.fc27      updates-testing     119 k
 sssd-krb5-common       x86_64     1.16.1-4.fc27      updates-testing     156 k
 sssd-ldap              x86_64     1.16.1-4.fc27      updates-testing     171 k
 sssd-nfs-idmap         x86_64     1.16.1-4.fc27      updates-testing      84 k
 sssd-proxy             x86_64     1.16.1-4.fc27      updates-testing     114 k

Transaction Summary
================================================================================
Upgrade  14 Packages

Total download size: 3.1 M
Downloading Packages:
--------------------------------------------------------------------------------
Total                                           4.7 MB/s | 3.1 MB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Failed to connect to bus: No such file or directory

Upgraded:
  libipa_hbac.x86_64 1.16.1-4.fc27         libsss_idmap.x86_64 1.16.1-4.fc27    
  python3-sssdconfig.noarch 1.16.1-4.fc27  sssd.x86_64 1.16.1-4.fc27            
  sssd-ad.x86_64 1.16.1-4.fc27             sssd-client.x86_64 1.16.1-4.fc27     
  sssd-common.x86_64 1.16.1-4.fc27         sssd-common-pac.x86_64 1.16.1-4.fc27 
  sssd-ipa.x86_64 1.16.1-4.fc27            sssd-krb5.x86_64 1.16.1-4.fc27       
  sssd-krb5-common.x86_64 1.16.1-4.fc27    sssd-ldap.x86_64 1.16.1-4.fc27       
  sssd-nfs-idmap.x86_64 1.16.1-4.fc27      sssd-proxy.x86_64 1.16.1-4.fc27      

Complete!

[root@40230bf63d6e /]# rpm -q sssd-common libsss_{autofs,sudo}
sssd-common-1.16.1-4.fc27.x86_64
libsss_autofs-1.16.1-3.fc27.x86_64
libsss_sudo-1.16.1-3.fc27.x86_64

[root@40230bf63d6e /]# rpm -q --recommends sssd-common
libsss_autofs(x86-64) = 1.16.1-4.fc27
libsss_sudo = 1.16.1-4.fc27
sssd-nfs-idmap = 1.16.1-4.fc27

[root@40230bf63d6e /]#  rpm -q --conflicts libsss_{autofs,sudo}
sssd-common < 1.16.1-3.fc27
sssd-common < 1.16.1-3.fc27

[root@40230bf63d6e /]# dnf autoremove -y
Last metadata expiration check: 0:05:15 ago on Mon May  7 11:43:51 2018.
Dependencies resolved.
================================================================================
 Package              Arch          Version               Repository       Size
================================================================================
Removing:
 libsss_autofs        x86_64        1.16.1-3.fc27         @updates         61 k
 libsss_sudo          x86_64        1.16.1-3.fc27         @updates         54 k

Transaction Summary
================================================================================
Remove  2 Packages

But I wonder why these pacakges were not updated because there are also conflicts in these packages.

There are conflicts for older version, but not newer. Look at example I proposed.

But I wonder why these pacakges were not updated because there are also conflicts in these packages.

There are conflicts for older version, but not newer. Look at example I proposed.

Sorry, I did not realized newer package. The only issue is that f27 has older version of rpm and with operator does not exist there (at least based on http://rpm.org/user_doc/boolean_dependencies.html)

Should packaging guidelines mention two separate conflicts or there should mention and instead of with

The only issue is that f27 has older version of rpm and with operator does not exist there (at least based on http://rpm.org/user_doc/boolean_dependencies.html).

No, the F27 version of RPM supports it. Moreover, it has been even backported to F26.

The only issue is that f27 has older version of rpm and with operator does not exist there (at least based on http://rpm.org/user_doc/boolean_dependencies.html).

No, the F27 version of RPM supports it. Moreover, it has been even backported to F26.

Nice.
then +1 for weak dependencies without version

We discussed this at this weeks meeting (http://meetbot.fedoraproject.org/fedora-meeting-1/2018-05-10/fpc.2018-05-10-16.00.txt):

Metadata Update from @james:
- Issue close_status updated to: rejected
- Issue status updated to: Closed (was: Open)

5 years ago

Login to comment on this ticket.

Metadata