From patchwork Sun Apr 13 08:08:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 61231 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 27552C3601E for ; Sun, 13 Apr 2025 08:08:24 +0000 (UTC) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.groups.io with SMTP id smtpd.web11.25048.1744531698697440891 for ; Sun, 13 Apr 2025 01:08:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=nNwMUdQs; spf=pass (domain: smile.fr, ip: 209.85.221.68, mailfrom: yoann.congal@smile.fr) Received: by mail-wr1-f68.google.com with SMTP id ffacd0b85a97d-39d83782ef6so2701455f8f.0 for ; Sun, 13 Apr 2025 01:08:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1744531696; x=1745136496; 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=TkO17eykQQZWuXbhTB837uIhHJteQQpXderPAx0Z9qo=; b=nNwMUdQsaIxPP7zved6a1hynkBJrtwWkNF5/tZlP756KFznwTMy7PMvxb2GsaQdu5j 2uY3Iuh444NCqKha5mj8xpv6ijy8QgSnEJa4VXdq4j32Ypmj6tKV2vtd1HfwSYaB1KRV 1qWWctnzeFX7lcs4shfOhE0wuMElPHUk/o4wk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744531696; x=1745136496; 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=TkO17eykQQZWuXbhTB837uIhHJteQQpXderPAx0Z9qo=; b=Up2MXsbt6C1u5loDtkHW1BpcHsbOXNj5igwwIjqPuUqq5NlgM2Yc1JARy1fw9Auv+d EQgocsEjJnIF0Yu3MEZLGPIrmyH/BAoi9MlasT+2g8u8XtVzMUiU4IwLXHadLK9Cma1e 9HPtjrP8XmSjBSmxDHybEloTWWJoESVyYgsg9Kuk21/eObskeN8shgh4Te9T881blIbg 6kS8+PSoii/X9LeVCWXo3aQo+iTReDXbrjRkcQiWr8tXs73Fcj7i66/GTI4sOpETtokW AFtS7o3elzatUKil+wBKgZfg1+EmNAyarMsNfyHvvlizTljUBUJxmUhxu08oyupmOlpK 6LJw== X-Gm-Message-State: AOJu0YywFaz6FOg0QBe++14AEamkriYBPUE2fnuYitUIs/yxCnUeFwZ9 XbEStPcpOHEhLnOlN2YJmOZDaSM1sY75gxYxrEXgHk7XoE6I7EXH6SotdeniDag6Kcl5bR2bgpm X7ZkpKA== X-Gm-Gg: ASbGnctuQf0Rh+qnc1ouhX9rKo5rv9ehGAdERCrGL0o80FaY3ZkyRw2PtgYd9pWr7Kp F8VdiMds6BXAa718DT4RJYd0NEDoIKFBLyRFcOlZ/S8sytTNEPiOx/WTMYKtT8ma7YRS0coR8tk e8s14R4TTWbCpn2Mdg1PCJggOgIm31u4I8XpRBT9l61beyCKvM3I4lusMn5h7dr0i6ymRXRQ/F9 mWTxtM9fskncTBFmhCRQEf7hPWI2WOAsuQArS4YA7Daz404A1dOJd/unbU8bYnkgwkYxzHqzReL sTjFblJFvywsuH3rZWav95JgCdIasnS/SpmJmMLq5PcJSjGkNOGnK/4ZNg/mS93I3PGZM7kbYRt A0cYgnpozaidJvk+R4PAcfczDVjb2s6QctuQJkYxb47uhY5s= X-Google-Smtp-Source: AGHT+IEhyG8o7NozOKQYb24iKCoPMovOsnZRkSxpyBeFNS/mwRqE24vARvD5p/WtjOLksyyTyaE6MQ== X-Received: by 2002:a05:6000:2508:b0:39c:1efb:f7c4 with SMTP id ffacd0b85a97d-39d8f4dcd59mr10734254f8f.25.1744531696481; Sun, 13 Apr 2025 01:08:16 -0700 (PDT) Received: from P-ASN-ECS-830T8C3.home (2a01cb000deef00090089785c06a34e3.ipv6.abo.wanadoo.fr. [2a01:cb00:dee:f000:9008:9785:c06a:34e3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39eaf43d053sm7289212f8f.68.2025.04.13.01.08.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Apr 2025 01:08:16 -0700 (PDT) From: Yoann Congal To: openembedded-devel@lists.openembedded.org Cc: Yoann Congal Subject: [meta-python][PATCH 1/2] python3-evdev: Use Yocto kernel headers instead of host's Date: Sun, 13 Apr 2025 10:08:01 +0200 Message-Id: <20250413080802.602658-1-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 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 ; Sun, 13 Apr 2025 08:08:24 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/116822 From: Yoann Congal Commit 01ebfecf1c94 ("python3-evdev: switch to PEP-517 build backend") did not update the way build arguments are passed to the build making them unused. In python3-evdev case that meant that the build used host kernel headers instead of Yocto's. When host's and Yocto's headers were different (currently the case on Debian 12 as seen on AB[0]), that triggered: | src/evdev/ecodes.c:542:29: error: 'KEY_LINK_PHONE' undeclared (first use in this function); did you mean 'KEY_PICKUP_PHONE'? | 542 | PyModule_AddIntMacro(m, KEY_LINK_PHONE); | | ^~~~~~~~~~~~~~ [...] ERROR: Task (.../../../layers/meta-openembedded/meta-python/recipes-devtools/python/python3-evdev_1.9.1.bb:do_compile) failed with exit code '1' To fix this, use PEP517_BUILD_OPTS with the working (but weird looking) escaping. Now that correct headers are used, their paths end up in the ecode.c file which lead to a buildpaths error, skip the check for this patch. This will be fixed in a following patch. [0]: https://autobuilder.yoctoproject.org/valkyrie/#/builders/87/builds/40/steps/40/logs/stdio Signed-off-by: Yoann Congal --- meta-python/recipes-devtools/python/python3-evdev_1.9.1.bb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meta-python/recipes-devtools/python/python3-evdev_1.9.1.bb b/meta-python/recipes-devtools/python/python3-evdev_1.9.1.bb index c48bc39c1f..b8930c97d5 100644 --- a/meta-python/recipes-devtools/python/python3-evdev_1.9.1.bb +++ b/meta-python/recipes-devtools/python/python3-evdev_1.9.1.bb @@ -11,7 +11,8 @@ do_compile:prepend() { rm -rf ${S}/evdev/ecodes.c } -SETUPTOOLS_BUILD_ARGS = "build_ecodes --evdev-headers ${STAGING_DIR_TARGET}/usr/include/linux/input.h:${STAGING_DIR_TARGET}/usr/include/linux/input-event-codes.h" +PEP517_BUILD_OPTS = "--config-setting=--build-option='build_ecodes \ + --evdev-headers ${STAGING_DIR_TARGET}/usr/include/linux/input.h:${STAGING_DIR_TARGET}/usr/include/linux/input-event-codes.h'" RDEPENDS:${PN} += "\ python3-ctypes \ @@ -20,3 +21,4 @@ RDEPENDS:${PN} += "\ python3-shell \ python3-stringold \ " +INSANE_SKIP:${PN}-src = "buildpaths" From patchwork Sun Apr 13 08:08:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 61232 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 2877BC369AE for ; Sun, 13 Apr 2025 08:08:24 +0000 (UTC) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.groups.io with SMTP id smtpd.web10.25039.1744531699945534246 for ; Sun, 13 Apr 2025 01:08:20 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=3XWEhEH/; spf=pass (domain: smile.fr, ip: 209.85.221.65, mailfrom: yoann.congal@smile.fr) Received: by mail-wr1-f65.google.com with SMTP id ffacd0b85a97d-39c1efc4577so1721762f8f.0 for ; Sun, 13 Apr 2025 01:08:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1744531697; x=1745136497; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FwUipkLPayRBMVMY/WEWBYD/1LRFLG77JccqIaat+ks=; b=3XWEhEH/X6UxJLb2pJQaHCCyJXCgb9fvjL80vnIcGHpccNS1z2UvsH42LiEELQD5tF iTvINRi66D8314agFBdmYR5P75keyGjQbsHATPJ4/sdGIX3jwkH5kFe1J2/YOSgvZzep ChhlOTxLwKWrucwhBRppig47WvMeebF7aAcLE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744531697; x=1745136497; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FwUipkLPayRBMVMY/WEWBYD/1LRFLG77JccqIaat+ks=; b=UAziuapUwBY0t3ODJ0UotFOTHpIt8nGixSuP1/tHSxn78UeAIuQirG7PJnZpJDUMSO 53Djkij4eZM387t/FDWXJiv+oNcTyL7KKYFQrP4DhGATkzM4SrXuMfFYccwczt7JFgQg ap4BYec+yazz1GmnQSZbV9YqRAvzPx4/7yhqwAo3TzVL9c3bu638ZmPmAMlRalrEOEeZ abo/q0zLYOZvgDN6EuIdYsqXyyBREBsY7PnAXCU77Ph+fZfPkaHTHd1F+naBharhwnXz yRl1FIA1BzehcYJvhe8zDWxivkVKDaKn33IDl9rRhxe1kzWW2TWevAas2BAV5uvpS1St 3xLQ== X-Gm-Message-State: AOJu0YzNTiwsFiWYQuxUsERg6xpqB1TTRf5WwBgrJ3v2VcHTIj5aV975 VA5nXABMOJmI3RcUJqDMO0hjJ2JJ1cT84ZDm+iUuh2Ruh4B1Xrsyr5G3gznOsxQNsE8vp9bxPiR C9fdLJA== X-Gm-Gg: ASbGnctbZ25rHd2ulxO99k/6Wduiv1r2ftx/afh+EaIVwoWnniP114m+na83pfIfJ1o lFwpfag8GffEz50BiNqacahmEgJ/SUNQ5GZ5TDevjwz/3QjvqbYquOA1nfkYvNmtet3KdzbLnbt 3zn5dAw7o14NulXkg/rS2FYudf9IJyV8SllHwf2+TpZ26a6P5Qr5XCsGCjKUpwMFVpVjH92VYIi Lj2BNCqMcM3zoJGtgiq119UAD5fswh6W7Maiev3iyjSdh2lo9j8SXv5zHOuQ15PqcfUexEJuYyD SM+FUTe52yiA+xHrsRd7E/tm7A8Umi7FKaB8DjKSDdUne9A6yoErd45FW8PltMLRnIfSz7UG3ym fDV/a12srsV1lsUQLYS7xVvZwfx7DF3xhFecsLux/M8XgIqE= X-Google-Smtp-Source: AGHT+IFvL3pKC9hlInSbSN5sWFdyUqzix2bLyMbDDgycrvK/vIDp3gUHz8J9uPFK2YYyx/5ptiymow== X-Received: by 2002:a05:6000:1447:b0:391:3988:1c97 with SMTP id ffacd0b85a97d-39ea52036d2mr5932884f8f.17.1744531697401; Sun, 13 Apr 2025 01:08:17 -0700 (PDT) Received: from P-ASN-ECS-830T8C3.home (2a01cb000deef00090089785c06a34e3.ipv6.abo.wanadoo.fr. [2a01:cb00:dee:f000:9008:9785:c06a:34e3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39eaf43d053sm7289212f8f.68.2025.04.13.01.08.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Apr 2025 01:08:16 -0700 (PDT) From: Yoann Congal To: openembedded-devel@lists.openembedded.org Cc: Yoann Congal Subject: [meta-python][PATCH 2/2] python3-evdev: Fix buildpaths errors and reproducibility Date: Sun, 13 Apr 2025 10:08:02 +0200 Message-Id: <20250413080802.602658-2-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250413080802.602658-1-yoann.congal@smile.fr> References: <20250413080802.602658-1-yoann.congal@smile.fr> 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 ; Sun, 13 Apr 2025 08:08:24 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/116823 From: Yoann Congal Add a submitted patch to support the reproducible generation of intermediate file ecodes.c, then, use it to fix the buildpaths errors. Signed-off-by: Yoann Congal --- ...ibility-option-for-building-ecodes.c.patch | 116 ++++++++++++++++++ .../python/python3-evdev_1.9.1.bb | 5 +- 2 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 meta-python/recipes-devtools/python/python3-evdev/0001-Add-a-reproducibility-option-for-building-ecodes.c.patch diff --git a/meta-python/recipes-devtools/python/python3-evdev/0001-Add-a-reproducibility-option-for-building-ecodes.c.patch b/meta-python/recipes-devtools/python/python3-evdev/0001-Add-a-reproducibility-option-for-building-ecodes.c.patch new file mode 100644 index 0000000000..e730519884 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-evdev/0001-Add-a-reproducibility-option-for-building-ecodes.c.patch @@ -0,0 +1,116 @@ +From d05c1c9dd298cb95d7feccbddb5caa043a319a01 Mon Sep 17 00:00:00 2001 +From: Yoann Congal +Date: Sun, 13 Apr 2025 00:52:13 +0200 +Subject: [PATCH] Add a reproducibility option for building ecodes.c + +ecodes.c currently contains the kernel info of the build machine and the +full path of the input*.h headers: This is not reproducible as output +can change even is headers content do not. Downstream distributions +might package ecodes.c and get non-reproducible output. + +To fix this: introduce a --reproducible option in the build: +- in setup.py build_ecodes command +- in underlying genecodes_c.py + +Note: These options are disabled by default so no change is expected in +current builds. + +Signed-off-by: Yoann Congal +Upstream-Status: Submitted [https://github.com/gvalkov/python-evdev/pull/242] +--- + setup.py | 13 ++++++++++--- + src/evdev/genecodes_c.py | 17 +++++++++++------ + 2 files changed, 21 insertions(+), 9 deletions(-) + +diff --git a/setup.py b/setup.py +index 6b721d7..3371199 100755 +--- a/setup.py ++++ b/setup.py +@@ -14,7 +14,7 @@ curdir = Path(__file__).resolve().parent + ecodes_c_path = curdir / "src/evdev/ecodes.c" + + +-def create_ecodes(headers=None): ++def create_ecodes(headers=None, reproducibility=False): + if not headers: + include_paths = set() + cpath = os.environ.get("CPATH", "").strip() +@@ -65,7 +65,10 @@ def create_ecodes(headers=None): + + print("writing %s (using %s)" % (ecodes_c_path, " ".join(headers))) + with ecodes_c_path.open("w") as fh: +- cmd = [sys.executable, "src/evdev/genecodes_c.py", "--ecodes", *headers] ++ cmd = [sys.executable, "src/evdev/genecodes_c.py"] ++ if reproducibility: ++ cmd.append("--reproducibility") ++ cmd.extend(["--ecodes", *headers]) + run(cmd, check=True, stdout=fh) + + +@@ -74,17 +77,21 @@ class build_ecodes(Command): + + user_options = [ + ("evdev-headers=", None, "colon-separated paths to input subsystem headers"), ++ ("reproducibility", None, "hide host details (host/paths) to create a reproducible output"), + ] + + def initialize_options(self): + self.evdev_headers = None ++ self.reproducibility = False + + def finalize_options(self): + if self.evdev_headers: + self.evdev_headers = self.evdev_headers.split(":") ++ if self.reproducibility is None: ++ self.reproducibility = False + + def run(self): +- create_ecodes(self.evdev_headers) ++ create_ecodes(self.evdev_headers, reproducibility=self.reproducibility) + + + class build_ext(_build_ext.build_ext): +diff --git a/src/evdev/genecodes_c.py b/src/evdev/genecodes_c.py +index 5c2d946..24cad27 100644 +--- a/src/evdev/genecodes_c.py ++++ b/src/evdev/genecodes_c.py +@@ -15,22 +15,27 @@ headers = [ + "/usr/include/linux/uinput.h", + ] + +-opts, args = getopt.getopt(sys.argv[1:], "", ["ecodes", "stubs"]) ++opts, args = getopt.getopt(sys.argv[1:], "", ["ecodes", "stubs", "reproducibility"]) + if not opts: +- print("usage: genecodes.py [--ecodes|--stubs] ") ++ print("usage: genecodes.py [--ecodes|--stubs] [--reproducibility] ") + exit(2) + + if args: + headers = args + ++reproducibility = ("--reproducibility", "") in opts ++ + + # ----------------------------------------------------------------------------- + macro_regex = r"#define\s+((?:KEY|ABS|REL|SW|MSC|LED|BTN|REP|SND|ID|EV|BUS|SYN|FF|UI_FF|INPUT_PROP)_\w+)" + macro_regex = re.compile(macro_regex) + +-# Uname without hostname. +-uname = list(os.uname()) +-uname = " ".join((uname[0], *uname[2:])) ++if reproducibility: ++ uname = "hidden for reproducibility" ++else: ++ # Uname without hostname. ++ uname = list(os.uname()) ++ uname = " ".join((uname[0], *uname[2:])) + + + # ----------------------------------------------------------------------------- +@@ -138,5 +143,5 @@ elif ("--stubs", "") in opts: + template = template_stubs + + body = os.linesep.join(body) +-text = template % (uname, headers, body) ++text = template % (uname, headers if not reproducibility else ["hidden for reproducibility"], body) + print(text.strip()) diff --git a/meta-python/recipes-devtools/python/python3-evdev_1.9.1.bb b/meta-python/recipes-devtools/python/python3-evdev_1.9.1.bb index b8930c97d5..af88770c59 100644 --- a/meta-python/recipes-devtools/python/python3-evdev_1.9.1.bb +++ b/meta-python/recipes-devtools/python/python3-evdev_1.9.1.bb @@ -3,6 +3,7 @@ HOMEPAGE = "https://github.com/gvalkov/python-evdev" LICENSE = "BSD-3-Clause" LIC_FILES_CHKSUM = "file://LICENSE;md5=d7bd1cc4c71b706c7e2d4053aef50f2a" +SRC_URI += "file://0001-Add-a-reproducibility-option-for-building-ecodes.c.patch" SRC_URI[sha256sum] = "dc640a064cb1c9fe1f8b970dc2039945a2a275d7b7ee62284bf427238abe45ee" inherit pypi python_setuptools_build_meta @@ -12,7 +13,8 @@ do_compile:prepend() { } PEP517_BUILD_OPTS = "--config-setting=--build-option='build_ecodes \ - --evdev-headers ${STAGING_DIR_TARGET}/usr/include/linux/input.h:${STAGING_DIR_TARGET}/usr/include/linux/input-event-codes.h'" + --evdev-headers ${STAGING_DIR_TARGET}/usr/include/linux/input.h:${STAGING_DIR_TARGET}/usr/include/linux/input-event-codes.h \ + --reproducibility'" RDEPENDS:${PN} += "\ python3-ctypes \ @@ -21,4 +23,3 @@ RDEPENDS:${PN} += "\ python3-shell \ python3-stringold \ " -INSANE_SKIP:${PN}-src = "buildpaths"