summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2019-03-07 11:41:22 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-03-07 21:55:29 +0000
commit09af407145e169860616e10b798145948b166591 (patch)
tree5a86b6ac675a194617f369b47248bb0b2168d416 /meta
parentb25608d4917aad45514a163f386e965938b0b83d (diff)
downloadpoky-09af407145e169860616e10b798145948b166591.tar.gz
insane.bbclass: Add configure-unsafe and configure-gettext
So that the errors can be controlled by ERROR_QA or WARN_QA, and make them work with INSANE_SKIP. (From OE-Core rev: 4b86ebb6a87f75421a1d12d9d5dde303938c2e9f) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/insane.bbclass28
1 files changed, 21 insertions, 7 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 2fd0ecc24b..a2adfee835 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 \
33 perms dep-cmp pkgvarcheck perm-config perm-line perm-link \ 33 perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
34 split-strip packages-list pkgv-undefined var-undefined \ 34 split-strip packages-list pkgv-undefined var-undefined \
35 version-going-backwards expanded-d invalid-chars \ 35 version-going-backwards expanded-d invalid-chars \
36 license-checksum dev-elf file-rdeps \ 36 license-checksum dev-elf file-rdeps configure-unsafe \
37 configure-gettext \
37 " 38 "
38# Add usrmerge QA check based on distro feature 39# Add usrmerge QA check based on distro feature
39ERROR_QA_append = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', ' usrmerge', '', d)}" 40ERROR_QA_append = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', ' usrmerge', '', d)}"
@@ -1059,15 +1060,22 @@ python do_qa_configure() {
1059 configs = [] 1060 configs = []
1060 workdir = d.getVar('WORKDIR') 1061 workdir = d.getVar('WORKDIR')
1061 1062
1062 if bb.data.inherits_class('autotools', d): 1063 skip = (d.getVar('INSANE_SKIP') or "").split()
1064 skip_configure_unsafe = False
1065 if 'configure-unsafe' in skip:
1066 bb.note("Recipe %s skipping qa checking: configure-unsafe" % d.getVar('PN'))
1067 skip_configure_unsafe = True
1068
1069 if bb.data.inherits_class('autotools', d) and not skip_configure_unsafe:
1063 bb.note("Checking autotools environment for common misconfiguration") 1070 bb.note("Checking autotools environment for common misconfiguration")
1064 for root, dirs, files in os.walk(workdir): 1071 for root, dirs, files in os.walk(workdir):
1065 statement = "grep -q -F -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s" % \ 1072 statement = "grep -q -F -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s" % \
1066 os.path.join(root,"config.log") 1073 os.path.join(root,"config.log")
1067 if "config.log" in files: 1074 if "config.log" in files:
1068 if subprocess.call(statement, shell=True) == 0: 1075 if subprocess.call(statement, shell=True) == 0:
1069 bb.fatal("""This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities. 1076 error_msg = """This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities.
1070Rerun configure task after fixing this.""") 1077Rerun configure task after fixing this."""
1078 package_qa_handle_error("configure-unsafe", error_msg, d)
1071 1079
1072 if "configure.ac" in files: 1080 if "configure.ac" in files:
1073 configs.append(os.path.join(root,"configure.ac")) 1081 configs.append(os.path.join(root,"configure.ac"))
@@ -1078,8 +1086,14 @@ Rerun configure task after fixing this.""")
1078 # Check gettext configuration and dependencies are correct 1086 # Check gettext configuration and dependencies are correct
1079 ########################################################################### 1087 ###########################################################################
1080 1088
1089 skip_configure_gettext = False
1090 if 'configure-gettext' in skip:
1091 bb.note("Recipe %s skipping qa checking: configure-gettext" % d.getVar('PN'))
1092 skip_configure_gettext = True
1093
1081 cnf = d.getVar('EXTRA_OECONF') or "" 1094 cnf = d.getVar('EXTRA_OECONF') or ""
1082 if "gettext" not in d.getVar('P') and "gcc-runtime" not in d.getVar('P') and "--disable-nls" not in cnf: 1095 if not ("gettext" in d.getVar('P') or "gcc-runtime" in d.getVar('P') or \
1096 "--disable-nls" in cnf or skip_configure_gettext):
1083 ml = d.getVar("MLPREFIX") or "" 1097 ml = d.getVar("MLPREFIX") or ""
1084 if bb.data.inherits_class('cross-canadian', d): 1098 if bb.data.inherits_class('cross-canadian', d):
1085 gt = "nativesdk-gettext" 1099 gt = "nativesdk-gettext"
@@ -1090,8 +1104,8 @@ Rerun configure task after fixing this.""")
1090 for config in configs: 1104 for config in configs:
1091 gnu = "grep \"^[[:space:]]*AM_GNU_GETTEXT\" %s >/dev/null" % config 1105 gnu = "grep \"^[[:space:]]*AM_GNU_GETTEXT\" %s >/dev/null" % config
1092 if subprocess.call(gnu, shell=True) == 0: 1106 if subprocess.call(gnu, shell=True) == 0:
1093 bb.fatal("""%s required but not in DEPENDS for file %s. 1107 error_msg = "%s required but not in DEPENDS for file %s. Missing inherit gettext?"
1094Missing inherit gettext?""" % (gt, config)) 1108 package_qa_handle_error("configure-gettext", error_msg, d)
1095 1109
1096 ########################################################################### 1110 ###########################################################################
1097 # Check unrecognised configure options (with a white list) 1111 # Check unrecognised configure options (with a white list)