Re: [Rpm-ecosystem] Required version of rpm?
On Mon, Jul 2, 2018 at 3:56 PM Igor Gnatenko < ignatenkobr...@fedoraproject.org> wrote: > On Mon, Jul 2, 2018, 09:41 Miroslav Suchý wrote: > >> Dne 29.6.2018 v 16:45 Jeff Johnson napsal(a): >> > And -- as I said before -- rpmlib() dependencies and their versions are >> the wrong approach to what you are attempting. >> >> Do you have any other idea how to solve this? >> >> > There is no additional benefit to checking rpmlib() dependencies first, >> or as part of normal dependency processing: in both cases you will get a >> failed operation. >> >> But there is big difference (from UX POV) how it fails. Whether it fails >> with: >> >>Error: Invalid version flag: if >> > > BTW, isn't this message coming from YUM and not from RPM? > Yeah, this message is coming from YUM and not from RPM. So there is nothing to do in RPM. -- -Igor Gnatenko ___ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem
Re: [Rpm-ecosystem] Required version of rpm?
On Mon, Jul 2, 2018, 09:41 Miroslav Suchý wrote: > Dne 29.6.2018 v 16:45 Jeff Johnson napsal(a): > > And -- as I said before -- rpmlib() dependencies and their versions are > the wrong approach to what you are attempting. > > Do you have any other idea how to solve this? > > > There is no additional benefit to checking rpmlib() dependencies first, > or as part of normal dependency processing: in both cases you will get a > failed operation. > > But there is big difference (from UX POV) how it fails. Whether it fails > with: > >Error: Invalid version flag: if > BTW, isn't this message coming from YUM and not from RPM? -- -Igor Gnatenko ___ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem
Re: [Rpm-ecosystem] Required version of rpm?
Dne 29.6.2018 v 16:45 Jeff Johnson napsal(a): > And -- as I said before -- rpmlib() dependencies and their versions are the > wrong approach to what you are attempting. Do you have any other idea how to solve this? > There is no additional benefit to checking rpmlib() dependencies first, or as > part of normal dependency processing: in both cases you will get a failed > operation. But there is big difference (from UX POV) how it fails. Whether it fails with: Error: Invalid version flag: if or with: Error: The package "redhat-rpm-config" requires "RichDependencies" capability, which is not provided in this version of rpm. Miroslav ___ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem
Re: [Rpm-ecosystem] Required version of rpm?
> On Jun 29, 2018, at 8:27 AM, Miroslav Suchý wrote: > > Dne 26.6.2018 v 15:57 Panu Matilainen napsal(a): >> >> Nope. From my previous email: "the version in rpmlib() dependencies is sorta >> backwards to what people generally expect." >> - but it's the range, not the version that appears backwards. >> >> This is the way all rpmlib() dependencies have always been, here's the best >> explanation I've found: >> >> https://www.redhat.com/archives/rpm-list/2001-April/msg00283.html >> > > ??? > > in lib/rpmds.c there is: > > static const struct rpmlibProvides_s rpmlibProvides[] = { > ... >{ "rpmlib(RichDependencies)","4.12.0-1", > >( RPMSENSE_EQUAL), >N_("support for rich dependencies.") }, > > and indeed > rpm --showrc |grep Rich > say: > rpmlib(RichDependencies) = 4.12.0-1 > > and redhat-rpm-config.fc28 requires > rpmlib(RichDependencies) <= 4.12.0-1 > > So redhat-rpm-config install fine because 4.12.0-1 == 4.12.0-1. > But if ever we get some other weak dependency and rpm will start to provide: > rpmlib(RichDependencies) = 5.50.0-1 > > Then anything which requires > rpmlib(RichDependencies) <= 4.12.0-1 > will be installable. > You can try it by bulding dummy rpm file with: > Provides: rpmlib(RichDependencies) = 5.50.0-1 > > So I really think that the condition should be "rpmlib(RichDependencies) >= > 4.12.0-1" > No. There is deliberately and explicitly no guarantee of forward compatibility in how rpm uses rpmlib() dependencies. And -- as I said before -- rpmlib() dependencies and their versions are the wrong approach to what you are attempting. >> And in fact the rich dependency tracking version is a fine example of how >> the version is not trustworthy: rich >> dependencies got added in 4.13.0, not 4.12.0 as the rpmlib() dependency >> would have you think. > > It seems [1] that Rpm does not check the version in rpmlib() string to > anything related to version of rpm. For rpm it is > just string. So rpm does not care which version it is 12 or 13 and dummy spec > with: > Requires: rpmlib(RichDependencies) <= 4.12.0-1 > Is not installable on EL7 because of there is rpm-4.11.3, but because nothing > provides there 'rpmlib(RichDependencies)' > at all. > Yes. That is exactly what is supposed to happen. The rpmlib() dependencies are satisfied by the rpm being used, not the package(s) being installed. > In fact, I do not think that rpm should check rpm real version. These virtual > provides are fine. Only that, Rpm should > check the "rpmlib()" dependencies first and if they are satisfied (and only > if) rpm should read and evaluate all other > dependencies. There is no additional benefit to checking rpmlib() dependencies first, or as part of normal dependency processing: in both cases you will get a failed operation. > According my investigation DNF is unable to do that. The logic in DNF is in > `dnf/rpm/transaction.py` where method > addInstall from rpmlib is used to add package to transaction and then in > test() is called `tserrors = > self.ts.run(cb.callback, '')` which is just call to rpmlib. > Yes. DNF must run with a version of rpm able to handle rich dependencies. That can be done by backporting, or by using a 2nd copy of rpm bindings/libraries. In general, rpmlib() dependencies should not be attempted in user packaging because the dependencies are tracking features that are in use in the running version of rpm, not the packages in the transaction. And since some rpm is being used, the set of features is constant, and can only be changed by restarting DNF with a newer version of rpm, which is a different, and more complex, upgrade solution than other packages. 73 de Jeff > > [1] I tried dummy spec with: > Requires: rpmlib(RichDependencies) <= 5.14.1-9 > on my F28 with rpm-4.14.1-9.fc28.x86_64 and it install like a charm. > > Miroslav > ___ > Rpm-ecosystem mailing list > Rpm-ecosystem@lists.rpm.org > http://lists.rpm.org/mailman/listinfo/rpm-ecosystem ___ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem
Re: [Rpm-ecosystem] Required version of rpm?
Dne 26.6.2018 v 15:57 Panu Matilainen napsal(a): > > Nope. From my previous email: "the version in rpmlib() dependencies is sorta > backwards to what people generally expect." > - but it's the range, not the version that appears backwards. > > This is the way all rpmlib() dependencies have always been, here's the best > explanation I've found: > > https://www.redhat.com/archives/rpm-list/2001-April/msg00283.html > ??? in lib/rpmds.c there is: static const struct rpmlibProvides_s rpmlibProvides[] = { ... { "rpmlib(RichDependencies)","4.12.0-1", ( RPMSENSE_EQUAL), N_("support for rich dependencies.") }, and indeed rpm --showrc |grep Rich say: rpmlib(RichDependencies) = 4.12.0-1 and redhat-rpm-config.fc28 requires rpmlib(RichDependencies) <= 4.12.0-1 So redhat-rpm-config install fine because 4.12.0-1 == 4.12.0-1. But if ever we get some other weak dependency and rpm will start to provide: rpmlib(RichDependencies) = 5.50.0-1 Then anything which requires rpmlib(RichDependencies) <= 4.12.0-1 will be installable. You can try it by bulding dummy rpm file with: Provides: rpmlib(RichDependencies) = 5.50.0-1 So I really think that the condition should be "rpmlib(RichDependencies) >= 4.12.0-1" > And in fact the rich dependency tracking version is a fine example of how the > version is not trustworthy: rich > dependencies got added in 4.13.0, not 4.12.0 as the rpmlib() dependency would > have you think. It seems [1] that Rpm does not check the version in rpmlib() string to anything related to version of rpm. For rpm it is just string. So rpm does not care which version it is 12 or 13 and dummy spec with: Requires: rpmlib(RichDependencies) <= 4.12.0-1 Is not installable on EL7 because of there is rpm-4.11.3, but because nothing provides there 'rpmlib(RichDependencies)' at all. In fact, I do not think that rpm should check rpm real version. These virtual provides are fine. Only that, Rpm should check the "rpmlib()" dependencies first and if they are satisfied (and only if) rpm should read and evaluate all other dependencies. According my investigation DNF is unable to do that. The logic in DNF is in `dnf/rpm/transaction.py` where method addInstall from rpmlib is used to add package to transaction and then in test() is called `tserrors = self.ts.run(cb.callback, '')` which is just call to rpmlib. [1] I tried dummy spec with: Requires: rpmlib(RichDependencies) <= 5.14.1-9 on my F28 with rpm-4.14.1-9.fc28.x86_64 and it install like a charm. Miroslav ___ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem
Re: [Rpm-ecosystem] Required version of rpm?
Dne 27.6.2018 v 19:56 Jeff Johnson napsal(a): > The core problem is that the depsolver used by mock must be using > bindings/libraries that implement rich dependencies, as well as metadata > parsers that can represent rich dependencies. Mock itself does not have any depsolving library or such capability. Everything is handled by YUM/DNF. The use-case of install F28 on EL7 is probably lost as no one is going to add any new feature to YUM. But it is not not late to add it to DNF/libdnf to handle future problems of installing e.g., F42 on EL8 :) Miroslav ___ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem
Re: [Rpm-ecosystem] Required version of rpm?
> On Jun 26, 2018, at 7:15 AM, Miroslav Suchý wrote: > > Dne 26.6.2018 v 12:17 Neal Gompa napsal(a): >> rpmlib() dependencies are virtual, they aren't provided by anything, >> but are processed during the transaction and verified. > > 1) So the number in rpmlib(RichDependencies) means what version of rpm I > should have. Right? > > 2) The version of rpm I need to parse this RPM is in dependency list, which I > cannot parse on EL7 because there is too > old rpm. So I have chicken and egg problem. Any idea how to solve this? > The rpmlib() tracking dependency isn't what is needed or useful to supply a better error message. The core problem is that the depsolver used by mock must be using bindings/libraries that implement rich dependencies, as well as metadata parsers that can represent rich dependencies. An improved error message needs to come from the depsolver, not mock, perhaps through a feature vector which mock might retrieve. Suggesting a version of rpm by examining rpmlib() Provides: only deals the bottom of a rather complex depsolver software stack that is surely going to evolve while being deployed on EL7. That software stack involves many versions, not just the rpm version, nor the rpmlib() tracking dependency version. Having 2 versions of RPM on EL7 is one too many, and the long EL7 lifetime requirements inhibiting back ports of features are going to be very painful when some critical package chooses to use rich dependencies. I hope there is an adequate plan in place for deploying rich dependencies. 73 de Jeff > Miroslav > ___ > Rpm-ecosystem mailing list > Rpm-ecosystem@lists.rpm.org > http://lists.rpm.org/mailman/listinfo/rpm-ecosystem ___ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem
Re: [Rpm-ecosystem] Required version of rpm?
On 06/26/2018 04:46 PM, Miroslav Suchý wrote: Dne 26.6.2018 v 14:57 Panu Matilainen napsal(a): On 06/26/2018 02:15 PM, Miroslav Suchý wrote: Dne 26.6.2018 v 12:17 Neal Gompa napsal(a): rpmlib() dependencies are virtual, they aren't provided by anything, but are processed during the transaction and verified. 1) So the number in rpmlib(RichDependencies) means what version of rpm I should have. Right? Roughly yes, but beware there are cases where this is not true at all due to backports and sideports messing it all up. OK - corner cases and backports aside. But... I am still puzzled. $ rpm -qR redhat-rpm-config |grep Rich rpmlib(RichDependencies) <= 4.12.0-1 So any rpm with verision *lower* than 4.12.0 will work? Should be there ">=" ? Nope. From my previous email: "the version in rpmlib() dependencies is sorta backwards to what people generally expect." - but it's the range, not the version that appears backwards. This is the way all rpmlib() dependencies have always been, here's the best explanation I've found: https://www.redhat.com/archives/rpm-list/2001-April/msg00283.html And in fact the rich dependency tracking version is a fine example of how the version is not trustworthy: rich dependencies got added in 4.13.0, not 4.12.0 as the rpmlib() dependency would have you think. Not that you'd want to go telling to upgrade their rpm beyond what their distro provides, that's a recipe for disaster. No, I do not want to do that. I just want to provide that user-friendly error. Ack, good. - Panu - Miroslav ___ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem ___ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem
Re: [Rpm-ecosystem] Required version of rpm?
Dne 26.6.2018 v 14:57 Panu Matilainen napsal(a): > On 06/26/2018 02:15 PM, Miroslav Suchý wrote: >> Dne 26.6.2018 v 12:17 Neal Gompa napsal(a): >>> rpmlib() dependencies are virtual, they aren't provided by anything, >>> but are processed during the transaction and verified. >> >> 1) So the number in rpmlib(RichDependencies) means what version of rpm I >> should have. Right? > > Roughly yes, but beware there are cases where this is not true at all due to > backports and sideports messing it all up. OK - corner cases and backports aside. But... I am still puzzled. $ rpm -qR redhat-rpm-config |grep Rich rpmlib(RichDependencies) <= 4.12.0-1 So any rpm with verision *lower* than 4.12.0 will work? Should be there ">=" ? > Not that you'd want to go telling to upgrade their rpm beyond what their > distro provides, that's a recipe for disaster. No, I do not want to do that. I just want to provide that user-friendly error. Miroslav ___ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem
Re: [Rpm-ecosystem] Required version of rpm?
On 06/26/2018 02:15 PM, Miroslav Suchý wrote: Dne 26.6.2018 v 12:17 Neal Gompa napsal(a): rpmlib() dependencies are virtual, they aren't provided by anything, but are processed during the transaction and verified. 1) So the number in rpmlib(RichDependencies) means what version of rpm I should have. Right? Roughly yes, but beware there are cases where this is not true at all due to backports and sideports messing it all up. What you really need is to have an rpm version that provides the virtual capability in question (discoverable via --showrc and API), the version in rpmlib() dependencies is sorta backwards to what people generally expect. 2) The version of rpm I need to parse this RPM is in dependency list, which I cannot parse on EL7 because there is too old rpm. So I have chicken and egg problem. Any idea how to solve this? Yeah rich dependencies complicated the scene quite a bit. What was previously a dumb string no longer is, and could fail to be parsed by rpmds. What you always can get though, is the "raw" strings from the header, in RPMTAG_REQUIRENAME, RPMTAG_REQUIREFLAGS and RPMTAG_REQUIREVERSION arrays and look for rpmlib( in start of the name (it's supposed to be also flagged in RPMTAG_REQUIREFLAG but older rpm versions didn't always add it). Not that you'd want to go telling to upgrade their rpm beyond what their distro provides, that's a recipe for disaster. But sure, being able to detect such issues and provide a nicer explanation never hurt anybody. - Panu - ___ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem
Re: [Rpm-ecosystem] Required version of rpm?
Dne 26.6.2018 v 12:17 Neal Gompa napsal(a): > rpmlib() dependencies are virtual, they aren't provided by anything, > but are processed during the transaction and verified. 1) So the number in rpmlib(RichDependencies) means what version of rpm I should have. Right? 2) The version of rpm I need to parse this RPM is in dependency list, which I cannot parse on EL7 because there is too old rpm. So I have chicken and egg problem. Any idea how to solve this? Miroslav ___ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem
Re: [Rpm-ecosystem] Required version of rpm?
On Tue, Jun 26, 2018 at 4:57 AM Miroslav Suchý wrote: > > Dne 25.6.2018 v 13:04 Igor Gnatenko napsal(a): > > rpmlib(RichDependencies) <= 4.12.0-1 > > But on my F28: > > $ LC_ALL=C rpm -q --whatprovides 'rpmlib(RichDependencies)' > no package provides rpmlib(RichDependencies) > rpmlib() dependencies are virtual, they aren't provided by anything, but are processed during the transaction and verified. -- 真実はいつも一つ!/ Always, there's only one truth! ___ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem
[Rpm-ecosystem] Required version of rpm?
Recently packagers stared using rich deps in Fedora and I (as Mock maintainer) am hitting more issues like this: https://github.com/rpm-software-management/mock/issues/202 I.e. F28 package redhat-rpm-config has: Requires: (annobin if gcc) And when you try to install this by rpm from EL7 you get cryptic error: ---> Package redhat-rpm-config.noarch 0:108-1.fc28 will be installed Error: Invalid version flag: if For mock this can be workarounded by --bootstrapchroot (as long as noone use this for any package in minimal buildroot). I am think how to make the life of developers easier and turn this ugly message to something more friendly - Is there some way to query package what minimal version of RPM it need. Something like: # rpm -qp --whatversion foo.rpm 4.13.1 With the meaning that I need this version of rpm or higher. Miroslav ___ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem