Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] insane.bbclass: Fixes for do_qa_configure and qa_check_staged.
@ 2019-03-07  3:41 Robert Yang
  2019-03-07  3:41 ` [PATCH 1/2] insane.bbclass: Make INSANE_SKIP work for qa pkgconfig and la Robert Yang
  2019-03-07  3:41 ` [PATCH 2/2] insane.bbclass: Add configure-unsafe and configure-gettext Robert Yang
  0 siblings, 2 replies; 4+ messages in thread
From: Robert Yang @ 2019-03-07  3:41 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 0a306d4f706b55f64228c7a0a14ff1ad127d7df9:

  scripts: Add oe-pylint (2019-03-06 23:12:06 +0000)

are available in the git repository at:

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

Robert Yang (2):
  insane.bbclass: Make INSANE_SKIP work for qa pkgconfig and la
  insane.bbclass: Add configure-unsafe and configure-gettext

 meta/classes/insane.bbclass | 48 +++++++++++++++++++++++++++++++++------------
 1 file changed, 36 insertions(+), 12 deletions(-)

-- 
2.7.4



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] insane.bbclass: Make INSANE_SKIP work for qa pkgconfig and la
  2019-03-07  3:41 [PATCH 0/2] insane.bbclass: Fixes for do_qa_configure and qa_check_staged Robert Yang
@ 2019-03-07  3:41 ` Robert Yang
  2019-03-07  4:07   ` Andre McCurdy
  2019-03-07  3:41 ` [PATCH 2/2] insane.bbclass: Add configure-unsafe and configure-gettext Robert Yang
  1 sibling, 1 reply; 4+ messages in thread
From: Robert Yang @ 2019-03-07  3:41 UTC (permalink / raw)
  To: openembedded-core

The INSANE_SKIP = "pkgconfig" or "la" didn't work, this patch fixes the problem.

[YOCTO #13087]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/classes/insane.bbclass | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 6411884..fd9c5f0 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -570,7 +570,7 @@ python populate_lic_qa_checksum() {
         bb.fatal("Fatal QA errors found, failing task.")
 }
 
-def package_qa_check_staged(path,d):
+def qa_check_staged(path,d):
     """
     Check staged la and pc files for common problems like references to the work
     directory.
@@ -589,20 +589,31 @@ def package_qa_check_staged(path,d):
     else:
         pkgconfigcheck = tmpdir
 
+    skip = (d.getVar('INSANE_SKIP') or "").split()
+    skip_la = False
+    if 'la' in skip:
+        bb.note("Recipe %s skipping qa chekcing: la" % d.getVar('PN'))
+        skip_la = True
+
+    skip_pkgconfig = False
+    if 'pkgconfig' in skip:
+        bb.note("Recipe %s skipping qa chekcing: pkgconfig" % d.getVar('PN'))
+        skip_pkgconfig = True
+
     # find all .la and .pc files
     # read the content
     # and check for stuff that looks wrong
     for root, dirs, files in os.walk(path):
         for file in files:
             path = os.path.join(root,file)
-            if file.endswith(".la"):
+            if file.endswith(".la") and not skip_la:
                 with open(path) as f:
                     file_content = f.read()
                     file_content = file_content.replace(recipesysroot, "")
                     if workdir in file_content:
                         error_msg = "%s failed sanity test (workdir) in path %s" % (file,root)
                         sane &= package_qa_handle_error("la", error_msg, d)
-            elif file.endswith(".pc"):
+            elif file.endswith(".pc") and not skip_pkgconfig:
                 with open(path) as f:
                     file_content = f.read()
                     file_content = file_content.replace(recipesysroot, "")
@@ -1034,8 +1045,7 @@ addtask do_package_qa_setscene
 
 python do_qa_staging() {
     bb.note("QA checking staging")
-
-    if not package_qa_check_staged(d.expand('${SYSROOT_DESTDIR}${libdir}'), d):
+    if not qa_check_staged(d.expand('${SYSROOT_DESTDIR}${libdir}'), d):
         bb.fatal("QA staging was broken by the package built above")
 }
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] insane.bbclass: Add configure-unsafe and configure-gettext
  2019-03-07  3:41 [PATCH 0/2] insane.bbclass: Fixes for do_qa_configure and qa_check_staged Robert Yang
  2019-03-07  3:41 ` [PATCH 1/2] insane.bbclass: Make INSANE_SKIP work for qa pkgconfig and la Robert Yang
