[oe-commits] [openembedded-core] 26/26: populate_base_sdk: Stop running gcc --version all the time

git at git.openembedded.org git at git.openembedded.org
Wed Sep 5 17:02:32 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit bf49316bb9913b7c89de64d6a194be31aa66e16b
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Wed Sep 5 00:41:13 2018 +0100

    populate_base_sdk: Stop running gcc --version all the time
    
    Running 'gcc --version' for every image recipe is slow and increases parsing
    time/resource usage for no good reason. Only compute the value in when we're
    really running the task/function.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/populate_sdk_base.bbclass | 2 +-
 meta/lib/oe/utils.py                   | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index c456c52..bbf1ff1 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -259,7 +259,7 @@ EOF
 		-e 's#@SDK_VERSION@#${SDK_VERSION}#g' \
 		-e '/@SDK_PRE_INSTALL_COMMAND@/d' \
 		-e '/@SDK_POST_INSTALL_COMMAND@/d' \
-		-e 's#@SDK_GCC_VER@#${@oe.utils.host_gcc_version(d)}#g' \
+		-e 's#@SDK_GCC_VER@#${@oe.utils.host_gcc_version(d, taskcontextonly=True)}#g' \
 		${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.sh
 
 	# add execution permission
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index f22a6ab..fbda703 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -342,9 +342,12 @@ def format_pkg_list(pkg_dict, ret_format=None):
 
     return '\n'.join(output)
 
-def host_gcc_version(d):
+def host_gcc_version(d, taskcontextonly=False):
     import re, subprocess
 
+    if taskcontextonly and d.getVar('BB_WORKERCONTEXT') != '1':
+        return
+
     compiler = d.getVar("BUILD_CC")
     try:
         env = os.environ.copy()

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list