From patchwork Tue Jun 7 15:11:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Neves X-Patchwork-Id: 8986 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 E5BD4C433EF for ; Tue, 7 Jun 2022 15:11:51 +0000 (UTC) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mx.groups.io with SMTP id smtpd.web11.13499.1654614702373657478 for ; Tue, 07 Jun 2022 08:11:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UmmEtpnW; spf=pass (domain: gmail.com, ip: 209.85.167.50, mailfrom: ptsneves@gmail.com) Received: by mail-lf1-f50.google.com with SMTP id w20so7160059lfa.11 for ; Tue, 07 Jun 2022 08:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wGNBOW5+jNZ1lqxejh6Uz+taEFv3+c9yvvjLz0cp9Jw=; b=UmmEtpnWsJ5vX+Gb5k1GVhJNDFucOCLzQZGCuFZuklxJxp6y/b0fsdntUwyR8Y//uy NKHHkhrbgv5UWdO/YPofzr/zm0qetDaoEYYPdwzM9AVLIB8BZyRxZ8gl/ShuyFsVQj9M Qc92IyuZg9Oul2TXUTDoI8gcITuGzqxX6EvNEUoV5O0AwhuZ7RMv28ObR/fyNuwYJ0v4 IIBkA59mg8VhcBLcfZxxxBFfOI2gNnOITdrVv80K7YFXITrPvUoLLj+jShBt+gSTsPQI DjQEfPeKphRNckByiQtJkmfeltebTxAyyrLvBkLDW0+YYTaSF7QPGK42KpqOAmXIhnqY 7pog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wGNBOW5+jNZ1lqxejh6Uz+taEFv3+c9yvvjLz0cp9Jw=; b=i4RHOHHq6KMhf9AOmuWazXeqN6wQwrKVTu3e8yxnXdBOaqN0eXrlgv5Sx8BkC/zQHs M4zncyvbuVYNQYS3kX9iKbBtbqPGSLeNBNhM+duiAFXgGGeYYUuxc1fvbugCpZRWDXkm C7m9l6cOmQHgCXLYj+8iU3sM4hVVFq0JUzax1Z56NmtMI2LPkjEr5gExn21UIPgR9Lmw 87QGMhhQ7CMbxIAH64sE3LGRDZJBC9rKhDybBx69AqGfTunfOuqrkLiPBg6E1JWtkctm PBkRp6iuzDv+8fYYgUcluNxUAWo7pu/Z6SyFU2Xwrh6Af2NeTptB2+Unhw+2Eg8gRQ5x cTNg== X-Gm-Message-State: AOAM531WxZh8rwF/UaU/PE3lBMowGgSvQKvd1ctc5r888UR/GwAy/wQt VKSE1eiPttQZ04nsdt/RO9HVJrx7KA== X-Google-Smtp-Source: ABdhPJxFdC/geCdbAbT7K+aR54qjMAqoLbC11G3/O7y2tDeaASXWtiBs0a+mZs7b3zX84MXDkN4/Rg== X-Received: by 2002:ac2:43c3:0:b0:479:1630:c6ed with SMTP id u3-20020ac243c3000000b004791630c6edmr15032433lfl.406.1654614700564; Tue, 07 Jun 2022 08:11:40 -0700 (PDT) Received: from pneves-XPS-15-9550.sigma.local (85-128-83-172.static.ip.netia.com.pl. [85.128.83.172]) by smtp.gmail.com with ESMTPSA id i8-20020a05651c120800b002556e0248dbsm2831089lja.124.2022.06.07.08.11.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 08:11:40 -0700 (PDT) From: Paulo Neves To: openembedded-core@lists.openembedded.org Cc: Paulo Neves Subject: [PATCH v2 1/5] python: Avoid shebang overflow on python-config.py Date: Tue, 7 Jun 2022 17:11:19 +0200 Message-Id: <20220607151123.3588947-1-ptsneves@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220606155807.1414519-1-ptsneves@gmail.com> References: <20220606155807.1414519-1-ptsneves@gmail.com> 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 ; Tue, 07 Jun 2022 15:11:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/166670 The native path may be too big, leading to shebang overflow. Just use the #!/usr/bin/env python3. Signed-off-by: Paulo Neves --- ...shebang-overflow-on-python-config.py.patch | 29 +++++++++++++++++++ .../recipes-devtools/python/python3_3.10.4.bb | 1 + 2 files changed, 30 insertions(+) create mode 100644 meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch diff --git a/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch b/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch new file mode 100644 index 0000000000..9f23278a30 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch @@ -0,0 +1,29 @@ +From f0c9dec63d452a7cd1e15ea653f4aced281f021c Mon Sep 17 00:00:00 2001 +From: Paulo Neves +Date: Tue, 7 Jun 2022 16:16:41 +0200 +Subject: [PATCH 1/1] Avoid shebang overflow on python-config.py + +The whole native path may be too big, leading to shebang +overflow. Let's just use the env shebang. + +Upstream-Status: Inappropriate [distribution] +--- + Makefile.pre.in | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index f0aedb76cb58999427804255da56fa53284d7032..dd88e43114730f7681715777cc76dabb31113176 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1638,6 +1638,8 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh + @ # Substitution happens here, as the completely-expanded BINDIR + @ # is not available in configure + sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py ++ @ # Otherwise we might get huge shebangs with native paths ++ sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' python-config.py + @ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR} + LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config + @ # In OpenEmbedded, always use the python version of the script, the shell +-- +2.25.1 + diff --git a/meta/recipes-devtools/python/python3_3.10.4.bb b/meta/recipes-devtools/python/python3_3.10.4.bb index 6bd3a6aba8..357025f856 100644 --- a/meta/recipes-devtools/python/python3_3.10.4.bb +++ b/meta/recipes-devtools/python/python3_3.10.4.bb @@ -34,6 +34,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ file://0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch \ file://0001-setup.py-Do-not-detect-multiarch-paths-when-cross-co.patch \ file://deterministic_imports.patch \ + file://0001-Avoid-shebang-overflow-on-python-config.py.patch \ " SRC_URI:append:class-native = " \ From patchwork Tue Jun 7 15:11:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Neves X-Patchwork-Id: 8985 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 01C74CCA483 for ; Tue, 7 Jun 2022 15:11:52 +0000 (UTC) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mx.groups.io with SMTP id smtpd.web08.13972.1654614703528100877 for ; Tue, 07 Jun 2022 08:11:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=q4kInTsC; spf=pass (domain: gmail.com, ip: 209.85.167.50, mailfrom: ptsneves@gmail.com) Received: by mail-lf1-f50.google.com with SMTP id a15so28794608lfb.9 for ; Tue, 07 Jun 2022 08:11:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jx10Eh51y4HbWngWLtUzs8P6priZADjXMkCR29+D+5U=; b=q4kInTsCcOK1170Ff0C/n+yU6A61JN5ncF9por2XL/iq8Gn6hZdb8X31iR3z6iDVBA RFI0wY9x7gQ0G7YVXseUvOzfRozupsgTDg8gi5SK5Ry7jetjtvovmZVdJA6VoRyeRXOe zVMs4eLkiedZ04In3S/kZKtII7dmPIl+aWRNTiKtGy4eAbkOJGQSYPNUhTEDhF7MMUdT torzmz29ltNEtNWBKZiGRYXuG9Ta4C5cectlBolT7x6Od5hbgg8pvF/WjRsGwpi5TREC QJSX3CJV4cJnr/buhMkT1T5yuM1LnQ4W1CCh7MefxbEzUG+A97a/D9f424AtHVM/tTuX HF9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jx10Eh51y4HbWngWLtUzs8P6priZADjXMkCR29+D+5U=; b=h74lYJ1UYKXrZcket1u+PY4xfzJx7nHE4V43MmtcMtVCYfVD7onHNcOPTyRmg7fdl3 OTWSqTlNwSPEJreolpVacnuTiTea8sMN4vNz8RPcsozz0DopyPupUZYFve4I2jaGFXny dAxV31sMCZSD/oMwJSOl4hBz0zjtL+GOO2ARRC6BzVqxbNKXCqEtJtvDiQZUvNfJpv/l 8/+YWFL7/pxYHqHTiHzjdvFQLykGLcHahwRAGeX8kuv1jsjUjhcbDxwRiF9Risviyjtu wJcRy/K/gc3XRLVUEFUstz2Lg8Q+oatm1cf+N6EHZCWv6mtZikGHCeAh2WKYQrFGS2mJ V0pw== X-Gm-Message-State: AOAM5318GO4QqDVpqfb1QjLzlsrSsIoAD62cOoBcumn2n60XGIILpoRI ESidqrofrBshWPpouCFOUSW35+pEKA== X-Google-Smtp-Source: ABdhPJykKQCWdSjPvGX93y9BTIpkUhBPWPvi6iCNUKelRqU28bPKkegbiq1hSg0NU6AUMdSTgpXGEA== X-Received: by 2002:a05:6512:3b26:b0:479:5610:5672 with SMTP id f38-20020a0565123b2600b0047956105672mr4943976lfv.464.1654614701884; Tue, 07 Jun 2022 08:11:41 -0700 (PDT) Received: from pneves-XPS-15-9550.sigma.local (85-128-83-172.static.ip.netia.com.pl. [85.128.83.172]) by smtp.gmail.com with ESMTPSA id i8-20020a05651c120800b002556e0248dbsm2831089lja.124.2022.06.07.08.11.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 08:11:41 -0700 (PDT) From: Paulo Neves To: openembedded-core@lists.openembedded.org Cc: Paulo Neves Subject: [PATCH v2 2/5] gtk-doc: Fix potential shebang overflow on gtkdoc-mkhtml2 Date: Tue, 7 Jun 2022 17:11:20 +0200 Message-Id: <20220607151123.3588947-2-ptsneves@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607151123.3588947-1-ptsneves@gmail.com> References: <20220606155807.1414519-1-ptsneves@gmail.com> <20220607151123.3588947-1-ptsneves@gmail.com> 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 ; Tue, 07 Jun 2022 15:11:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/166671 A native path can cause a shebang overflow on gtkdoc-mkhtml. Replace it with /usr/bin/env. Signed-off-by: Paulo Neves --- meta/recipes-gnome/gtk-doc/gtk-doc_1.33.2.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/recipes-gnome/gtk-doc/gtk-doc_1.33.2.bb b/meta/recipes-gnome/gtk-doc/gtk-doc_1.33.2.bb index 150d2c0b23..392913fcc6 100644 --- a/meta/recipes-gnome/gtk-doc/gtk-doc_1.33.2.bb +++ b/meta/recipes-gnome/gtk-doc/gtk-doc_1.33.2.bb @@ -43,6 +43,7 @@ do_install:append () { ${datadir}/gtk-doc/python/gtkdoc/config.py; do sed -e 's,${RECIPE_SYSROOT_NATIVE}/usr/bin/pkg-config,${bindir}/pkg-config,' \ -e 's,${HOSTTOOLS_DIR}/python3,${bindir}/python3,' \ + -e '1s|^#!.*|#!/usr/bin/env python3|' \ -i ${D}$fn done } From patchwork Tue Jun 7 15:11:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Neves X-Patchwork-Id: 8984 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 00A24CCA47E for ; Tue, 7 Jun 2022 15:11:52 +0000 (UTC) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by mx.groups.io with SMTP id smtpd.web10.13577.1654614704539464193 for ; Tue, 07 Jun 2022 08:11:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cf0d17Eg; spf=pass (domain: gmail.com, ip: 209.85.167.41, mailfrom: ptsneves@gmail.com) Received: by mail-lf1-f41.google.com with SMTP id a29so306196lfk.2 for ; Tue, 07 Jun 2022 08:11:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2M59DV9KSK0oz9TPBtZO/rVVlzv0gmoU1XlQPGxMdXs=; b=cf0d17EgL1JkJghn1n7mmEw/t1AYx+bGYbCH/ADYHBVuqFy+W12lKn2VOj5DBmhppu BaBHtQwq9nZzKJDxeGjG4NC3QDMVNzznO13jow3Mx+h+FD+0MjN4u0URYJOpHS+Ck3dQ b9wgqMSJlDofT7M1TylX7k93pnpzhzW+k34mRss4xjIXgducif2xS4+0x0mQVvlJUY0+ kSsS++S6K2HwXZypA20SPx8H6jDhzGjjHukSFe5//3Ng67q5PLULHc7QrHx/QOyeyXm6 Mp48xYf2Vz5HMYYzZOOVRBCJ2/+BnYftOBzrutNhkP/t7RmmPo+okAtaNa6DAJAH3xYI e02w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2M59DV9KSK0oz9TPBtZO/rVVlzv0gmoU1XlQPGxMdXs=; b=j3HkSPw4Jve/Pa0/yKy96tvOA68Kc0rukVdVSNI0HwLVKOuclwdKayfNL9vRjETgdI o9Tkhg4z5PO8uAQxLqmyFQte1iKHmPUm5WaqW72RovktvwMNhc86Hevwph8KAklCAM5Y Q3+0THUKNFDSY+ra53pGs4f/9wIvNB3DbWhKGHSMiHlKhf5pPd1F54hHWpJv7lKQnC3p JOShgXX6iqJRDPXcI6ZVq4SuxMOudAvvNPQK2rDyHzEjvWQ16HRuYk5S9Kp6mGs+WS93 7J07ht9drDCYzCfGorLdHUo5hKbdBSpuD2Fsq26cWsrDCkP5czc1LJB1nH+Y1dAxX4S6 wTBw== X-Gm-Message-State: AOAM531JiRRduxCsdRpo3cj7OMStG54IcO9GBhKZ8sJZ2t8MjcRZoi8Z gqpYdiMtbBw1BIOvS8MQXWSOO2RicA== X-Google-Smtp-Source: ABdhPJysECJVhehIYU9Eqz3DWznWs/RMBA/Xb6zcMdZ1Oy81e1FmJh8FYsc+OdgnIcjSZXQt/565pQ== X-Received: by 2002:a05:6512:2627:b0:479:ef3:140b with SMTP id bt39-20020a056512262700b004790ef3140bmr17448530lfb.293.1654614702880; Tue, 07 Jun 2022 08:11:42 -0700 (PDT) Received: from pneves-XPS-15-9550.sigma.local (85-128-83-172.static.ip.netia.com.pl. [85.128.83.172]) by smtp.gmail.com with ESMTPSA id i8-20020a05651c120800b002556e0248dbsm2831089lja.124.2022.06.07.08.11.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 08:11:42 -0700 (PDT) From: Paulo Neves To: openembedded-core@lists.openembedded.org Cc: Paulo Neves Subject: [PATCH v2 3/5] insane.bbclass: Make do_qa_staging check shebangs Date: Tue, 7 Jun 2022 17:11:21 +0200 Message-Id: <20220607151123.3588947-3-ptsneves@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607151123.3588947-1-ptsneves@gmail.com> References: <20220606155807.1414519-1-ptsneves@gmail.com> <20220607151123.3588947-1-ptsneves@gmail.com> 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 ; Tue, 07 Jun 2022 15:11:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/166672 As reported in the bug report [1], there was no check for shebang sizes on native scripts and now this is fixed. The path scope of the qa_staging was increased from just checking libdir to all the relevant SYSROOT_DIRS. It is possible to skip this check through INSANE_SKIP. [1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=11053 Signed-off-by: Paulo Neves --- meta/classes/insane.bbclass | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 9ca84bace9..b2951a48fe 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass @@ -630,6 +630,11 @@ def qa_check_staged(path,d): bb.note("Recipe %s skipping qa checking: pkgconfig" % d.getVar('PN')) skip_pkgconfig = True + skip_shebang_size = False + if 'shebang-size' in skip: + bb.note("Recipe %s skipping qa checkking: shebang-size" % d.getVar('PN')) + skip_shebang_size = True + # find all .la and .pc files # read the content # and check for stuff that looks wrong @@ -651,6 +656,13 @@ def qa_check_staged(path,d): error_msg = "%s failed sanity test (tmpdir) in path %s" % (file,root) oe.qa.handle_error("pkgconfig", error_msg, d) + if not skip_shebang_size: + errors = {} + package_qa_check_shebang_size(path, "", d, None, errors) + for e in errors: + oe.qa.handle_error(e, errors[e], d) + + # Run all package-wide warnfuncs and errorfuncs def package_qa_package(warnfuncs, errorfuncs, package, d): warnings = {} @@ -1139,7 +1151,9 @@ addtask do_package_qa_setscene python do_qa_staging() { bb.note("QA checking staging") - qa_check_staged(d.expand('${SYSROOT_DESTDIR}${libdir}'), d) + sysroot_destdir = d.expand('${SYSROOT_DESTDIR}') + for sysroot_dir in d.expand('${SYSROOT_DIRS}').split(): + qa_check_staged(sysroot_destdir + sysroot_dir, d) oe.qa.exit_with_message_if_errors("QA staging was broken by the package built above", d) }