<div dir="ltr">This seems to find a many more missed dependencies which is good thing.<div><br></div><div>There is +- 20 failures found in meta-oe recipes and there is still at least one in oe-core:</div><div><br></div><div><div>ERROR: nativesdk-libcheck-0.10.0-r0 do_package_qa: QA Issue: /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/checkmk contained in package nativesdk-libcheck requires /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/gawk, but no providers found in RDEPENDS_nativesdk-libcheck? [file-rdeps]</div></div><div><br></div><div>I wonder why this one wasn't catched by oe-core autobuilder.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 16, 2017 at 6:44 PM, <span dir="ltr"><<a href="mailto:git@git.openembedded.org" target="_blank">git@git.openembedded.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is an automated email from the git hooks/post-receive script.<br>
<br>
rpurdie pushed a commit to branch master-next<br>
in repository openembedded-core.<br>
<br>
commit bf017930036f19b3d6df8e5b50d997<wbr>9ee7045c5c<br>
Author: Peter Kjellerstedt <<a href="mailto:pkj@axis.com">pkj@axis.com</a>><br>
AuthorDate: Tue Aug 15 16:41:56 2017 -0500<br>
<br>
package.bbclass: Restore functionality to detect RPM dependencies<br>
<br>
During the transition to dnf and rpm4, the functionality to<br>
automatically make RPM determine dependencies was lost.<br>
<br>
Before the transition, an OE specific tool called rpmdeps-oecore had<br>
been added to the rpm suit. It was based on the rpmdeps tool that is<br>
part of rpm. For each file specified on its command line, it would<br>
output the provides and requires that RPM could determine.<br>
<br>
During the transition to rpm4, rpmdeps-oecore was replaced with the<br>
standard rpmdeps. However, what no one noticed was that unless rpmdeps<br>
is given options, e.g., -P or -R, to tell it what it should output, it<br>
will not output anything. Thus, it would do all the work to determine<br>
the requirements, but would keep silent about it. And since no output<br>
from rpmdeps is expected unless there are requirements, there were no<br>
warnings indicating that everything was not working as expected.<br>
<br>
Porting the old rpmdeps-oecore to work with rpm4 is not really<br>
possible since it relied on being able to access internals of RPM that<br>
are no longer available. However, it turned out that rpmdeps had a<br>
debug option, --rpmfcdebug, that would output exactly the information<br>
that we need, albeit in a different format and to stderr. To make this<br>
usable, rpmdeps has now received a new option, --alldeps, which sends<br>
the information we need to stdout.<br>
<br>
(From OE-Core rev: 958501b3d9201aaabb81ec644c6049<wbr>e0c9b737e7)<br>
<br>
Signed-off-by: Peter Kjellerstedt <<a href="mailto:peter.kjellerstedt@axis.com">peter.kjellerstedt@axis.com</a>><br>
Signed-off-by: Mark Hatle <<a href="mailto:mark.hatle@windriver.com">mark.hatle@windriver.com</a>><br>
Signed-off-by: Richard Purdie <<a href="mailto:richard.purdie@linuxfoundation.org">richard.purdie@<wbr>linuxfoundation.org</a>><br>
---<br>
meta/classes/package.bbclass | 5 ++--<br>
meta/lib/oe/package.py | 60 ++++++++++++++++++++++++++++++<wbr>+-------------<br>
2 files changed, 44 insertions(+), 21 deletions(-)<br>
<br>
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass<br>
index d2fa617..2fe30da 100644<br>
--- a/meta/classes/package.bbclass<br>
+++ b/meta/classes/package.bbclass<br>
@@ -1453,7 +1453,7 @@ if [ x"$D" = "x" ]; then<br>
fi<br>
}<br>
<br>
-RPMDEPS = "${STAGING_LIBDIR_NATIVE}/rpm/<wbr>rpmdeps --rcfile ${STAGING_LIBDIR_NATIVE}/rpm/<wbr>rpmrc --macros ${STAGING_LIBDIR_NATIVE}/rpm/<wbr>macros --define '_rpmconfigdir ${STAGING_LIBDIR_NATIVE}/rpm/'<wbr>"<br>
+RPMDEPS = "${STAGING_LIBDIR_NATIVE}/rpm/<wbr>rpmdeps --alldeps"<br>
<br>
# Collect perfile run-time dependency metadata<br>
# Output:<br>
@@ -1470,7 +1470,6 @@ python package_do_filedeps() {<br>
pkgdest = d.getVar('PKGDEST')<br>
packages = d.getVar('PACKAGES')<br>
rpmdeps = d.getVar('RPMDEPS')<br>
- magic = d.expand("${STAGING_DIR_<wbr>NATIVE}${datadir_native}/misc/<wbr>magic.mgc")<br>
<br>
def chunks(files, n):<br>
return [files[i:i+n] for i in range(0, len(files), n)]<br>
@@ -1482,7 +1481,7 @@ python package_do_filedeps() {<br>
if pkg.endswith('-dbg') or pkg.endswith('-doc') or pkg.find('-locale-') != -1 or pkg.find('-localedata-') != -1 or pkg.find('-gconv-') != -1 or pkg.find('-charmap-') != -1 or pkg.startswith('kernel-module-<wbr>') or pkg.endswith('-src'):<br>
continue<br>
for files in chunks(pkgfiles[pkg], 100):<br>
- pkglist.append((pkg, files, rpmdeps, pkgdest, magic))<br>
+ pkglist.append((pkg, files, rpmdeps, pkgdest))<br>
<br>
processed = oe.utils.multiprocess_exec( pkglist, oe.package.filedeprunner)<br>
<br>
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py<br>
index 43748b2..a79c668 100644<br>
--- a/meta/lib/oe/package.py<br>
+++ b/meta/lib/oe/package.py<br>
@@ -162,44 +162,68 @@ def file_translate(file):<br>
def filedeprunner(arg):<br>
import re, subprocess, shlex<br>
<br>
- (pkg, pkgfiles, rpmdeps, pkgdest, magic) = arg<br>
+ (pkg, pkgfiles, rpmdeps, pkgdest) = arg<br>
provides = {}<br>
requires = {}<br>
<br>
- r = re.compile(r'[<>=]+ +[^ ]*')<br>
+ file_re = re.compile(r'\s+\d+\s(.*)')<br>
+ dep_re = re.compile(r'\s+(\S)\s+(.*)')<br>
+ r = re.compile(r'[<>=]+\s+\S*')<br>
<br>
def process_deps(pipe, pkg, pkgdest, provides, requires):<br>
+ file = None<br>
for line in pipe:<br>
- f = line.decode("utf-8").split(" ", 1)[0].strip()<br>
- line = line.decode("utf-8").split(" ", 1)[1].strip()<br>
+ line = line.decode("utf-8")<br>
<br>
- if line.startswith("Requires:"):<br>
+ m = file_re.match(line)<br>
+ if m:<br>
+ file = m.group(1)<br>
+ file = file.replace(pkgdest + "/" + pkg, "")<br>
+ file = file_translate(file)<br>
+ continue<br>
+<br>
+ m = dep_re.match(line)<br>
+ if not m or not file:<br>
+ continue<br>
+<br>
+ type, dep = m.groups()<br>
+<br>
+ if type == 'R':<br>
i = requires<br>
- elif line.startswith("Provides:"):<br>
+ elif type == 'P':<br>
i = provides<br>
else:<br>
- continue<br>
+ continue<br>
<br>
- file = f.replace(pkgdest + "/" + pkg, "")<br>
- file = file_translate(file)<br>
- value = line.split(":", 1)[1].strip()<br>
- value = r.sub(r'(\g<0>)', value)<br>
+ if dep.startswith("python("):<br>
+ continue<br>
<br>
- if value.startswith("rpmlib("):<br>
+ # Ignore all perl(VMS::...) and perl(Mac::...) dependencies. These<br>
+ # are typically used conditionally from the Perl code, but are<br>
+ # generated as unconditional dependencies.<br>
+ if dep.startswith('perl(VMS::') or dep.startswith('perl(Mac::'):<br>
continue<br>
- if value == "python":<br>
+<br>
+ # Ignore perl dependencies on .pl files.<br>
+ if dep.startswith('perl(') and dep.endswith('.pl)'):<br>
continue<br>
+<br>
+ # Remove perl versions and perl module versions since they typically<br>
+ # do not make sense when used as package versions.<br>
+ if dep.startswith('perl') and r.search(dep):<br>
+ dep = dep.split()[0]<br>
+<br>
+ # Put parentheses around any version specifications.<br>
+ dep = r.sub(r'(\g<0>)',dep)<br>
+<br>
if file not in i:<br>
i[file] = []<br>
- i[file].append(value)<br>
+ i[file].append(dep)<br>
<br>
return provides, requires<br>
<br>
- env = os.environ.copy()<br>
- env["MAGIC"] = magic<br>
-<br>
try:<br>
- dep_popen = subprocess.Popen(shlex.split(<wbr>rpmdeps) + pkgfiles, stdout=subprocess.PIPE, env=env)<br>
+ dep_popen = subprocess.Popen(shlex.split(<wbr>rpmdeps) + pkgfiles, stdout=subprocess.PIPE)<br>
provides, requires = process_deps(dep_popen.stdout, pkg, pkgdest, provides, requires)<br>
except OSError as e:<br>
bb.error("rpmdeps: '%s' command failed, '%s'" % (shlex.split(rpmdeps) + pkgfiles, e))<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
To stop receiving notification emails like this one, please contact<br>
the administrator of this repository.<br>
--<br>
______________________________<wbr>_________________<br>
Openembedded-commits mailing list<br>
<a href="mailto:Openembedded-commits@lists.openembedded.org">Openembedded-commits@lists.<wbr>openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-commits" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>commits</a><br>
</font></span></blockquote></div><br></div>