priv-kweihmann / meta-sca

Layer for static code analysis and security hardening
Other
91 stars 36 forks source link

licensecheck: Exception: FileNotFoundError: [Errno 2] No such file or directory: 'licensecheck': 'licensecheck' #3568

Open RobertBerger opened 3 years ago

RobertBerger commented 3 years ago
bitbake core-image-minimal
ERROR: Task (/workdir/sources/poky-master/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_5.10.bb:do_sca_licensecheck_report) failed with exit code '1'
DEBUG: Executing python function do_sca_licensecheck_report
ERROR: 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:do_sca_licensecheck_report(d)
     0003:
File: '/workdir/sources/poky-master/../meta-sca-master/classes/sca-licensecheck.bbclass', lineno: 108, function: do_sca_licensecheck_report
     0104:                _args = ["licensecheck",
     0105:                         licensecheck_get_license(d, key),
     0106:                         "lc",
     0107:                         sca_raw_result_file(d, "licensecheck_raw")]
 *** 0108:                _tmp = exec_wrap_check_output(d, _args, val)
     0109:                cmd_output += "\n".join(["{}:{}".format(key, x) for x in _tmp.split("\n") if x]) + "\n"
     0110:    with open(sca_raw_result_file(d, "licensecheck"), "w") as o:
     0111:        o.write(cmd_output)
     0112:
File: '/workdir/sources/poky-master/../meta-sca-master/classes/sca-helper-exec.bbclass', lineno: 108, function: exec_wrap_check_output
     0104:    _result_out = default_val
     0105:    for chunk in __list_chunkify(filelist, _arg_max - sum(len(x) for x in base_cmd), chunk_size=chunk_size):
     0106:        if not chunk:
     0107:            continue
 *** 0108:        cmd_output = toolexec(base_cmd, chunk, stderr, **kwargs)
     0109:        __debug_chunk = min(1024, len(str(cmd_output))) - 1
     0110:        sca_log_note(d, str(cmd_output)[0:__debug_chunk])
     0111:        _result_out = combine(_result_out, cmd_output, **kwargs)
     0112:
File: '/workdir/sources/poky-master/../meta-sca-master/classes/sca-helper-exec.bbclass', lineno: 88, function: exec_wrap_tool_exec
     0084:    import subprocess
     0085:    try:
     0086:        return subprocess.check_output(args + files,
     0087:                                       universal_newlines=True,
 *** 0088:                                       stderr=stderr or subprocess.STDOUT)
     0089:    except subprocess.CalledProcessError as e:
     0090:        return e.stdout or ""
     0091:
     0092:def exec_wrap_check_output(d, base_cmd, filelist, combine=exec_wrap_combine_txt, toolexec=exec_wrap_tool_exec, default_val="", chunk_size=None, stderr=None, **kwargs):
File: '/usr/lib/python3.6/subprocess.py', lineno: 356, function: check_output
     0352:        # empty string. That is maintained here for backwards compatibility.
     0353:        kwargs['input'] = '' if kwargs.get('universal_newlines', False) else b''
     0354:
     0355:    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
 *** 0356:               **kwargs).stdout
     0357:
     0358:
     0359:class CompletedProcess(object):
     0360:    """A process that has finished running.
File: '/usr/lib/python3.6/subprocess.py', lineno: 423, function: run
     0419:        if 'stdin' in kwargs:
     0420:            raise ValueError('stdin and input arguments may not both be used.')
     0421:        kwargs['stdin'] = PIPE
     0422:
 *** 0423:    with Popen(*popenargs, **kwargs) as process:
     0424:        try:
     0425:            stdout, stderr = process.communicate(input, timeout=timeout)
     0426:        except TimeoutExpired:
     0427:            process.kill()
File: '/usr/lib/python3.6/subprocess.py', lineno: 729, function: __init__
     0725:                                startupinfo, creationflags, shell,
     0726:                                p2cread, p2cwrite,
     0727:                                c2pread, c2pwrite,
     0728:                                errread, errwrite,
 *** 0729:                                restore_signals, start_new_session)
     0730:        except:
     0731:            # Cleanup if the child failed starting.
     0732:            for f in filter(None, (self.stdin, self.stdout, self.stderr)):
     0733:                try:
File: '/usr/lib/python3.6/subprocess.py', lineno: 1364, function: _execute_child
     1360:                    if errno_num != 0:
     1361:                        err_msg = os.strerror(errno_num)
     1362:                        if errno_num == errno.ENOENT:
     1363:                            err_msg += ': ' + repr(err_filename)
 *** 1364:                    raise child_exception_type(errno_num, err_msg, err_filename)
     1365:                raise child_exception_type(err_msg)
     1366:
     1367:
     1368:        def _handle_exitstatus(self, sts, _WIFSIGNALED=os.WIFSIGNALED,
Exception: FileNotFoundError: [Errno 2] No such file or directory: 'licensecheck': 'licensecheck'

DEBUG: Python function do_sca_licensecheck_report finished
priv-kweihmann commented 3 years ago

I'm on it - is it just happening there (I kind of suspect INHIBIT_DEFAULT_DEPS = "1" to cause this)?

priv-kweihmann commented 3 years ago

Well I can't really reproduce it. Can you please post the result of bitbake linux-libc-headers -e | grep ^DEPENDS"