<div dir="auto">Looks like &quot;readlink -f&quot; is failing. Can you try to capture the output and figure out why?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 20, 2019, 2:04 AM Martin Jansa &lt;<a href="mailto:martin.jansa@gmail.com">martin.jansa@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">* this might be related to:<br>
  commit d2fcaeb153fdc3f8d7143ea823139f1537055ff1<br>
  Author: Douglas Royds &lt;<a href="mailto:douglas.royds@taitradio.com" target="_blank" rel="noreferrer">douglas.royds@taitradio.com</a>&gt;<br>
  Date:   Thu Dec 20 11:59:47 2018 +1300<br>
<br>
    icecc: Don&#39;t generate recipe-sysroot symlinks at recipe-parsing time<br>
<br>
* it&#39;s still a bit unclear when and why this happends, but I&#39;m seeing<br>
  random tasks sometimes failing with:<br>
<br>
WARNING: Exception during build_dependencies for set_icecc_env<br>
WARNING: Error during finalise of /build/meta-oe/meta-python/recipes-devtools/python/<a href="http://python-markupsafe_1.0.bb" rel="noreferrer noreferrer" target="_blank">python-markupsafe_1.0.bb</a><br>
ERROR: Traceback (most recent call last):<br>
  File &quot;/build/bitbake/lib/bb/data_smart.py&quot;, line 411, in expandWithRefs<br>
    s = __expand_python_regexp__.sub(varparse.python_sub, s)<br>
  File &quot;/build/bitbake/lib/bb/data_smart.py&quot;, line 136, in python_sub<br>
    value = utils.better_eval(codeobj, DataContext(self.d), {&#39;d&#39; : self.d})<br>
  File &quot;/build/bitbake/lib/bb/utils.py&quot;, line 421, in better_eval<br>
    return eval(source, ctx, locals)<br>
  File &quot;Var &lt;set_icecc_env&gt;&quot;, line 1, in &lt;module&gt;<br>
  File &quot;/build/oe-core/meta/classes/icecc.bbclass&quot;, line 287, in icecc_get_and_check_tool<br>
    link_path = icecc_get_tool_link(t, d)<br>
  File &quot;/build/oe-core/meta/classes/icecc.bbclass&quot;, line 246, in icecc_get_tool_link<br>
    return subprocess.check_output(&quot;readlink -f %s&quot; % tool, shell=True).decode(&quot;utf-8&quot;)[:-1]<br>
  File &quot;/usr/lib/python3.6/subprocess.py&quot;, line 336, in check_output<br>
    **kwargs).stdout<br>
  File &quot;/usr/lib/python3.6/subprocess.py&quot;, line 418, in run<br>
    output=stdout, stderr=stderr)<br>
subprocess.CalledProcessError: Command &#39;readlink -f /build/BUILD/work/qemux86-oe-linux/python-markupsafe/1.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-g++&#39; returned non-zero exit status 1.<br>
<br>
The above exception was the direct cause of the following exception:<br>
<br>
Traceback (most recent call last):<br>
  File &quot;/build/bitbake/bin/bitbake-worker&quot;, line 239, in child<br>
    the_data = bb_cache.loadDataFull(fn, appends)<br>
  File &quot;/build/bitbake/lib/bb/cache.py&quot;, line 327, in loadDataFull<br>
    bb_data = self.load_bbfile(virtualfn, appends, virtonly=True)<br>
  File &quot;/build/bitbake/lib/bb/cache.py&quot;, line 340, in load_bbfile<br>
    datastores = parse_recipe(bb_data, bbfile, appends, mc)<br>
  File &quot;/build/bitbake/lib/bb/cache.py&quot;, line 303, in parse_recipe<br>
    bb_data = bb.parse.handle(bbfile, bb_data)<br>
  File &quot;/build/bitbake/lib/bb/parse/__init__.py&quot;, line 107, in handle<br>
    return h[&#39;handle&#39;](fn, data, include)<br>
  File &quot;/build/bitbake/lib/bb/parse/parse_py/BBHandler.py&quot;, line 142, in handle<br>
    return ast.multi_finalize(fn, d)<br>
  File &quot;/build/bitbake/lib/bb/parse/ast.py&quot;, line 386, in multi_finalize<br>
    finalize(fn, d)<br>
  File &quot;/build/bitbake/lib/bb/parse/ast.py&quot;, line 351, in finalize<br>
    bb.parse.siggen.finalise(fn, d, variant)<br>
  File &quot;/build/bitbake/lib/bb/siggen.py&quot;, line 147, in finalise<br>
    taskdeps = self._build_data(fn, d)<br>
  File &quot;/build/bitbake/lib/bb/siggen.py&quot;, line 118, in _build_data<br>
    tasklist, gendeps, lookupcache = bb.data.generate_dependencies(d)<br>
  File &quot;/build/bitbake/lib/bb/data.py&quot;, line 388, in generate_dependencies<br>
    deps[dep], values[dep] = build_dependencies(dep, keys, shelldeps, varflagsexcl, d)<br>
  File &quot;/build/bitbake/lib/bb/data.py&quot;, line 317, in build_dependencies<br>
    value, parsedvar = d.getVarFlag(key, &quot;_content&quot;, False, retparser=True)<br>
  File &quot;/build/bitbake/lib/bb/data_smart.py&quot;, line 802, in getVarFlag<br>
    parser = self.expandWithRefs(value, cachename)<br>
  File &quot;/build/bitbake/lib/bb/data_smart.py&quot;, line 424, in expandWithRefs<br>
    raise ExpansionError(varname, s, exc).with_traceback(tb) from exc<br>
  File &quot;/build/bitbake/lib/bb/data_smart.py&quot;, line 411, in expandWithRefs<br>
    s = __expand_python_regexp__.sub(varparse.python_sub, s)<br>
  File &quot;/build/bitbake/lib/bb/data_smart.py&quot;, line 136, in python_sub<br>
    value = utils.better_eval(codeobj, DataContext(self.d), {&#39;d&#39; : self.d})<br>
  File &quot;/build/bitbake/lib/bb/utils.py&quot;, line 421, in better_eval<br>
    return eval(source, ctx, locals)<br>
  File &quot;Var &lt;set_icecc_env&gt;&quot;, line 1, in &lt;module&gt;<br>
  File &quot;/build/oe-core/meta/classes/icecc.bbclass&quot;, line 287, in icecc_get_and_check_tool<br>
    link_path = icecc_get_tool_link(t, d)<br>
  File &quot;/build/oe-core/meta/classes/icecc.bbclass&quot;, line 246, in icecc_get_tool_link<br>
    return subprocess.check_output(&quot;readlink -f %s&quot; % tool, shell=True).decode(&quot;utf-8&quot;)[:-1]<br>
  File &quot;/usr/lib/python3.6/subprocess.py&quot;, line 336, in check_output<br>
    **kwargs).stdout<br>
  File &quot;/usr/lib/python3.6/subprocess.py&quot;, line 418, in run<br>
    output=stdout, stderr=stderr)<br>
bb.data_smart.ExpansionError: Failure expanding variable set_icecc_env, expression was     if [ &quot;${@use_icecc(bb, d)}&quot; = &quot;no&quot; ]<br>
    then<br>
        return<br>
    fi<br>
    ICECC_VERSION=&quot;${@icecc_version(bb, d)}&quot;<br>
    if [ &quot;x${ICECC_VERSION}&quot; = &quot;x&quot; ]<br>
    then<br>
        bbwarn &quot;Cannot use icecc: could not get ICECC_VERSION&quot;<br>
        return<br>
    fi<br>
<br>
    ICE_PATH=&quot;${@icecc_path(bb, d)}&quot;<br>
    if [ &quot;x${ICE_PATH}&quot; = &quot;x&quot; ]<br>
    then<br>
        bbwarn &quot;Cannot use icecc: could not get ICE_PATH&quot;<br>
        return<br>
    fi<br>
<br>
    ICECC_BIN=&quot;${@get_icecc(d)}&quot;<br>
    if [ -z &quot;${ICECC_BIN}&quot; ]; then<br>
        bbwarn &quot;Cannot use icecc: icecc binary not found&quot;<br>
        return<br>
    fi<br>
    if [ -z &quot;$(which patchelf patchelf-uninative)&quot; ]; then<br>
        bbwarn &quot;Cannot use icecc: patchelf not found&quot;<br>
        return<br>
    fi<br>
<br>
    # Create symlinks to icecc in the recipe-sysroot directory<br>
    mkdir -p ${ICE_PATH}<br>
    if [ -n &quot;${KERNEL_CC}&quot; ]; then<br>
        compilers=&quot;${@get_cross_kernel_cc(bb,d)}&quot;<br>
    else<br>
        compilers=&quot;x86_64-oe-linux-gcc x86_64-oe-linux-g++&quot;<br>
    fi<br>
    for compiler in $compilers; do<br>
        ln -sf ${ICECC_BIN} ${ICE_PATH}/$compiler<br>
    done<br>
<br>
    ICECC_CC=&quot;${@icecc_get_and_check_tool(bb, d, &quot;gcc&quot;)}&quot;<br>
    ICECC_CXX=&quot;${@icecc_get_and_check_tool(bb, d, &quot;g++&quot;)}&quot;<br>
    # cannot use icecc_get_and_check_tool here because it assumes as without target_sys prefix<br>
    ICECC_WHICH_AS=&quot;${@bb.utils.which(os.getenv(&#39;PATH&#39;), &#39;as&#39;)}&quot;<br>
    if [ ! -x &quot;${ICECC_CC}&quot; -o ! -x &quot;${ICECC_CXX}&quot; ]<br>
    then<br>
        bbwarn &quot;Cannot use icecc: could not get ICECC_CC or ICECC_CXX&quot;<br>
        return<br>
    fi<br>
<br>
    ICE_VERSION=`$ICECC_CC -dumpversion`<br>
    ICECC_VERSION=`echo ${ICECC_VERSION} | sed -e &quot;s/@VERSION@/$ICE_VERSION/g&quot;`<br>
    if [ ! -x &quot;/build/BUILD/work/qemux86-oe-linux/python-markupsafe/1.0-r0/recipe-sysroot-native/usr/bin/icecc-create-env&quot; ]<br>
    then<br>
        bbwarn &quot;Cannot use icecc: invalid ICECC_ENV_EXEC&quot;<br>
        return<br>
    fi<br>
<br>
    ICECC_AS=&quot;`${ICECC_CC} -print-prog-name=as`&quot;<br>
    # for target recipes should return something like:<br>
    # /OE/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm920tt-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.8.2/as<br>
    # and just &quot;as&quot; for native, if it returns &quot;as&quot; in current directory (for whatever reason) use &quot;as&quot; from PATH<br>
    if [ &quot;`dirname &quot;${ICECC_AS}&quot;`&quot; = &quot;.&quot; ]<br>
    then<br>
        ICECC_AS=&quot;${ICECC_WHICH_AS}&quot;<br>
    fi<br>
<br>
    if [ ! -f &quot;${ICECC_VERSION}.done&quot; ]<br>
    then<br>
        mkdir -p &quot;`dirname &quot;${ICECC_VERSION}&quot;`&quot;<br>
<br>
        # the ICECC_VERSION generation step must be locked by a mutex<br>
        # in order to prevent race conditions<br>
        if flock -n &quot;${ICECC_VERSION}.lock&quot; \<br>
            /build/BUILD/work/qemux86-oe-linux/python-markupsafe/1.0-r0/recipe-sysroot-native/usr/bin/icecc-create-env  &quot;${ICECC_CC}&quot; &quot;${ICECC_CXX}&quot; &quot;${ICECC_AS}&quot; &quot;${ICECC_VERSION}&quot;<br>
        then<br>
            touch &quot;${ICECC_VERSION}.done&quot;<br>
        elif ! wait_for_file &quot;${ICECC_VERSION}.done&quot; 30<br>
        then<br>
            # locking failed so wait for ${ICECC_VERSION}.done to appear<br>
            bbwarn &quot;Timeout waiting for ${ICECC_VERSION}.done&quot;<br>
            return<br>
        fi<br>
    fi<br>
<br>
    # Don&#39;t let ccache find the icecream compiler links that have been created, otherwise<br>
    # it can end up invoking icecream recursively.<br>
    export CCACHE_PATH=&quot;$PATH&quot;<br>
    export CCACHE_DISABLE=&quot;1&quot;<br>
<br>
    export ICECC_VERSION ICECC_CC ICECC_CXX<br>
    export PATH=&quot;$ICE_PATH:$PATH&quot;<br>
<br>
    bbnote &quot;Using icecc path: $ICE_PATH&quot;<br>
    bbnote &quot;Using icecc tarball: $ICECC_VERSION&quot;<br>
 which triggered exception CalledProcessError: Command &#39;readlink -f /build/BUILD/work/qemux86-oe-linux/python-markupsafe/1.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-g++&#39; returned non-zero exit status 1.<br>
<br>
ERROR: Task (virtual:multilib:lib32:/build/meta-oe/meta-python/recipes-devtools/python/python-markupsafe_1.0.bb:do_patch) failed with exit code &#39;1&#39;<br>
<br>
Signed-off-by: Martin Jansa &lt;<a href="mailto:Martin.Jansa@gmail.com" target="_blank" rel="noreferrer">Martin.Jansa@gmail.com</a>&gt;<br>
---<br>
 meta/classes/icecc.bbclass | 6 +++++-<br>
 1 file changed, 5 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass<br>
index edb0e10434..63d8b4dfee 100644<br>
--- a/meta/classes/icecc.bbclass<br>
+++ b/meta/classes/icecc.bbclass<br>
@@ -243,7 +243,11 @@ def icecc_get_external_tool(bb, d, tool):<br>
<br>
 def icecc_get_tool_link(tool, d):<br>
     import subprocess<br>
-    return subprocess.check_output(&quot;readlink -f %s&quot; % tool, shell=True).decode(&quot;utf-8&quot;)[:-1]<br>
+    try:<br>
+        return subprocess.check_output(&quot;readlink -f %s&quot; % tool, shell=True).decode(&quot;utf-8&quot;)[:-1]<br>
+    except subprocess.CalledProcessError as e:<br>
+        bb.note(&quot;icecc: one of the tools probably disappeared during recipe parsing, cmd readlink -f %s returned %d:\n%s&quot; % (tool, e.returncode, e.output.decode(&quot;utf-8&quot;)))<br>
+        return tool<br>
<br>
 def icecc_get_path_tool(tool, d):<br>
     # This is a little ugly, but we want to make sure we add an actual<br>
-- <br>
2.17.1<br>
<br>
-- <br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank" rel="noreferrer">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</blockquote></div>