@ 2019-03-07  3:41 ` Robert Yang
  1 sibling, 0 replies; 4+ messages in thread
From: Robert Yang @ 2019-03-07  3:41 UTC (permalink / raw)
  To: openembedded-core

So that the errors can be controlled by ERROR_QA or WARN_QA, and make them work
with INSANE_SKIP.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/classes/insane.bbclass | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index fd9c5f0..fedf2c9 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -33,7 +33,8 @@ ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
             perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
             split-strip packages-list pkgv-undefined var-undefined \
             version-going-backwards expanded-d invalid-chars \
-            license-checksum dev-elf file-rdeps \
+            license-checksum dev-elf file-rdeps configure-unsafe \
+            configure-gettext \
             "
 # Add usrmerge QA check based on distro feature
 ERROR_QA_append = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', ' usrmerge', '', d)}"
@@ -1059,15 +1060,22 @@ python do_qa_configure() {
     configs = []
     workdir = d.getVar('WORKDIR')
 
-    if bb.data.inherits_class('autotools', d):
+    skip = (d.getVar('INSANE_SKIP') or "").split()
+    skip_configure_unsafe = False
+    if 'configure-unsafe' in skip:
+        bb.note("Recipe %s skipping qa chekcing: configure-unsafe" % d.getVar('PN'))
+        skip_configure_unsafe = True
+
+    if bb.data.inherits_class('autotools', d) and not skip_configure_unsafe:
         bb.note("Checking autotools environment for common misconfiguration")
         for root, dirs, files in os.walk(workdir):
             statement = "grep -q -F -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s" % \
                         os.path.join(root,"config.log")
             if "config.log" in files:
                 if subprocess.call(statement, shell=True) == 0:
-                    bb.fatal("""This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities.
-Rerun configure task after fixing this.""")
+                    error_msg = """This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities.
+Rerun configure task after fixing this."""
+                    package_qa_handle_error("configure-unsafe", error_msg, d)
 
             if "configure.ac" in files:
                 configs.append(os.path.join(root,"configure.ac"))
@@ -1078,8 +1086,14 @@ Rerun configure task after fixing this.""")
     # Check gettext configuration and dependencies are correct
     ###########################################################################
 
+    skip_configure_gettext = False
+    if 'configure-gettext' in skip:
+        bb.note("Recipe %s skipping qa chekcing: configure-gettext" % d.getVar('PN'))
+        skip_configure_gettext = True
+
     cnf = d.getVar('EXTRA_OECONF') or ""
-    if "gettext" not in d.getVar('P') and "gcc-runtime" not in d.getVar('P') and "--disable-nls" not in cnf:
+    if not ("gettext" in d.getVar('P') or "gcc-runtime" in d.getVar('P') or \
+            "--disable-nls" in cnf or skip_configure_gettext):
         ml = d.getVar("MLPREFIX") or ""
         if bb.data.inherits_class('cross-canadian', d):
             gt = "nativesdk-gettext"
@@ -1090,8 +1104,8 @@ Rerun configure task after fixing this.""")
             for config in configs:
                 gnu = "grep \"^[[:space:]]*AM_GNU_GETTEXT\" %s >/dev/null" % config
                 if subprocess.call(gnu, shell=True) == 0:
-                    bb.fatal("""%s required but not in DEPENDS for file %s.
-Missing inherit gettext?""" % (gt, config))
+                    error_msg = "%s required but not in DEPENDS for file %s. Missing inherit gettext?"
+                    package_qa_handle_error("configure-gettext", error_msg, d)
 
     ###########################################################################
     # Check unrecognised configure options (with a white list)
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] insane.bbclass: Make INSANE_SKIP work for qa pkgconfig and la
  2019-03-07  3:41 ` [PATCH 1/2] insane.bbclass: Make INSANE_SKIP work for qa pkgconfig and la Robert Yang
