ganto / copr-lxc3

RPM spec files for building lxc-3 on Fedora COPR
MIT License
8 stars 2 forks source link

Dependency issues caused by lxc-libs-3.1.0-0.1 on Fedora 29/30 #15

Closed ganto closed 5 years ago

ganto commented 5 years ago

The recent update to lxc-libs-3.1.0-0.1 in the ganto-lxc3 COPR repository causes dependency resolving issues on Fedora 29/30 that already contains lxcfs-3.0.3-1:

# dnf update
Last metadata expiration check: 0:36:27 ago on Tue 05 Feb 2019 02:32:15 PM PST.
Dependencies resolved.

 Problem: package lxc-templates-3.0.3-1.fc29.x86_64 requires lxc-libs(x86-64) = 3.0.3-1.fc29, but none of the providers can be installed
  - cannot install both lxc-libs-3.1.0-0.1.fc29.x86_64 and lxc-libs-3.0.3-1.fc29.x86_64
  - cannot install both lxc-libs-3.0.3-1.fc29.x86_64 and lxc-libs-3.1.0-0.1.fc29.x86_64
  - cannot install the best update candidate for package lxc-templates-3.0.3-1.fc29.x86_64
  - cannot install the best update candidate for package lxc-libs-3.0.3-1.fc29.x86_64
====================================================================================================================================================================================================================
 Package                                            Arch                                           Version                                                 Repository                                          Size
====================================================================================================================================================================================================================
Upgrading:
 lxd                                                x86_64                                         3.9-0.1.fc29                                            ganto-lxc3                                         8.1 M
 lxd-client                                         x86_64                                         3.9-0.1.fc29                                            ganto-lxc3                                         4.5 M
Skipping packages with conflicts:
(add '--best --allowerasing' to command line to force their upgrade):
 lxc-libs                                           x86_64                                         3.1.0-0.1.fc29                                          ganto-lxc3                                         456 k

Transaction Summary
====================================================================================================================================================================================================================
Upgrade  2 Packages
Skip     1 Package

Total download size: 13 M
Is this ok [y/N]: 
ganto commented 5 years ago

The issue is caused by the lxc-templates-3.0.3-1 package of the Fedora repository which has a hard dependency on lxc-libs-3.0.3-1 and therefore blocks the update to lxc-libs-3.1.0-0.1.

I chose the release tag of my COPR packages to be 0.x on purpose, to make sure upstream packages of the same version tag will always be preferred by the package manager. This usually works well except in this situation where an upstream package has a hard dependency on specific RPM version/release because it's build from the lxc.spec file which also builds the library.

The lxc-templates-3.0.3-0.1 from my COPR repository however, is built from the separate source archive which still contains the old-style templates for bootstrapping containers and has Requires: lxc-libs%{?_isa} >= 3.0.0 which doesn't restrict which lxc-libs-3.x version is used.

Work-Around: To work around this issue, a user has the following options:

Proper Solution The proper solution will be for me to adjust the lxc.spec to reflect the layout from the upstream spec file which means to build the lxc-templates package from the LXC sources and then create a separate package (e.g. lxc-templates-extra) which would contain the additional "legacy" templates. This would result in a lxc-templates-3.1.0-0.2 and lxc-templates-extra-3.0.3-0.1 and therefore fix the dependency issue.

ganto commented 5 years ago

Issue should be fixed by 475bc9667cde79f15c0d8ac298008350b098be30 (lxc-templates according to upstream spec) and 1b8cd227c2b3f5ec8ab26cee3525ad00d1f4dea3 (lxc-templates-extra package). With lxc-templates-3.1.0-0.2 and higher all users should have a working upgrade experience.

IMPORTANT Users who depend on the old-style templates originally packaged in the lxc-templates RPM from the COPR repository now need to install the new lxc-templates-extra package!