From patchwork Thu Feb 15 17:36:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yoann CONGAL X-Patchwork-Id: 39455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2D18C4829E for ; Thu, 15 Feb 2024 17:37:51 +0000 (UTC) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mx.groups.io with SMTP id smtpd.web10.21194.1708018669573365211 for ; Thu, 15 Feb 2024 09:37:50 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile-fr.20230601.gappssmtp.com header.s=20230601 header.b=FIk2pFXh; spf=pass (domain: smile.fr, ip: 209.85.128.51, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-412255afa19so4301045e9.3 for ; Thu, 15 Feb 2024 09:37:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile-fr.20230601.gappssmtp.com; s=20230601; t=1708018668; x=1708623468; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=I/ifuDkIJyqqsH25+wF2v3SYb65JIYbRxHfCqieMH+Q=; b=FIk2pFXhZn4g/rO75+p98gHUYx8rC0/SNPoeUA8+k43B/ALpEqXpUOQ3nNACMKmK9V dO4W5I7dBTlDhG+vvfVnKiw9K7RIGhZblAZmaRxUyi+2jm3kYSBWl+q+CoU7taFLFFIo 1tc+VXFYQud/8ql4X7ykDjuFSXWsMEK6fjBGSBhxI9ges/Sewj1uuwxsGMyFCuakoeCP FUOrfsZvYdxe0nDDYgEFeYdf83VE1gOPs1CxOyhkTgj2IChhDwdnQussNVIMDQSbrKMI ejZph2VC3bLvP2RPi3nBdf4HMUN0SOfLp7TPlnI0jJCrZJgmloBIJsqnpsfMD+cT5d2K cUWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708018668; x=1708623468; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=I/ifuDkIJyqqsH25+wF2v3SYb65JIYbRxHfCqieMH+Q=; b=CNgr9SzhoviscmOUDBIXtGM6DALZ4wuMUSVhFJsp4b2Gck+zDr6LjC4rNTzbx5UCIv AVauA+37pTT2gahH6ecGyPQnySsGe1rJJSv54QR2jRiD0RPIJbk8EHSFiuU8mhJpRKDS d/QBj1gyrBlU96RHkVB3A/caBaOZiUmFB2y57lRTQncPvd8uTLXEpv+Clq9CQp85kcPy kpF1Ba8ztpP1qiNyI1MemMeainGQql/CKISYs6cIJgHu1MYSGY6NOFplt2ZZHbbvF8Ht asvD+U+1/Yi6cMdskppWnGGanmLvL8nAeEmmSiRiDQJQLWR/t4EvV/gen8vWlkB3ECup fgUw== X-Gm-Message-State: AOJu0Yzd4XXDqPVn7jbUroyp59tx3lsEqAxgTOPteN6tlaIlb0cCtQyL 2n6O85p0KGlYLhiP26Qm2Es/VRBgahD20h4OZdg+5ZuVR+hbTaoUmdpuH+xc3Jr3n7XiRKpVZVT t X-Google-Smtp-Source: AGHT+IFpaJllLIdWN4rGB3HJqEGiOpveOTS+7YTj8BxMLna8qZjhTt0o1P6PDCtbNZRGr9e4pbo+7A== X-Received: by 2002:a5d:42d1:0:b0:33d:11a0:7584 with SMTP id t17-20020a5d42d1000000b0033d11a07584mr834272wrr.13.1708018637917; Thu, 15 Feb 2024 09:37:17 -0800 (PST) Received: from P-ASN-ECS-830T8C3.idf.intranet (static-css-ccs-204145.business.bouyguestelecom.com. [176.157.204.145]) by smtp.gmail.com with ESMTPSA id ch14-20020a5d5d0e000000b0033cda80f54dsm2595611wrb.83.2024.02.15.09.37.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 09:37:17 -0800 (PST) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [PATCH] waf.bbclass: Print waf output on unparsable version Date: Thu, 15 Feb 2024 18:36:24 +0100 Message-Id: <20240215173624.572593-1-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Feb 2024 17:37:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/195689 On AB runs of reproducible-meta-oe/Repro meta-oe/meta-oe, "waf --version" does not seem to contain the version but an error message with "RuntimeWarning: " [0]. Since the actual output is not saved anywhere, it is quite hard to debug. This patch detects the problematic case and send it to the log where it will be seen and fixed. As a side-effect, this error will now only be a warning. Here is a partial backtrace for this (full back trace visible in [0]): NOTE: recipe mpv-0.35.1-r0: task do_configure: Started ERROR: mpv-0.35.1-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: *** 0002:waf_preconfigure(d) File: '$TOP/meta/classes-recipe/waf.bbclass', lineno: 58, function: waf_preconfigure 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", ">="): [...] File: '$TOP/bitbake/lib/bb/utils.py', lineno: 91, function: split_version *** 0091: e = int(s.split(":")[0]) Exception: ValueError: invalid literal for int() with base 10: 'RuntimeWarning' [0]: https://autobuilder.yoctoproject.org/typhoon/#/builders/155/builds/11/steps/32/logs/stdio line 31883 Signed-off-by: Yoann Congal --- meta/classes-recipe/waf.bbclass | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meta/classes-recipe/waf.bbclass b/meta/classes-recipe/waf.bbclass index 5fa0cc4987..70bf3be8fd 100644 --- a/meta/classes-recipe/waf.bbclass +++ b/meta/classes-recipe/waf.bbclass @@ -55,7 +55,10 @@ python waf_preconfigure() { try: result = subprocess.check_output([python, wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT) version = result.decode('utf-8').split()[1] - if bb.utils.vercmp_string_op(version, "1.8.7", ">="): + if not bb.utils.is_semver(version): + bb.warn("Unable to parse \"waf --version\" output. Assuming waf version without bindir/libdir support.") + bb.warn("waf·--version·output = \n%s" % result.decode('utf-8')) + elif bb.utils.vercmp_string_op(version, "1.8.7", ">="): d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}") except subprocess.CalledProcessError as e: bb.warn("Unable to execute waf --version, exit code %d. Assuming waf version without bindir/libdir support." % e.returncode)