Skip to contentSkip to conversation

Regression with RPM4 and unversioned DSOs

DISCUSSION Peter Kjellerstedt 4 participants 6 messages May 4, 2017

lore
Share & tools
lore
#0 lore raw

There seems to be a serious regression with the introduction of RPM4 and packages that install unversioned DSOs. We unfortunately have a lot of those, and after building one of our products with Pyro it is now missing almost 80 packages due to missing generated runtime dependencies.

Previously the RPMs had dependencies on the required DSOs, but that no longer seems to be the case, and there are only dependencies on the packages providing the DSOs.

Here is an example for one of our packages. First the output from rpm -q --requires for the package built with Pyro:

$  rpm -q --requires -p tmp/deploy/rpm/mips32r2el_nf/apta-utility-1.3.0-r0.10.mips32r2el_nf.rpm
libc6 >= 2.25
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1

And then the output for the same package built with Morty:

$ rpm -q  --requires -p tmp/deploy/rpm/mips32r2el_nf/apta-utility-1.3.0-r0.2.mips32r2el_nf.rpm
ld.so.1
ld.so.1(GLIBC_2.4)
libapta.so
libc.so.6
libc.so.6(GLIBC_2.0)
libc.so.6(GLIBC_2.2)
libc.so.6(GLIBC_2.3)
libc.so.6(GLIBC_2.3.4)
libc.so.6(GLIBC_2.4)
libc.so.6(GLIBC_2.7)
libc6 >= 2.24
libubihelper.so

Please note the lack of dependencies on libapta and libubihelper in the package built with Pyro.

Since I would very much like to avoid having to add explicit runtime dependencies for all those dependencies that were previously automatically detected, which would be a nightmare, I am now looking for any help as to where to find the code that adds the dependencies on the packages providing DSOs and to see if it is possible to change it to also detect dependencies on unversioned DSOs.

//Peter

#1 lore raw
Quoted 6 lines · Peter Kjellerstedt

Since I would very much like to avoid having to add explicit runtime dependencies for all those dependencies that were previously automatically detected, which would be a nightmare, I am now looking for any help as to where to find the code that adds the dependencies on the packages providing DSOs and to see if it is possible to change it to also detect dependencies on unversioned DSOs.

I'm not sure such implicit dependency detection at rpm generation point is guaranteed to work in the first place. Don't we have a package_qa check for this that should be failing? Can you publish a minimal layer so I can reproduce locally?

If you want to poke in rpm4 source, I think grepping for use_internal_dependency_generator is a good starting point.

Alex

#2 lore raw
Quoted 20 lines

-----Original Message-----
From: Alexander Kanavin [mailto:[email protected]]
Sent: den 4 maj 2017 11:54
To: Peter Kjellerstedt <[email protected]>
Cc: OE Core ([email protected]) <openembedded- [email protected]>
Subject: Re: Regression with RPM4 and unversioned DSOs

Quoted 2 lines · Peter Kjellerstedt

Since I would very much like to avoid having to add explicit runtime dependencies for all those dependencies that were previously

automatically

Quoted 1 line

detected, which would be a nightmare, I am now looking for any help

as to

Quoted 1 line

where to find the code that adds the dependencies on the packages

providing

Quoted 1 line

DSOs and to see if it is possible to change it to also detect

dependencies

Quoted 1 line

on unversioned DSOs.

Quoted 7 lines

I'm not sure such implicit dependency detection at rpm generation point is guaranteed to work in the first place. Don't we have a package_qa check for this that should be failing? Can you publish a minimal layer so I can reproduce locally?

If you want to poke in rpm4 source, I think grepping for use_internal_dependency_generator is a good starting point.

I was more thinking of the code in OE-core that generates the list of Requires that goes into the spec file. The matching sections from the spec files for the apta-utility package that I used as example in my first mail are (for Pyro):

Requires: libc6 >= 2.25

and (for Morty):