@ 2019-03-07  4:07   ` Andre McCurdy
  0 siblings, 0 replies; 4+ messages in thread
From: Andre McCurdy @ 2019-03-07  4:07 UTC (permalink / raw)
  To: Robert Yang; +Cc: OE Core mailing list

On Wed, Mar 6, 2019 at 7:22 PM Robert Yang <liezhi.yang@windriver.com> wrote:
>
> The INSANE_SKIP = "pkgconfig" or "la" didn't work, this patch fixes the problem.
>
> [YOCTO #13087]
>
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> ---
>  meta/classes/insane.bbclass | 20 +++++++++++++++-----
>  1 file changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
> index 6411884..fd9c5f0 100644
> --- a/meta/classes/insane.bbclass
> +++ b/meta/classes/insane.bbclass
> @@ -570,7 +570,7 @@ python populate_lic_qa_checksum() {
>          bb.fatal("Fatal QA errors found, failing task.")
>  }
>
> -def package_qa_check_staged(path,d):
> +def qa_check_staged(path,d):
>      """
>      Check staged la and pc files for common problems like references to the work
>      directory.
> @@ -589,20 +589,31 @@ def package_qa_check_staged(path,d):
>      else:
>          pkgconfigcheck = tmpdir
>
> +    skip = (d.getVar('INSANE_SKIP') or "").split()
> +    skip_la = False
> +    if 'la' in skip:
> +        bb.note("Recipe %s skipping qa chekcing: la" % d.getVar('PN'))

Typo (copied and pasted in various other places too).

> +        skip_la = True
> +
> +    skip_pkgconfig = False
> +    if 'pkgconfig' in skip:
> +        bb.note("Recipe %s skipping qa chekcing: pkgconfig" % d.getVar('PN'))
> +        skip_pkgconfig = True
> +
>      # find all .la and .pc files
>      # read the content
>      # and check for stuff that looks wrong
>      for root, dirs, files in os.walk(path):
>          for file in files:
>              path = os.path.join(root,file)
> -            if file.endswith(".la"):
> +            if file.endswith(".la") and not skip_la:
>                  with open(path) as f:
>                      file_content = f.read()
>                      file_content = file_content.replace(recipesysroot, "")
>                      if workdir in file_content:
>                          error_msg = "%s failed sanity test (workdir) in path %s" % (file,root)
>                          sane &= package_qa_handle_error("la", error_msg, d)
> -            elif file.endswith(".pc"):
> +            elif file.endswith(".pc") and not skip_pkgconfig:
>                  with open(path) as f:
>                      file_content = f.read()
>                      file_content = file_content.replace(recipesysroot, "")
> @@ -1034,8 +1045,7 @@ addtask do_package_qa_setscene
>
>  python do_qa_staging() {
>      bb.note("QA checking staging")
> -
> -    if not package_qa_check_staged(d.expand('${SYSROOT_DESTDIR}${libdir}'), d):
> +    if not qa_check_staged(d.expand('${SYSROOT_DESTDIR}${libdir}'), d):
>          bb.fatal("QA staging was broken by the package built above")
>  }
>
> --
> 2.7.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-07  4:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-07  3:41 [PATCH 0/2] insane.bbclass: Fixes for do_qa_configure and qa_check_staged Robert Yang
2019-03-07  3:41 ` [PATCH 1/2] insane.bbclass: Make INSANE_SKIP work for qa pkgconfig and la Robert Yang
2019-03-07  4:07   ` Andre McCurdy
2019-03-07  3:41 ` [PATCH 2/2] insane.bbclass: Add configure-unsafe and configure-gettext Robert Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox