[Bug 979528] New: zypper seems to pick the wrong package version
http://bugzilla.opensuse.org/show_bug.cgi?id=979528 Bug ID: 979528 Summary: zypper seems to pick the wrong package version Classification: openSUSE Product: openSUSE Distribution Version: 13.2 Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: libzypp Assignee: zypp-maintainers@forge.provo.novell.com Reporter: pc@us.ibm.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- Created attachment 676574 --> http://bugzilla.opensuse.org/attachment.cgi?id=676574&action=edit results with --debug-solver I'm trying to install a package, which has a dependency on package "A >= version". The repository has package "A" with several versions, including "version" and "version+1". I would expect "version+1" to be installed, but that is not happening. Am I misunderstanding something about the dependency resolution? More specifically: -- # zypper --version zypper 1.12.37 # rpm -q -p --requires ./ibm-sdk-lop-remote-dependencies-1.9.0-1.ppc64le.rpm glibc >= 2.13 make fdprpro >= 5.6.2-7 fdpr_wrap >= 0.1.1-4 advance-toolchain-devel >= 8.0-5 advance-toolchain-perf >= 8.0-5 automake autoconf libtool gettext pthread-mon >= 0.5.11-1 git perf gdb rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadIsLzma) <= 4.4.6-1 # zypper search --provides 'advance-toolchain-devel >= 8.0-5' Loading repository data... Reading installed packages... S | Name | Type | Version | Arch | Repository --+-------------------------------+---------+---------+---------+------------------ | advance-toolchain-at8.0-devel | package | 8.0-6 | ppc64le | Advance Toolchain | advance-toolchain-at8.0-devel | package | 8.0-5 | ppc64le | Advance Toolchain | advance-toolchain-at8.0-devel | package | 8.0-4 | ppc64le | Advance Toolchain | advance-toolchain-at8.0-devel | package | 8.0-3 | ppc64le | Advance Toolchain | advance-toolchain-at8.0-devel | package | 8.0-2 | ppc64le | Advance Toolchain | advance-toolchain-at8.0-devel | package | 8.0-1 | ppc64le | Advance Toolchain | advance-toolchain-at9.0-devel | package | 9.0-3 | ppc64le | Advance Toolchain | advance-toolchain-at9.0-devel | package | 9.0-2 | ppc64le | Advance Toolchain | advance-toolchain-at9.0-devel | package | 9.0-1 | ppc64le | Advance Toolchain | advance-toolchain-at9.0-devel | package | 9.0-0 | ppc64le | Advance Toolchain # zypper install --dry-run ./ibm-sdk-lop-remote-dependencies-1.9.0-1.ppc64le.rpm Loading repository data... Reading installed packages... Resolving package dependencies... The following 4 NEW packages are going to be installed: advance-toolchain-at8.0-devel advance-toolchain-at8.0-perf advance-toolchain-at8.0-runtime ibm-sdk-lop-remote-dependencies The following 4 packages are not supported by their vendor: advance-toolchain-at8.0-devel advance-toolchain-at8.0-perf advance-toolchain-at8.0-runtime ibm-sdk-lop-remote-dependencies 4 new packages to install. Overall download size: 408.3 MiB. Already cached: 0 B. After the operation, additional 1.8 GiB will be used. Continue? [y/n/? shows all options] (y): n -- -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=979528
http://bugzilla.opensuse.org/show_bug.cgi?id=979528#c1
--- Comment #1 from Michael Andres
I'm trying to install a package, which has a dependency on package "A >= version". The repository has package "A" with several versions, including "version" and "version+1". I would expect "version+1" to be installed, but that is not happening. Am I misunderstanding something about the dependency resolution?
I'll try to explain: - A package dependency has 'NAME [op VERSION]' (op: == != < <= > >=). A missing '[op VERSION]' (VERSION_RANGE definition) means 'any VERSION'. ! VERSION is NOT the version of the providing package, it's a property of the dependency - A package has a NAME and a VERSION; by this it implicitly provides the dependency 'NAME == VERSION' Two dependencies match if they refer to the same NAME and define an overlapping VERSION_RANGE (non empty intersection). A dependency matches a package, if it matches one of the packages 'Provides'. Back to your case: - The advance-toolchain-at*-devel packages all 'Provide: advance-toolchain-devel'. I.e. they match 'advance-toolchain-devel' in 'any VERSION'! That's why zypper search --provides 'advance-toolchain-devel >= 8.0-5' matches all 'advance-toolchain-at*-devel' packages. Remember: '8.0-5' is not a package version, but the dependencies version range. As all packages provide 'any VERSION' the '>= 8.0-5' is basically 'useless' Among all available PACKAGES matching the dependency, the resolver usually prefers the PACKAGE with the lex. least name: advance-toolchain-at8.0-devel in the highest available version: 8.0-6. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=979528
http://bugzilla.opensuse.org/show_bug.cgi?id=979528#c2
--- Comment #2 from Paul Clarke
(In reply to Paul Clarke from comment #0) - A package dependency has 'NAME [op VERSION]' (op: == != < <= > >=). A missing '[op VERSION]' (VERSION_RANGE definition) means 'any VERSION'.
! VERSION is NOT the version of the providing package, it's a property of the dependency
Can you clarify "property of the dependency" and how that is distinguished from the version of the providing package?
- A package has a NAME and a VERSION; by this it implicitly provides the dependency 'NAME == VERSION'
Two dependencies match if they refer to the same NAME and define an overlapping VERSION_RANGE (non empty intersection).
And this "VERSION_RANGE" is the version of the providing package (which I believe you are referring to as "dependency" here)?
A dependency matches a package, if it matches one of the packages 'Provides'.
Back to your case:
- The advance-toolchain-at*-devel packages all 'Provide: advance-toolchain-devel'. I.e. they match 'advance-toolchain-devel' in 'any VERSION'!
That's why zypper search --provides 'advance-toolchain-devel >= 8.0-5' matches all 'advance-toolchain-at*-devel' packages.
Remember: '8.0-5' is not a package version, but the dependencies version range. As all packages provide 'any VERSION' the '>= 8.0-5' is basically 'useless'
Among all available PACKAGES matching the dependency, the resolver usually prefers the PACKAGE with the lex. least name: advance-toolchain-at8.0-devel in the highest available version: 8.0-6.
That certainly explains the observed behavior. Apologies for my ignorance, but it seems I need to inject a "dependencies version" for the respective packages, which is different than the package version. (I admit I'm a bit lost on the difference.) Is the "fix", presuming I have control over the 'advance-toolchain-devel' packages, is to add specific "Provides" version tags? Something like: Provides: advance-toolchain-devel == 9.0-3 ...for ALL of such packages in the repo? I'd have the same problem unless I changed them all, I presume. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=979528
http://bugzilla.opensuse.org/show_bug.cgi?id=979528#c3
--- Comment #3 from Paul Clarke
A dependency matches a package, if it matches one of the packages 'Provides'.
Back to your case:
- The advance-toolchain-at*-devel packages all 'Provide: advance-toolchain-devel'. I.e. they match 'advance-toolchain-devel' in 'any VERSION'!
That's why zypper search --provides 'advance-toolchain-devel >= 8.0-5' matches all 'advance-toolchain-at*-devel' packages.
Remember: '8.0-5' is not a package version, but the dependencies version range. As all packages provide 'any VERSION' the '>= 8.0-5' is basically 'useless'
Among all available PACKAGES matching the dependency, the resolver usually prefers the PACKAGE with the lex. least name: advance-toolchain-at8.0-devel in the highest available version: 8.0-6.
That certainly explains the observed behavior.
Apologies for my ignorance, but it seems I need to inject a "dependencies version" for the respective packages, which is different than the package version. (I admit I'm a bit lost on the difference.)
Is the "fix", presuming I have control over the 'advance-toolchain-devel' packages, is to add specific "Provides" version tags? Something like: Provides: advance-toolchain-devel == 9.0-3
...for ALL of such packages in the repo? I'd have the same problem unless I changed them all, I presume.
Answering my own question, I stumbled across a reference that said that virtual packages cannot have versioning. So, I think the only solution is a metapackage that points to the latest version. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=979528
http://bugzilla.opensuse.org/show_bug.cgi?id=979528#c5
--- Comment #5 from Michael Andres
! VERSION is NOT the version of the providing package, it's a property of the dependency
Can you clarify "property of the dependency" and how that is distinguished from the version of the providing package?
Wanted to express that in a dependency like 'advance-toolchain-devel = 8.0-5', the version(range) '= 8.0-5' is compared against the version(range) of some other 'advance-toolchain-devel' dependency, and never against the version of some package that happens to contain an 'advance-toolchain-devel' dependency or happens to be named 'advance-toolchain-devel'.
From the solvers POV 'Requires: zypper' does not select the package because it's named 'zypper', but because it matches the implicit 'Provides: zypper = %{version}'.
Matching is based on dependencies.
Pkg: Foo-5.0 Provides: Foo = 5.0 (implicitly)
Pkg: Foo-6.0 Provides: Foo = 6.0 (implicitly)
Pkg: Xoo-1.0 Provides: Xoo = 1.0 (implicitly) Provides: Foo = 7.0 (explicitly)
'Requires: Foo' will consider all 3 packages. The real package names and versions may come into play when pruning such a set of candidates. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=979528
http://bugzilla.opensuse.org/show_bug.cgi?id=979528#c6
Michael Andres
participants (1)
-
bugzilla_noreply@novell.com