Requires: ld.so.1
Requires: ld.so.1(GLIBC_2.4)
Requires: libapta.so
Requires: libc.so.6
Requires: libc.so.6(GLIBC_2.0)
Requires: libc.so.6(GLIBC_2.2)
Requires: libc.so.6(GLIBC_2.3)
Requires: libc.so.6(GLIBC_2.3.4)
Requires: libc.so.6(GLIBC_2.4)
Requires: libc.so.6(GLIBC_2.7)
Requires: libc6 >= 2.24
Requires: libubihelper.so
Provides: elf(buildid) = 097a4862c4d6275838e8eb5759501630b7913485

So I think it is quite obvious that something has changed in OE-core in how these lists are generated... It is also apparent that the problem with lack of dependencies on packages with unversioned DSOs was already present in Morty. However, since it was hidden by the direct dependencies on the DSOs it was not apparent before.

Does RPM4 support dependencies on DSOs, or was that an RPM5 feature? If RPM4 supports it, why was it removed when dnf was introduced?

Quoted 1 line

Alex

//Peter

#3 lore raw

You might want to check the output of package_do_shlibs function in meta/classes/package.bbclass
in case it's already missing there.

Quoted 70 lines · Peter Kjellerstedt
Quoted 20 lines

-----Original Message-----
From: Alexander Kanavin [mailto:[email protected]]
Sent: den 4 maj 2017 11:54
To: Peter Kjellerstedt <[email protected]>
Cc: OE Core ([email protected]) <openembedded- [email protected]>
Subject: Re: Regression with RPM4 and unversioned DSOs

Quoted 2 lines · Peter Kjellerstedt

Since I would very much like to avoid having to add explicit runtime dependencies for all those dependencies that were previously

automatically

Quoted 1 line

detected, which would be a nightmare, I am now looking for any help

as to

Quoted 1 line

where to find the code that adds the dependencies on the packages

providing

Quoted 1 line

DSOs and to see if it is possible to change it to also detect

dependencies

Quoted 1 line

on unversioned DSOs.

Quoted 7 lines

I'm not sure such implicit dependency detection at rpm generation point is guaranteed to work in the first place. Don't we have a package_qa check for this that should be failing? Can you publish a minimal layer so I can reproduce locally?

If you want to poke in rpm4 source, I think grepping for use_internal_dependency_generator is a good starting point.

I was more thinking of the code in OE-core that generates the list of Requires that goes into the spec file. The matching sections from the spec files for the apta-utility package that I used as example in my first mail are (for Pyro):

Requires: libc6 >= 2.25

and (for Morty):

Requires: ld.so.1
Requires: ld.so.1(GLIBC_2.4)
Requires: libapta.so
Requires: libc.so.6
Requires: libc.so.6(GLIBC_2.0)
Requires: libc.so.6(GLIBC_2.2)
Requires: libc.so.6(GLIBC_2.3)
Requires: libc.so.6(GLIBC_2.3.4)
Requires: libc.so.6(GLIBC_2.4)
Requires: libc.so.6(GLIBC_2.7)
Requires: libc6 >= 2.24
Requires: libubihelper.so
Provides: elf(buildid) = 097a4862c4d6275838e8eb5759501630b7913485

So I think it is quite obvious that something has changed in OE-core in how these lists are generated... It is also apparent that the problem with lack of dependencies on packages with unversioned DSOs was already present in Morty. However, since it was hidden by the direct dependencies on the DSOs it was not apparent before.

Does RPM4 support dependencies on DSOs, or was that an RPM5 feature? If RPM4 supports it, why was it removed when dnf was introduced?

Quoted 1 line

Alex

//Peter

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#4 lore raw
Quoted 2 lines · Martin Jansa

You might want to check the output of package_do_shlibs function in meta/classes/package.bbclass in case it's already missing there.

I'm pretty sure this was generated in the older case in the "package_do_filedeps".

The system ran rpmdeps, which collected the individual file dependencies. These were collected into 'FILERPROVIDES_file_pkg' and 'FILERDEPENDS_file_pkg'. The package manager could then choose to collect them or ignore them. RPM5 work collected these.

Looking at the the latest, that function is still present. So investigating if the contents of the FILERPROVIDES and FILERDEPENDS is correct or not is where I would start.

Then look at where the spec file is generated and such. Those items should be used there as well.

--Mark

