Bug 12553 - waf.bbclass fails to provide useful error
Summary: waf.bbclass fails to provide useful error
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.5 M4
Assignee: Amanda Brindle
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2018-02-15 17:29 UTC by Denys Dmytriyenko
Modified: 2018-03-26 08:55 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denys Dmytriyenko 2018-02-15 17:29:38 UTC
waf.bbclass fails to catch exception and dumps a trace instead of any useful error messages about missing waf:

ERROR: libtalloc-2.1.10-r0 do_configure: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:waf_preconfigure(d)
     0003:
File: '/OE/master/sources/oe-core/meta/classes/waf.bbclass', lineno: 34, function: waf_preconfigure
     0030:    from distutils.version import StrictVersion
     0031:    subsrcdir = d.getVar('S')
     0032:    wafbin = os.path.join(subsrcdir, 'waf')
     0033:    try:
 *** 0034:        result = subprocess.check_output([wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT)
     0035:        version = result.decode('utf-8').split()[1]
     0036:        if StrictVersion(version) >= StrictVersion("1.8.7"):
     0037:            d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}")
     0038:    except subprocess.CalledProcessError as e:
File: '/usr/lib/python3.5/subprocess.py', lineno: 626, function: check_output
     0622:        # empty string. That is maintained here for backwards compatibility.
     0623:        kwargs['input'] = '' if kwargs.get('universal_newlines', False) else b''
     0624:
     0625:    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
 *** 0626:               **kwargs).stdout
     0627:
     0628:
     0629:class CompletedProcess(object):
     0630:    """A process that has finished running.
File: '/usr/lib/python3.5/subprocess.py', lineno: 693, function: run
     0689:        if 'stdin' in kwargs:
     0690:            raise ValueError('stdin and input arguments may not both be used.')
     0691:        kwargs['stdin'] = PIPE
     0692:
 *** 0693:    with Popen(*popenargs, **kwargs) as process:
     0694:        try:
     0695:            stdout, stderr = process.communicate(input, timeout=timeout)
     0696:        except TimeoutExpired:
     0697:            process.kill()
File: '/usr/lib/python3.5/subprocess.py', lineno: 947, function: __init__
     0943:                                startupinfo, creationflags, shell,
     0944:                                p2cread, p2cwrite,
     0945:                                c2pread, c2pwrite,
     0946:                                errread, errwrite,
 *** 0947:                                restore_signals, start_new_session)
     0948:        except:
     0949:            # Cleanup if the child failed starting.
     0950:            for f in filter(None, (self.stdin, self.stdout, self.stderr)):
     0951:                try:
File: '/usr/lib/python3.5/subprocess.py', lineno: 1551, function: _execute_child
     1547:                                # The error must be from chdir(cwd).
     1548:                                err_msg += ': ' + repr(cwd)
     1549:                            else:
     1550:                                err_msg += ': ' + repr(orig_executable)
 *** 1551:                    raise child_exception_type(errno_num, err_msg)
     1552:                raise child_exception_type(err_msg)
     1553:
     1554:
     1555:        def _handle_exitstatus(self, sts, _WIFSIGNALED=os.WIFSIGNALED,
Exception: FileNotFoundError: [Errno 2] No such file or directory: '/OE/master/build/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/libtalloc/2.1.10-r0/talloc-2.1.10/waf'

ERROR: libtalloc-2.1.10-r0 do_configure: Function failed: waf_preconfigure
ERROR: Logfile of failure stored in: /OE/master/build/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/libtalloc/2.1.10-r0/temp/log.do_configure.3748
ERROR: Task (/OE/master/sources/meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc_2.1.10.bb:do_configure) failed with exit code '1'
Comment 1 Joshua Watt 2018-03-21 07:17:48 UTC
I suspect this was fixed by:

29e280ee11c9a6f13c004ff25299668e4616f275 - waf-samba.bbclass: No longer inherit waf.bbclass

Can you verify that this is the case?
Comment 2 Denys Dmytriyenko 2018-03-21 19:13:35 UTC
No
Comment 3 Joshua Watt 2018-03-22 06:34:01 UTC
Ok, right. The libtalloc failure is just an example. The actual bug being reported is that bitbake gives an unhelpful backtrace, not that libtalloc is broken.

Sorry for the confusion.