Skip to contentSkip to conversation

insane.bbclass: fix package_qa_check_buildpaths

PATCH In review Robert Yang 1 participant 7 messages Jul 15, 2015 – Sep 6, 2015

lore
Share & tools
lore
#0 lore raw

cover insane.bbclass: fix package_qa_check_buildpaths

The following changes since commit 6be698b7270f73f40d38713ecf13f12aec0ced61:

dpkg: Fix for Fedora22 and new versions of tar (2015-07-13 13:46:45 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/buildpath
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/buildpath

Robert Yang (2):
insane.bbclass: fix package_qa_check_buildpaths insane.bbclass: make package_qa_clean_path return a relative path

 meta/classes/insane.bbclass |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/2 insane.bbclass: fix package_qa_check_buildpaths

* Ignore elf files because they usually contain build path:
- The path of the source file such as .c, these are usually happen when separate B and S since we use absolute path to run configure script, and then VPATH in Makefile will be an absolute path and contains build path, we can use relative path in autotools.bbclass to fix the problem, but we don't have to since they are harmless.
- The configure options such as "configure --with-libtool-sysroot"
- The compile options such as "gcc --sysroot"
These are harmless usually, so ignore elf files.

* Ignore "-dbg" and "-staticdev" package since symbols and .a files usually contain buildpath.

* Ignore .a files too since they contain buildpath, this mainly for ignoring:
glibc-2.21: glibc-dev/usr/lib/libc_nonshared.a libgcc-4.9.3: libgcc-dev/usr/lib/x86_64-poky-linux/4.9.3/libgcc_eh.a gcc-runtime-4.9.3: libssp-dev/usr/lib/libssp_nonshared.a

* Use full path rather than package_qa_clean_path() when report issue, this makes it easier to find the file and fix the problem.

Then we will verify other warings and fix one be one.

---
 meta/classes/insane.bbclass |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
meta/classes/insane.bbclass +9 -3
index 4537eec..f1eb60a 100644
@@ -566,8 +566,14 @@ def package_qa_check_buildpaths(path, name, d, elf, messages):
     """
     Check for build paths inside target files and error if not found in the whitelist
     """
-    # Ignore .debug files, not interesting
-    if path.find(".debug") != -1:
+
+    # Ignore staticdev and debug files since symbols and .a usually
+    # contain buildpath.
+    if name.endswith("-dbg") or name.endswith("-staticdev"):
+        return
+
+    # Ignore elf and .a files
+    if elf or path.endswith('.a'):
         return
 
     # Ignore symlinks
@@ -578,7 +584,7 @@ def package_qa_check_buildpaths(path, name, d, elf, messages):
     with open(path) as f:
         file_content = f.read()
         if tmpdir in file_content:
-            messages["buildpaths"] = "File %s in package contained reference to tmpdir" % package_qa_clean_path(path,d)
+            messages["buildpaths"] = "File %s in package contained reference to tmpdir" % path
 
 
 QAPATHTEST[xorg-driver-abi] = "package_qa_check_xorg_driver_abi"
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/2 insane.bbclass: make package_qa_clean_path return a relative path

In reply to Robert Yang

Make package_qa_clean_path() return something like "work/path/to/file" rather than "/work/path/to/file", the relative path is a little clear.

---
 meta/classes/insane.bbclass |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/insane.bbclass +1 -1
index f1eb60a..5290686 100644
@@ -161,7 +161,7 @@ def package_qa_get_machine_dict():
 
 def package_qa_clean_path(path,d):
     """ Remove the common prefix from the path. In this case it is the TMPDIR"""
-    return path.replace(d.getVar('TMPDIR',True),"")
+    return path.replace(d.getVar("TMPDIR", True) + "/", "")
 
 def package_qa_write_error(type, error, d):
     logfile = d.getVar('QA_LOGFILE', True)
Signature · 1 line
1.7.9.5
#3 lore raw
In reply to Robert Yang

ping.

// Robert

Quoted 16 lines · Robert Yang

The following changes since commit 6be698b7270f73f40d38713ecf13f12aec0ced61:

dpkg: Fix for Fedora22 and new versions of tar (2015-07-13 13:46:45 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/buildpath
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/buildpath

Robert Yang (2):
insane.bbclass: fix package_qa_check_buildpaths insane.bbclass: make package_qa_clean_path return a relative path

  meta/classes/insane.bbclass |   14 ++++++++++----
  1 file changed, 10 insertions(+), 4 deletions(-)
#4 lore raw
In reply to Robert Yang

Ping.

// Robert

Quoted 16 lines · Robert Yang

The following changes since commit 6be698b7270f73f40d38713ecf13f12aec0ced61:

dpkg: Fix for Fedora22 and new versions of tar (2015-07-13 13:46:45 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/buildpath
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/buildpath

Robert Yang (2):
insane.bbclass: fix package_qa_check_buildpaths insane.bbclass: make package_qa_clean_path return a relative path

  meta/classes/insane.bbclass |   14 ++++++++++----
  1 file changed, 10 insertions(+), 4 deletions(-)
#5 lore raw
In reply to Robert Yang

ping.

// Robert

Quoted 16 lines · Robert Yang

The following changes since commit 6be698b7270f73f40d38713ecf13f12aec0ced61:

dpkg: Fix for Fedora22 and new versions of tar (2015-07-13 13:46:45 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/buildpath
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/buildpath

Robert Yang (2):
insane.bbclass: fix package_qa_check_buildpaths insane.bbclass: make package_qa_clean_path return a relative path

  meta/classes/insane.bbclass |   14 ++++++++++----
  1 file changed, 10 insertions(+), 4 deletions(-)
#6 lore raw
In reply to Robert Yang

Hello, any comments on this please ?

// Robert

Quoted 16 lines · Robert Yang

The following changes since commit 6be698b7270f73f40d38713ecf13f12aec0ced61:

dpkg: Fix for Fedora22 and new versions of tar (2015-07-13 13:46:45 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/buildpath
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/buildpath

Robert Yang (2):
insane.bbclass: fix package_qa_check_buildpaths insane.bbclass: make package_qa_clean_path return a relative path

  meta/classes/insane.bbclass |   14 ++++++++++----
  1 file changed, 10 insertions(+), 4 deletions(-)