Quoted 81 lines
Quoted 2 lines · On Thu, May 4, 2017 at 1:30 PM, Peter Kjellerstedt…

-----Original Message-----
From: Alexander Kanavin [mailto:[email protected]

<mailto:[email protected]>]
> Sent: den 4 maj 2017 11:54
> To: Peter Kjellerstedt <[email protected] <mailto:[email protected]>>
> Cc: OE Core ([email protected] <mailto:[email protected]>) <openembedded- > [email protected] <mailto:[email protected]>> > Subject: Re: Regression with RPM4 and unversioned DSOs
>
> On 05/04/2017 11:46 AM, Peter Kjellerstedt wrote:
> > Since I would very much like to avoid having to add explicit runtime > > dependencies for all those dependencies that were previously > automatically
> > detected, which would be a nightmare, I am now looking for any help > as to
> > where to find the code that adds the dependencies on the packages > providing
> > DSOs and to see if it is possible to change it to also detect > dependencies
> > on unversioned DSOs.
>
> I'm not sure such implicit dependency detection at rpm generation point > is guaranteed to work in the first place. Don't we have a package_qa > check for this that should be failing? Can you publish a minimal layer > so I can reproduce locally?
>
> If you want to poke in rpm4 source, I think grepping for
> use_internal_dependency_generator is a good starting point.

I was more thinking of the code in OE-core that generates the list of Requires that goes into the spec file. The matching sections from the spec files for the apta-utility package that I used as example in my first mail are (for Pyro):

Requires: libc6 >= 2.25

and (for Morty):

Requires: ld.so.1
Requires: ld.so.1(GLIBC_2.4)
Requires: libapta.so
Requires: libc.so.6
Requires: libc.so.6(GLIBC_2.0)
Requires: libc.so.6(GLIBC_2.2)
Requires: libc.so.6(GLIBC_2.3)
Requires: libc.so.6(GLIBC_2.3.4)
Requires: libc.so.6(GLIBC_2.4)
Requires: libc.so.6(GLIBC_2.7)
Requires: libc6 >= 2.24
Requires: libubihelper.so
Provides: elf(buildid) = 097a4862c4d6275838e8eb5759501630b7913485

So I think it is quite obvious that something has changed in OE-core in how these lists are generated... It is also apparent that the problem with lack of dependencies on packages with unversioned DSOs was already present in Morty. However, since it was hidden by the direct dependencies on the DSOs it was not apparent before.

Does RPM4 support dependencies on DSOs, or was that an RPM5 feature? If RPM4 supports it, why was it removed when dnf was introduced?

> Alex

//Peter

--
_______________________________________________
Openembedded-core mailing list [email protected] <mailto:[email protected]>
http://lists.openembedded.org/mailman/listinfo/openembedded-core
<http://lists.openembedded.org/mailman/listinfo/openembedded-core>

#5 lore raw
Quoted 12 lines · Mark Hatle
Quoted 2 lines · Martin Jansa

You might want to check the output of package_do_shlibs function in meta/classes/package.bbclass in case it's already missing there.

I'm pretty sure this was generated in the older case in the "package_do_filedeps".

The system ran rpmdeps, which collected the individual file dependencies. These were collected into 'FILERPROVIDES_file_pkg' and 'FILERDEPENDS_file_pkg'. The package manager could then choose to collect them or ignore them. RPM5 work collected these.

Quoted 7 lines

Looking at the the latest, that function is still present. So investigating if the contents of the FILERPROVIDES and FILERDEPENDS is correct or not is where I would start.

Then look at where the spec file is generated and such. Those items should be used there as well.

Found where they are used in the spec file generated, package_rpm.bbclass:

def dump_filerdeps(varname, outfile, d):
outfile.write("#!/usr/bin/env python\n\n")
outfile.write("# Dependency table\n")
outfile.write('deps = {\n')
for pkg in packages.split():
dependsflist_key = 'FILE' + varname + 'FLIST' + "_" + pkg dependsflist = (d.getVar(dependsflist_key, True) or "") for dfile in dependsflist.split():
key = "FILE" + varname + "_" + dfile + "_" + pkg depends_dict = bb.utils.explode_dep_versions(d.getVar(key, True)
or "")

                file = dfile.replace("@underscore@", "_")
                file = file.replace("@closebrace@", "]")
                file = file.replace("@openbrace@", "[")
                file = file.replace("@tab@", "\t")
                file = file.replace("@space@", " ")
                file = file.replace("@at@", "@")
                outfile.write('"' + pkgd + file + '" : "')
