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

Narrow yggdrasil version requirements #11232

Merged

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Sep 11, 2024

yggdrasil 0.2 used gRPC where 0.4 uses D-Bus. foreman_ygg_worker is only compatible with yggdrasil over grpc and this narrows the requirement. This is important because yggdrasil 0.3 is in EPEL 8 & 9 and yggdrasil 0.4 is in CentOS Stream 9.

theforeman/foreman_ygg_worker#21 is adding D-Bus support.

@@ -43,7 +43,13 @@ BuildRequires: go
%else
BuildRequires: golang
%endif

# Use rich dependencies if available
%if 0%{?rhel} >= 8 || 0%{?fedora}
Copy link
Member

Choose a reason for hiding this comment

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

I think we could avoid the if-else and just lock it down? Since there is an inherent technology difference between the versions.

Copy link
Member Author

Choose a reason for hiding this comment

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

On EL7 rpm doesn't support rich dependencies and I don't think you can properly narrow it. The best you can do is add 2 Requires statements which rpm will evaluate separately.

@evgeni any thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, this. Or:

Requires: yggdrasil >= 0.2
Conflicts: yggdrasil >= 0.3

Which is technically more correct.

But I am fine with using rich deps and ignoring EL7 for those last breaths it still has (it won't get yggdrasil 0.3+ anyway, RIGHT?!).

Copy link
Member Author

Choose a reason for hiding this comment

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

I now added that in the else branch. I still think the rich dependency helps rpm, but that's also just speculation from my side.

yggdrasil 0.2 used gRPC where 0.4 uses D-Bus. foreman_ygg_worker is only
compatible with yggdrasil over grpc and this narrows the requirement.
This is important because yggdrasil 0.3 is in EPEL 8 & 9 and yggdrasil
0.4 is in CentOS Stream 9.
@ekohl ekohl force-pushed the rpm/develop-narrow-yggdrasil-requirement branch from 9d67dcf to 85aa6c3 Compare September 13, 2024 09:36
@ekohl
Copy link
Member Author

ekohl commented Sep 13, 2024

With nightly:

# dnf install foreman_ygg_worker
Last metadata expiration check: 0:00:25 ago on Fri Sep 13 09:39:21 2024.
Dependencies resolved.
==========================================================================================================
 Package                       Architecture      Version                  Repository                 Size
==========================================================================================================
Installing:
 foreman_ygg_worker            x86_64            0.2.2-3.el9              foreman-client            3.1 M
Installing dependencies:
 yggdrasil                     x86_64            0.4.1-1.el9              appstream                 4.5 M

Transaction Summary
==========================================================================================================
Install  2 Packages

Total download size: 7.6 M
Installed size: 25 M

With this change:

# dnf install foreman_ygg_worker
Foreman client nightly                                                     19 kB/s | 8.2 kB     00:00    
Dependencies resolved.
==========================================================================================================
 Package                                Arch   Version         Repository                            Size
==========================================================================================================
Installing:
 foreman_ygg_worker                     x86_64 0.2.2-4.el9     copr:copr.fedorainfracloud.org:group_theforeman:client-nightly-staging-scratch-73b88cb3-2782-5878-962d-d433d33f820f
                                                                                                    3.1 M
Installing dependencies:
 acl                                    x86_64 2.3.1-4.el9     baseos                                71 k
 cracklib                               x86_64 2.9.6-27.el9    baseos                                94 k
 cracklib-dicts                         x86_64 2.9.6-27.el9    baseos                               3.6 M
 dbus                                   x86_64 1:1.12.20-8.el9 baseos                               3.8 k
 dbus-broker                            x86_64 28-7.el9        baseos                               172 k
 dbus-common                            noarch 1:1.12.20-8.el9 baseos                                15 k
 diffutils                              x86_64 3.7-12.el9      baseos                               397 k
 dmidecode                              x86_64 1:3.6-1.el9     baseos                               102 k
 gobject-introspection                  x86_64 1.68.0-11.el9   baseos                               250 k
 iproute                                x86_64 6.2.0-5.el9     baseos                               813 k
 kmod-libs                              x86_64 28-10.el9       baseos                                63 k
 libbpf                                 x86_64 2:1.4.0-1.el9   baseos                               178 k
 libdb                                  x86_64 5.3.28-54.el9   baseos                               735 k
 libdnf-plugin-subscription-manager     x86_64 1.29.42-1.el9   baseos                                43 k
 libeconf                               x86_64 0.4.1-4.el9     baseos                                27 k
 libfdisk                               x86_64 2.37.4-18.el9   baseos                               155 k
 libmnl                                 x86_64 1.0.4-16.el9    baseos                                28 k
 libpkgconf                             x86_64 1.7.3-10.el9    baseos                                36 k
 libpwquality                           x86_64 1.4.4-8.el9     baseos                               119 k
 libseccomp                             x86_64 2.5.2-2.el9     baseos                                72 k
 libselinux-utils                       x86_64 3.6-1.el9       baseos                               190 k
 libuser                                x86_64 0.63-15.el9     baseos                               413 k
 libutempter                            x86_64 1.2.1-6.el9     baseos                                27 k
 openssl                                x86_64 1:3.2.2-2.el9   baseos                               1.4 M
 pam                                    x86_64 1.5.1-20.el9    baseos                               628 k
 passwd                                 x86_64 0.80-12.el9     baseos                               122 k
 pkgconf                                x86_64 1.7.3-10.el9    baseos                                41 k
 pkgconf-m4                             noarch 1.7.3-10.el9    baseos                                15 k
 pkgconf-pkg-config                     x86_64 1.7.3-10.el9    baseos                                11 k
 policycoreutils                        x86_64 3.6-2.1.el9     baseos                               242 k
 psmisc                                 x86_64 23.4-3.el9      baseos                               243 k
 python3-chardet                        noarch 4.0.0-5.el9     baseos                               239 k
 python3-cloud-what                     x86_64 1.29.42-1.el9   baseos                                64 k
 python3-decorator                      noarch 4.4.2-6.el9     baseos                                28 k
 python3-gobject-base                   x86_64 3.40.1-6.el9    baseos                               183 k
 python3-gobject-base-noarch            noarch 3.40.1-6.el9    baseos                               161 k
 python3-idna                           noarch 2.10-7.el9.1    baseos                               102 k
 python3-iniparse                       noarch 0.4-45.el9      baseos                                47 k
 python3-inotify                        noarch 0.9.6-25.el9    baseos                                53 k
 python3-librepo                        x86_64 1.14.5-2.el9    baseos                                48 k
 python3-pysocks                        noarch 1.7.1-12.el9    baseos                                35 k
 python3-requests                       noarch 2.25.1-8.el9    baseos                               125 k
 python3-setuptools                     noarch 53.0.0-13.el9   baseos                               943 k
 python3-subscription-manager-rhsm      x86_64 1.29.42-1.el9   baseos                               149 k
 python3-urllib3                        noarch 1.26.5-6.el9    baseos                               215 k
 rpm-plugin-selinux                     x86_64 4.16.1.3-30.el9 baseos                                16 k
 selinux-policy                         noarch 38.1.44-1.el9   baseos                                51 k
 selinux-policy-targeted                noarch 38.1.44-1.el9   baseos                               6.9 M
 subscription-manager                   x86_64 1.29.42-1.el9   baseos                               904 k
 subscription-manager-rhsm-certificates noarch 20220623-1.el9  baseos                                21 k
 systemd                                x86_64 252-45.el9      baseos                               4.2 M
 systemd-pam                            x86_64 252-45.el9      baseos                               285 k
 systemd-rpm-macros                     noarch 252-45.el9      baseos                                73 k
 usermode                               x86_64 1.114-5.el9     baseos                               188 k
 util-linux                             x86_64 2.37.4-18.el9   baseos                               2.3 M
 util-linux-core                        x86_64 2.37.4-18.el9   baseos                               465 k
 virt-what                              x86_64 1.25-10.el9     baseos                                42 k
 which                                  x86_64 2.21-29.el9     baseos                                41 k
 yggdrasil                              x86_64 0.2.3-2.el9     foreman-client                       5.6 M

Transaction Summary
==========================================================================================================
Install  60 Packages

Total download size: 37 M
Installed size: 113 M

Note how it correctly uses 0.2 from our repos.

@ekohl ekohl requested a review from ehelms September 13, 2024 10:30
Copy link
Member

@evgeni evgeni left a comment

Choose a reason for hiding this comment

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

# dnf upgrade

Error: 
 Problem: package foreman_ygg_worker-0.2.2-4.el9.x86_64 from @System requires (yggdrasil >= 0.2 with yggdrasil < 0.3), but none of the providers can be installed
  - cannot install both yggdrasil-0.4.1-1.el9.x86_64 from appstream and yggdrasil-0.2.3-2.el9.x86_64 from @System
  - cannot install both yggdrasil-0.2.3-2.el9.x86_64 from foreman-client and yggdrasil-0.4.1-1.el9.x86_64 from appstream
  - cannot install the best update candidate for package yggdrasil-0.2.3-2.el9.x86_64
  - problem with installed package foreman_ygg_worker-0.2.2-4.el9.x86_64
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

@evgeni
Copy link
Member

evgeni commented Sep 13, 2024

Or rather, not sure I want changes, as it makes explicit that things won't work… but it blocks upgrades unless users pass --nobest

@ekohl
Copy link
Member Author

ekohl commented Sep 13, 2024

Or rather, not sure I want changes, as it makes explicit that things won't work

I like being explicit in that it's broken. Otherwise it just silently breaks.

Copy link
Member

@ehelms ehelms left a comment

Choose a reason for hiding this comment

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

I agree, while it's annoying to see that error output when updating, it sends a clear signal something is mis-aligned and needs attention and prevents silent breakage.

@ehelms ehelms merged commit b920a88 into theforeman:rpm/develop Oct 11, 2024
6 checks passed
@ekohl ekohl deleted the rpm/develop-narrow-yggdrasil-requirement branch October 11, 2024 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants