All of lore.kernel.org
 help / color / mirror / Atom feed
* [warrior][PATCH 1/3] icecc.bbclass: catch subprocess.CalledProcessError
@ 2019-08-20  9:04 Martin Jansa
  2019-08-20  9:04 ` [warrior][PATCH 2/3] meson: backport fix for builds with -Werror=return-type Martin Jansa
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Martin Jansa @ 2019-08-20  9:04 UTC (permalink / raw)
  To: openembedded-core

* this might be related to:
  commit d2fcaeb153fdc3f8d7143ea823139f1537055ff1
  Author: Douglas Royds <douglas.royds@taitradio.com>
  Date:   Thu Dec 20 11:59:47 2018 +1300

    icecc: Don't generate recipe-sysroot symlinks at recipe-parsing time

* it's still a bit unclear when and why this happends, but I'm seeing
  random tasks sometimes failing with:

WARNING: Exception during build_dependencies for set_icecc_env
WARNING: Error during finalise of /build/meta-oe/meta-python/recipes-devtools/python/python-markupsafe_1.0.bb
ERROR: Traceback (most recent call last):
  File "/build/bitbake/lib/bb/data_smart.py", line 411, in expandWithRefs
    s = __expand_python_regexp__.sub(varparse.python_sub, s)
  File "/build/bitbake/lib/bb/data_smart.py", line 136, in python_sub
    value = utils.better_eval(codeobj, DataContext(self.d), {'d' : self.d})
  File "/build/bitbake/lib/bb/utils.py", line 421, in better_eval
    return eval(source, ctx, locals)
  File "Var <set_icecc_env>", line 1, in <module>
  File "/build/oe-core/meta/classes/icecc.bbclass", line 287, in icecc_get_and_check_tool
    link_path = icecc_get_tool_link(t, d)
  File "/build/oe-core/meta/classes/icecc.bbclass", line 246, in icecc_get_tool_link
    return subprocess.check_output("readlink -f %s" % tool, shell=True).decode("utf-8")[:-1]
  File "/usr/lib/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '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++' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/build/bitbake/bin/bitbake-worker", line 239, in child
    the_data = bb_cache.loadDataFull(fn, appends)
  File "/build/bitbake/lib/bb/cache.py", line 327, in loadDataFull
    bb_data = self.load_bbfile(virtualfn, appends, virtonly=True)
  File "/build/bitbake/lib/bb/cache.py", line 340, in load_bbfile
    datastores = parse_recipe(bb_data, bbfile, appends, mc)
  File "/build/bitbake/lib/bb/cache.py", line 303, in parse_recipe
    bb_data = bb.parse.handle(bbfile, bb_data)
  File "/build/bitbake/lib/bb/parse/__init__.py", line 107, in handle
    return h['handle'](fn, data, include)
  File "/build/bitbake/lib/bb/parse/parse_py/BBHandler.py", line 142, in handle
    return ast.multi_finalize(fn, d)
  File "/build/bitbake/lib/bb/parse/ast.py", line 386, in multi_finalize
    finalize(fn, d)
  File "/build/bitbake/lib/bb/parse/ast.py", line 351, in finalize
    bb.parse.siggen.finalise(fn, d, variant)
  File "/build/bitbake/lib/bb/siggen.py", line 147, in finalise
    taskdeps = self._build_data(fn, d)
  File "/build/bitbake/lib/bb/siggen.py", line 118, in _build_data
    tasklist, gendeps, lookupcache = bb.data.generate_dependencies(d)
  File "/build/bitbake/lib/bb/data.py", line 388, in generate_dependencies
    deps[dep], values[dep] = build_dependencies(dep, keys, shelldeps, varflagsexcl, d)
  File "/build/bitbake/lib/bb/data.py", line 317, in build_dependencies
    value, parsedvar = d.getVarFlag(key, "_content", False, retparser=True)
  File "/build/bitbake/lib/bb/data_smart.py", line 802, in getVarFlag
    parser = self.expandWithRefs(value, cachename)
  File "/build/bitbake/lib/bb/data_smart.py", line 424, in expandWithRefs
    raise ExpansionError(varname, s, exc).with_traceback(tb) from exc
  File "/build/bitbake/lib/bb/data_smart.py", line 411, in expandWithRefs
    s = __expand_python_regexp__.sub(varparse.python_sub, s)
  File "/build/bitbake/lib/bb/data_smart.py", line 136, in python_sub
    value = utils.better_eval(codeobj, DataContext(self.d), {'d' : self.d})
  File "/build/bitbake/lib/bb/utils.py", line 421, in better_eval
    return eval(source, ctx, locals)
  File "Var <set_icecc_env>", line 1, in <module>
  File "/build/oe-core/meta/classes/icecc.bbclass", line 287, in icecc_get_and_check_tool
    link_path = icecc_get_tool_link(t, d)
  File "/build/oe-core/meta/classes/icecc.bbclass", line 246, in icecc_get_tool_link
    return subprocess.check_output("readlink -f %s" % tool, shell=True).decode("utf-8")[:-1]
  File "/usr/lib/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
bb.data_smart.ExpansionError: Failure expanding variable set_icecc_env, expression was     if [ "${@use_icecc(bb, d)}" = "no" ]
    then
        return
    fi
    ICECC_VERSION="${@icecc_version(bb, d)}"
    if [ "x${ICECC_VERSION}" = "x" ]
    then
        bbwarn "Cannot use icecc: could not get ICECC_VERSION"
        return
    fi

    ICE_PATH="${@icecc_path(bb, d)}"
    if [ "x${ICE_PATH}" = "x" ]
    then
        bbwarn "Cannot use icecc: could not get ICE_PATH"
        return
    fi

    ICECC_BIN="${@get_icecc(d)}"
    if [ -z "${ICECC_BIN}" ]; then
        bbwarn "Cannot use icecc: icecc binary not found"
        return
    fi
    if [ -z "$(which patchelf patchelf-uninative)" ]; then
        bbwarn "Cannot use icecc: patchelf not found"
        return
    fi

    # Create symlinks to icecc in the recipe-sysroot directory
    mkdir -p ${ICE_PATH}
    if [ -n "${KERNEL_CC}" ]; then
        compilers="${@get_cross_kernel_cc(bb,d)}"
    else
        compilers="x86_64-oe-linux-gcc x86_64-oe-linux-g++"
    fi
    for compiler in $compilers; do
        ln -sf ${ICECC_BIN} ${ICE_PATH}/$compiler
    done

    ICECC_CC="${@icecc_get_and_check_tool(bb, d, "gcc")}"
    ICECC_CXX="${@icecc_get_and_check_tool(bb, d, "g++")}"
    # cannot use icecc_get_and_check_tool here because it assumes as without target_sys prefix
    ICECC_WHICH_AS="${@bb.utils.which(os.getenv('PATH'), 'as')}"
    if [ ! -x "${ICECC_CC}" -o ! -x "${ICECC_CXX}" ]
    then
        bbwarn "Cannot use icecc: could not get ICECC_CC or ICECC_CXX"
        return
    fi

    ICE_VERSION=`$ICECC_CC -dumpversion`
    ICECC_VERSION=`echo ${ICECC_VERSION} | sed -e "s/@VERSION@/$ICE_VERSION/g"`
    if [ ! -x "/build/BUILD/work/qemux86-oe-linux/python-markupsafe/1.0-r0/recipe-sysroot-native/usr/bin/icecc-create-env" ]
    then
        bbwarn "Cannot use icecc: invalid ICECC_ENV_EXEC"
        return
    fi

    ICECC_AS="`${ICECC_CC} -print-prog-name=as`"
    # for target recipes should return something like:
    # /OE/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm920tt-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.8.2/as
    # and just "as" for native, if it returns "as" in current directory (for whatever reason) use "as" from PATH
    if [ "`dirname "${ICECC_AS}"`" = "." ]
    then
        ICECC_AS="${ICECC_WHICH_AS}"
    fi

    if [ ! -f "${ICECC_VERSION}.done" ]
    then
        mkdir -p "`dirname "${ICECC_VERSION}"`"

        # the ICECC_VERSION generation step must be locked by a mutex
        # in order to prevent race conditions
        if flock -n "${ICECC_VERSION}.lock" \
            /build/BUILD/work/qemux86-oe-linux/python-markupsafe/1.0-r0/recipe-sysroot-native/usr/bin/icecc-create-env  "${ICECC_CC}" "${ICECC_CXX}" "${ICECC_AS}" "${ICECC_VERSION}"
        then
            touch "${ICECC_VERSION}.done"
        elif ! wait_for_file "${ICECC_VERSION}.done" 30
        then
            # locking failed so wait for ${ICECC_VERSION}.done to appear
            bbwarn "Timeout waiting for ${ICECC_VERSION}.done"
            return
        fi
    fi

    # Don't let ccache find the icecream compiler links that have been created, otherwise
    # it can end up invoking icecream recursively.
    export CCACHE_PATH="$PATH"
    export CCACHE_DISABLE="1"

    export ICECC_VERSION ICECC_CC ICECC_CXX
    export PATH="$ICE_PATH:$PATH"

    bbnote "Using icecc path: $ICE_PATH"
    bbnote "Using icecc tarball: $ICECC_VERSION"
 which triggered exception CalledProcessError: Command '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++' returned non-zero exit status 1.

ERROR: Task (virtual:multilib:lib32:/build/meta-oe/meta-python/recipes-devtools/python/python-markupsafe_1.0.bb:do_patch) failed with exit code '1'

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/classes/icecc.bbclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
index edb0e10434..63d8b4dfee 100644
--- a/meta/classes/icecc.bbclass
+++ b/meta/classes/icecc.bbclass
@@ -243,7 +243,11 @@ def icecc_get_external_tool(bb, d, tool):
 
 def icecc_get_tool_link(tool, d):
     import subprocess
-    return subprocess.check_output("readlink -f %s" % tool, shell=True).decode("utf-8")[:-1]
+    try:
+        return subprocess.check_output("readlink -f %s" % tool, shell=True).decode("utf-8")[:-1]
+    except subprocess.CalledProcessError as e:
+        bb.note("icecc: one of the tools probably disappeared during recipe parsing, cmd readlink -f %s returned %d:\n%s" % (tool, e.returncode, e.output.decode("utf-8")))
+        return tool
 
 def icecc_get_path_tool(tool, d):
     # This is a little ugly, but we want to make sure we add an actual
-- 
2.17.1



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

* [warrior][PATCH 2/3] meson: backport fix for builds with -Werror=return-type
  2019-08-20  9:04 [warrior][PATCH 1/3] icecc.bbclass: catch subprocess.CalledProcessError Martin Jansa
@ 2019-08-20  9:04 ` Martin Jansa
  2019-08-20  9:04 ` [warrior][PATCH 3/3] powertop: import a fix from buildroot Martin Jansa
  2019-08-20 14:14 ` [warrior][PATCH 1/3] icecc.bbclass: catch subprocess.CalledProcessError Joshua Watt
  2 siblings, 0 replies; 4+ messages in thread
From: Martin Jansa @ 2019-08-20  9:04 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/recipes-devtools/meson/meson.inc         |  1 +
 ...rn-statements-that-are-seen-with-Wer.patch | 84 +++++++++++++++++++
 2 files changed, 85 insertions(+)
 create mode 100644 meta/recipes-devtools/meson/meson/0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch

diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc
index 2d18f72c0c..bfe9851e94 100644
--- a/meta/recipes-devtools/meson/meson.inc
+++ b/meta/recipes-devtools/meson/meson.inc
@@ -16,6 +16,7 @@ SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${P
            file://cross-prop-default.patch \
            file://many-cross.patch \
            file://cross-libdir.patch \
+           file://0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch \
            "
 SRC_URI[sha256sum] = "ef9f14326ec1e30d3ba1a26df0f92826ede5a79255ad723af78a2691c37109fd"
 SRC_URI[md5sum] = "0267b0871266056184c484792572c682"
diff --git a/meta/recipes-devtools/meson/meson/0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch b/meta/recipes-devtools/meson/meson/0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch
new file mode 100644
index 0000000000..1f22755e17
--- /dev/null
+++ b/meta/recipes-devtools/meson/meson/0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch
@@ -0,0 +1,84 @@
+From 7e83cf1edac2a57c08ebb1ce7f21c2a539d5c300 Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska@suse.cz>
+Date: Mon, 15 Jul 2019 10:06:17 +0200
+Subject: [PATCH] Fix missing return statements that are seen with
+ -Werror=return-type.
+
+Error example:
+
+Code:
+
+        #include <locale.h>
+        int main () {
+            /* If it's not defined as a macro, try to use as a symbol */
+            #ifndef LC_MESSAGES
+                LC_MESSAGES;
+            #endif
+        }
+Compiler stdout:
+
+Compiler stderr:
+ In file included from /usr/include/locale.h:25,
+                 from /tmp/tmpep_i4iwg/testfile.c:2:
+/usr/include/features.h:382:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
+  382 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
+      |    ^~~~~~~
+/tmp/tmpep_i4iwg/testfile.c: In function 'main':
+/tmp/tmpep_i4iwg/testfile.c:8:9: error: control reaches end of non-void function [-Werror=return-type]
+    8 |         }
+      |         ^
+cc1: some warnings being treated as errors
+
+Upstream-Status: Backport
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ mesonbuild/compilers/c.py | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
+index b0096459..69cf84a4 100644
+--- a/mesonbuild/compilers/c.py
++++ b/mesonbuild/compilers/c.py
+@@ -387,6 +387,7 @@ class CCompiler(Compiler):
+             #ifndef {symbol}
+                 {symbol};
+             #endif
++            return 0;
+         }}'''
+         return self.compiles(t.format(**fargs), env, extra_args=extra_args,
+                              dependencies=dependencies)
+@@ -563,6 +564,7 @@ class CCompiler(Compiler):
+         {prefix}
+         int main(int argc, char **argv) {{
+             {type} something;
++            return 0;
+         }}'''
+         if not self.compiles(t.format(**fargs), env, extra_args=extra_args,
+                              dependencies=dependencies):
+@@ -598,6 +600,7 @@ class CCompiler(Compiler):
+         {prefix}
+         int main(int argc, char **argv) {{
+             {type} something;
++            return 0;
+         }}'''
+         if not self.compiles(t.format(**fargs), env, extra_args=extra_args,
+                              dependencies=dependencies):
+@@ -672,6 +675,7 @@ class CCompiler(Compiler):
+         #include <stdio.h>
+         int main(int argc, char *argv[]) {{
+             printf ("{fmt}", {cast} {f}());
++            return 0;
+         }}'''.format(**fargs)
+         res = self.run(code, env, extra_args=extra_args, dependencies=dependencies)
+         if not res.compiled:
+@@ -823,6 +827,7 @@ class CCompiler(Compiler):
+                 #error "No definition for __builtin_{func} found in the prefix"
+             #endif
+         #endif
++        return 0;
+         }}'''
+         return self.links(t.format(**fargs), env, extra_args=extra_args,
+                           dependencies=dependencies)
+-- 
+2.17.1
+
-- 
2.17.1



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

* [warrior][PATCH 3/3] powertop: import a fix from buildroot
  2019-08-20  9:04 [warrior][PATCH 1/3] icecc.bbclass: catch subprocess.CalledProcessError Martin Jansa
  2019-08-20  9:04 ` [warrior][PATCH 2/3] meson: backport fix for builds with -Werror=return-type Martin Jansa
@ 2019-08-20  9:04 ` Martin Jansa
  2019-08-20 14:14 ` [warrior][PATCH 1/3] icecc.bbclass: catch subprocess.CalledProcessError Joshua Watt
  2 siblings, 0 replies; 4+ messages in thread
From: Martin Jansa @ 2019-08-20  9:04 UTC (permalink / raw)
  To: openembedded-core

From: Martin Jansa <martin.jansa@gmail.com>

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 .../0001-wakeup_xxx.h-include-limits.h.patch  | 55 +++++++++++++++++++
 meta/recipes-kernel/powertop/powertop_2.10.bb |  1 +
 2 files changed, 56 insertions(+)
 create mode 100644 meta/recipes-kernel/powertop/powertop/0001-wakeup_xxx.h-include-limits.h.patch

diff --git a/meta/recipes-kernel/powertop/powertop/0001-wakeup_xxx.h-include-limits.h.patch b/meta/recipes-kernel/powertop/powertop/0001-wakeup_xxx.h-include-limits.h.patch
new file mode 100644
index 0000000000..7bfca8abfd
--- /dev/null
+++ b/meta/recipes-kernel/powertop/powertop/0001-wakeup_xxx.h-include-limits.h.patch
@@ -0,0 +1,55 @@
+From 4c24fdd8e0a42359df7308155b2d43c28a5e02fd Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Mon, 20 May 2019 20:25:00 +0200
+Subject: [PATCH] wakeup_xxx.h: include limits.h
+
+limits.h must be included to define PATH_MAX otherwise build will fail
+on:
+
+In file included from wakeup/wakeup_ethernet.cpp:45:0:
+wakeup/wakeup_ethernet.h:35:16: error: 'PATH_MAX' was not declared in this scope
+  char eth_path[PATH_MAX];
+
+In file included from wakeup/wakeup_usb.cpp:45:0:
+wakeup/wakeup_usb.h:35:16: error: 'PATH_MAX' was not declared in this scope
+  char usb_path[PATH_MAX];
+
+Fixes:
+ - http://autobuild.buildroot.org/results/a0b3337cf4a827e6566f8b15b6bb180f0dcef7a3
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Upstream-Status: Submitted [https://lists.01.org/pipermail/powertop/2019-May/002052.html]
+---
+ src/wakeup/wakeup_ethernet.h | 1 +
+ src/wakeup/wakeup_usb.h      | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/src/wakeup/wakeup_ethernet.h b/src/wakeup/wakeup_ethernet.h
+index 682bf95..e0fa628 100644
+--- a/src/wakeup/wakeup_ethernet.h
++++ b/src/wakeup/wakeup_ethernet.h
+@@ -25,6 +25,7 @@
+ #ifndef _INCLUDE_GUARD_ETHERNET_WAKEUP_H
+ #define _INCLUDE_GUARD_ETHERNET_WAKEUP_H
+ 
++#include <limits.h>
+ #include <vector>
+ 
+ #include "wakeup.h"
+diff --git a/src/wakeup/wakeup_usb.h b/src/wakeup/wakeup_usb.h
+index f7a1f7e..15898e3 100644
+--- a/src/wakeup/wakeup_usb.h
++++ b/src/wakeup/wakeup_usb.h
+@@ -25,6 +25,7 @@
+ #ifndef _INCLUDE_GUARD_USB_WAKEUP_H
+ #define _INCLUDE_GUARD_USB_WAKEUP_H
+ 
++#include <limits.h>
+ #include <vector>
+ 
+ #include "wakeup.h"
+-- 
+2.20.1
+
diff --git a/meta/recipes-kernel/powertop/powertop_2.10.bb b/meta/recipes-kernel/powertop/powertop_2.10.bb
index d943ba9f6e..5be8d23111 100644
--- a/meta/recipes-kernel/powertop/powertop_2.10.bb
+++ b/meta/recipes-kernel/powertop/powertop_2.10.bb
@@ -7,6 +7,7 @@ LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
 
 SRC_URI = "http://01.org/sites/default/files/downloads/powertop-v${PV}.tar.gz \
+    file://0001-wakeup_xxx.h-include-limits.h.patch \
 "
 
 SRC_URI[md5sum] = "a69bd55901cf919cc564187402ea2c9c"
-- 
2.17.1



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

* Re: [warrior][PATCH 1/3] icecc.bbclass: catch subprocess.CalledProcessError
  2019-08-20  9:04 [warrior][PATCH 1/3] icecc.bbclass: catch subprocess.CalledProcessError Martin Jansa
  2019-08-20  9:04 ` [warrior][PATCH 2/3] meson: backport fix for builds with -Werror=return-type Martin Jansa
  2019-08-20  9:04 ` [warrior][PATCH 3/3] powertop: import a fix from buildroot Martin Jansa
@ 2019-08-20 14:14 ` Joshua Watt
  2 siblings, 0 replies; 4+ messages in thread
From: Joshua Watt @ 2019-08-20 14:14 UTC (permalink / raw)
  To: Martin Jansa; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 10327 bytes --]

Looks like "readlink -f" is failing. Can you try to capture the output and
figure out why?

On Tue, Aug 20, 2019, 2:04 AM Martin Jansa <martin.jansa@gmail.com> wrote:

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

[-- Attachment #2: Type: text/html, Size: 12830 bytes --]

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

end of thread, other threads:[~2019-08-20 14:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-20  9:04 [warrior][PATCH 1/3] icecc.bbclass: catch subprocess.CalledProcessError Martin Jansa
2019-08-20  9:04 ` [warrior][PATCH 2/3] meson: backport fix for builds with -Werror=return-type Martin Jansa
2019-08-20  9:04 ` [warrior][PATCH 3/3] powertop: import a fix from buildroot Martin Jansa
2019-08-20 14:14 ` [warrior][PATCH 1/3] icecc.bbclass: catch subprocess.CalledProcessError Joshua Watt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.