...
        outfile.write("import sys\n")
        outfile.write("while 1:\n")
        outfile.write("\tline = sys.stdin.readline().strip()\n")
        outfile.write("\tif not line:\n")
        outfile.write("\t\tsys.exit(0)\n")
        outfile.write("\tif line in deps:\n")
        outfile.write("\t\tprint(deps[line] + '\\n')\n")

What this function does is emulate the -external- (not internal) RPM dependency generation API. So when RPM itself runs, it will query this generate script asking it for the dependencies of select files. It will then return the dependencies specific to those files.

So either rpm (4) is not asking the dependency generation script for the dependencies properly -- or the contents of the script are simply wrong or incomplete.

I'd still start with rpmdeps, but inside RPM itself (during packaging) "use_internal_dependency_generator" should be off.. it needs to run the external script.

--Mark

Quoted 86 lines

--Mark

Quoted 81 lines
Quoted 2 lines · On Thu, May 4, 2017 at 1:30 PM, Peter Kjellerstedt…

-----Original Message-----
From: Alexander Kanavin [mailto:[email protected]

<mailto:[email protected]>]
> Sent: den 4 maj 2017 11:54
> To: Peter Kjellerstedt <[email protected] <mailto:[email protected]>>
> Cc: OE Core ([email protected] <mailto:[email protected]>) <openembedded- > [email protected] <mailto:[email protected]>> > Subject: Re: Regression with RPM4 and unversioned DSOs
>
> On 05/04/2017 11:46 AM, Peter Kjellerstedt wrote:
> > Since I would very much like to avoid having to add explicit runtime > > dependencies for all those dependencies that were previously > automatically
> > detected, which would be a nightmare, I am now looking for any help > as to
> > where to find the code that adds the dependencies on the packages > providing
> > DSOs and to see if it is possible to change it to also detect > dependencies
> > on unversioned DSOs.
>
> I'm not sure such implicit dependency detection at rpm generation point > is guaranteed to work in the first place. Don't we have a package_qa > check for this that should be failing? Can you publish a minimal layer > so I can reproduce locally?
>
> If you want to poke in rpm4 source, I think grepping for
> use_internal_dependency_generator is a good starting point.

I was more thinking of the code in OE-core that generates the list of Requires that goes into the spec file. The matching sections from the spec files for the apta-utility package that I used as example in my first mail are (for Pyro):

Requires: libc6 >= 2.25

and (for Morty):

Requires: ld.so.1
Requires: ld.so.1(GLIBC_2.4)
Requires: libapta.so
Requires: libc.so.6
Requires: libc.so.6(GLIBC_2.0)
Requires: libc.so.6(GLIBC_2.2)
Requires: libc.so.6(GLIBC_2.3)
Requires: libc.so.6(GLIBC_2.3.4)
Requires: libc.so.6(GLIBC_2.4)
Requires: libc.so.6(GLIBC_2.7)
Requires: libc6 >= 2.24
Requires: libubihelper.so
Provides: elf(buildid) = 097a4862c4d6275838e8eb5759501630b7913485

So I think it is quite obvious that something has changed in OE-core in how these lists are generated... It is also apparent that the problem with lack of dependencies on packages with unversioned DSOs was already present in Morty. However, since it was hidden by the direct dependencies on the DSOs it was not apparent before.

Does RPM4 support dependencies on DSOs, or was that an RPM5 feature? If RPM4 supports it, why was it removed when dnf was introduced?

> Alex

//Peter

--
_______________________________________________
Openembedded-core mailing list [email protected] <mailto:[email protected]>
http://lists.openembedded.org/mailman/listinfo/openembedded-core
<http://lists.openembedded.org/mailman/listinfo/openembedded-core>