]> code.ossystems Code Review - openembedded-core.git/commitdiff
populate_base_sdk: Stop running gcc --version all the time
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 4 Sep 2018 23:41:13 +0000 (00:41 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 5 Sep 2018 17:00:00 +0000 (18:00 +0100)
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@linuxfoundation.org>
meta/classes/populate_sdk_base.bbclass
meta/lib/oe/utils.py

index c456c52866a09b2367d35750c3ca5b569ab3d1b4..bbf1ff1cd2959f80a2c7d0e3d6dbb41656f51f00 100644 (file)
@@ -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
index f22a6ab596d3b9556b0efe71fad79da505f5378e..fbda7035f1e69355f6cd6e7161688d5596d49cf3 100644 (file)
@@ -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()