public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Böszörményi Zoltán" <zboszor@gmail.com>
To: OpenEmbedded Core Mailing List
	<openembedded-core@lists.openembedded.org>
Subject: bb.utils.vercmp_string_op() vs Python 3.12
Date: Fri, 26 Jan 2024 10:17:47 +0100	[thread overview]
Message-ID: <4ed80c78-5940-454d-b4a7-a820f04f0f08@gmail.com> (raw)

Hi,

Just a FYI.

After the bitbake-server getting stuck after bitbake exited
with Python 3.12 issue was fixed, here's another one.

This time it's semi-reliably triggered by the jack recipe
in meta-openembedded:

ERROR: jack-1.19.22-r0 do_configure: Error executing a python function in 
exec_func_python() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_func_python() autogenerated', lineno: 2, function: <module>
      0001:
  *** 0002:waf_preconfigure(d)
      0003:
File: 
'/home/zozo/test-yocto-4.3-gh/conf/../layers/openembedded-core/meta/classes-recipe/waf.bbclass', 
lineno: 58, function: waf_preconfigure
      0054:    wafbin = os.path.join(subsrcdir, 'waf')
      0055:    try:
      0056:        result = subprocess.check_output([python, wafbin, '--version'], 
cwd=subsrcdir, stderr=subprocess.STDOUT)
      0057:        version = result.decode('utf-8').split()[1]
  *** 0058:        if bb.utils.vercmp_string_op(version, "1.8.7", ">="):
      0059:            d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}")
      0060:    except subprocess.CalledProcessError as e:
      0061:        bb.warn("Unable to execute waf --version, exit code %d. Assuming waf 
version without bindir/libdir support." % e.returncode)
      0062:    except FileNotFoundError:
File: '/home/zozo/test-yocto-4.3-gh/bitbake/lib/bb/utils.py', lineno: 150, function: 
vercmp_string_op
      0146:    Compare two versions and check if the specified comparison operator matches 
the result of the comparison.
      0147:    This function is fairly liberal about what operators it will accept since 
there are a variety of styles
      0148:    depending on the context.
      0149:    """
  *** 0150:    res = vercmp_string(a, b)
      0151:    if op in ('=', '=='):
      0152:        return res == 0
      0153:    elif op == '<=':
      0154:        return res <= 0
File: '/home/zozo/test-yocto-4.3-gh/bitbake/lib/bb/utils.py', lineno: 140, function: 
vercmp_string
      0136:    return r
      0137:
      0138:def vercmp_string(a, b):
      0139:    """ Split version strings and compare them """
  *** 0140:    ta = split_version(a)
      0141:    tb = split_version(b)
      0142:    return vercmp(ta, tb)
      0143:
      0144:def vercmp_string_op(a, b, op):
File: '/home/zozo/test-yocto-4.3-gh/bitbake/lib/bb/utils.py', lineno: 91, function: 
split_version
      0087:    """Split a version string into its constituent parts (PE, PV, PR)"""
      0088:    s = s.strip(" <>=")
      0089:    e = 0
      0090:    if s.count(':'):
  *** 0091:        e = int(s.split(":")[0])
      0092:        s = s.split(":")[1]
      0093:    r = ""
      0094:    if s.count('-'):
      0095:        r = s.rsplit("-", 1)[1]
Exception: ValueError: invalid literal for int() with base 10: 'SyntaxWarning'

ERROR: Logfile of failure stored in: 
/home/zozo/test-yocto-4.3-gh/tmp-sicom-glibc/work/corei7-64-oe-linux/jack/1.19.22/temp/log.do_configure.1709417

"Semi-reliably", i.e. about 50-50 or 60-40 percent failure vs success rate.
Usually the second run succeeds after a failure.

I copied vercmp_string_op() and all others called by it
from bitbake/lib/bb/utils.py into a new python script as a
minimum test case. Running this script inside a locally
cloned jack git repository has 100% success rate.

It looks like an internal Python "flake" issue.

Best regards,
Zoltán Böszörményi



             reply	other threads:[~2024-01-26  9:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-26  9:17 Böszörményi Zoltán [this message]
2024-01-26 10:53 ` [OE-core] bb.utils.vercmp_string_op() vs Python 3.12 Martin Jansa
2024-01-26 10:57   ` Martin Jansa
2024-01-26 11:14   ` Böszörményi Zoltán
2024-01-26 11:48     ` Martin Jansa
     [not found]   ` <17ADE16B2210C84D.24595@lists.openembedded.org>
2024-01-26 11:32     ` Böszörményi Zoltán

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ed80c78-5940-454d-b4a7-a820f04f0f08@gmail.com \
    --to=zboszor@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox