diff mbox series

xcb-util-errors: fix racing on out of source tree build

Message ID 20250925075646.1146511-1-hongxu.jia@windriver.com
State New
Headers show
Series xcb-util-errors: fix racing on out of source tree build | expand

Commit Message

Hongxu Jia Sept. 25, 2025, 7:56 a.m. UTC
While building out of source tree, there is a racing issue
on the existence of dir ./src
...
python3 ../sources/xcb-util-errors-1.0.1/src/extensions.py src/extensions.c.tmp path-to/1.0.1/recipe-sysroot/usr/share/xcb/*.xml && \
mv src/extensions.c.tmp src/extensions.c
  File "src/extensions.py", line 91, in <module>
    output = open(output_file, "w")
FileNotFoundError: [Errno 2] No such file or directory: 'src/extensions.c.tmp'
make: *** [Makefile:1435: src/extensions.c] Error 1
...

Explicitly create dir ./src before generating src/extensions.c.tmp

Inherit python3native to instead of host python3 to run python script

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 ...x-racing-on-out-of-source-tree-build.patch | 38 +++++++++++++++++++
 .../xorg-lib/xcb-util-errors_1.0.1.bb         |  7 +++-
 2 files changed, 43 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-graphics/xorg-lib/xcb-util-errors/0001-fix-racing-on-out-of-source-tree-build.patch

Comments

Ross Burton Sept. 29, 2025, 4:41 p.m. UTC | #1
On 25 Sep 2025, at 08:56, hongxu via lists.openembedded.org <hongxu.jia=eng.windriver.com@lists.openembedded.org> wrote:
> +Upstream-Status: Submitted [xorg-devel@lists.x.org]

Patches should be submitted to GitLab I believe:

https://gitlab.freedesktop.org/xorg/lib/libxcb-errors

> +inherit python3native

There is no need for this, we have a perfectly good python running bitbake.

Ross
Hongxu Jia Oct. 10, 2025, 5:52 a.m. UTC | #2
On 9/30/25 00:41, Ross Burton via lists.openembedded.org wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
> On 25 Sep 2025, at 08:56, hongxu via lists.openembedded.org<hongxu.jia=eng.windriver.com@lists.openembedded.org>  wrote:
>> +Upstream-Status: Submitted [xorg-devel@lists.x.org]
> Patches should be submitted to GitLab I believe:
>
> https://gitlab.freedesktop.org/xorg/lib/libxcb-errors

I do not have permission (no new accounts) to submit a pull request, the 
message from https://gitlab.freedesktop.org/xorg/lib/libxcb-errors

...

Due to an influx of spam, we have had to impose restrictions on new 
accounts. Please see this wiki page 
<https://gitlab.freedesktop.org/freedesktop/freedesktop/-/wikis/home> 
for instructions on how to get full permissions. Sorry for the 
inconvenience.

...

>
>> +inherit python3native
> There is no need for this, we have a perfectly good python running bitbake.

The python to run bitbake is depends on the host, it is better to use 
python3-native to build recipe to avoid host contamination?

//Hongxu

>
> Ross
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#224155):https://lists.openembedded.org/g/openembedded-core/message/224155
> Mute This Topic:https://lists.openembedded.org/mt/115426771/3617049
> Group Owner:openembedded-core+owner@lists.openembedded.org
> Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub  [hongxu.jia@eng.windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Ross Burton Oct. 17, 2025, 4:53 p.m. UTC | #3
On 10 Oct 2025, at 06:52, Hongxu Jia <hongxu.jia@windriver.com> wrote:
> 
> I do not have permission (no new accounts) to submit a pull request, the message from https://gitlab.freedesktop.org/xorg/lib/libxcb-errors
> ...
> Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.

The wiki page has instructions to get full permissions, did you do that so you can file a pull request?

Ross
diff mbox series

Patch

diff --git a/meta/recipes-graphics/xorg-lib/xcb-util-errors/0001-fix-racing-on-out-of-source-tree-build.patch b/meta/recipes-graphics/xorg-lib/xcb-util-errors/0001-fix-racing-on-out-of-source-tree-build.patch
new file mode 100644
index 0000000000..c4b68470df
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/xcb-util-errors/0001-fix-racing-on-out-of-source-tree-build.patch
@@ -0,0 +1,38 @@ 
+From 54fdc743fbf0ea137b29c580fbeffe4afa610a78 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 25 Sep 2025 15:19:31 +0800
+Subject: [PATCH] fix racing on out of source tree build
+
+While building out of source tree, there is a racing issue
+on the existence of dir ./src
+...
+python3 ../sources/xcb-util-errors-1.0.1/src/extensions.py src/extensions.c.tmp path-to/1.0.1/recipe-sysroot/usr/share/xcb/*.xml && \
+mv src/extensions.c.tmp src/extensions.c
+  File "src/extensions.py", line 91, in <module>
+    output = open(output_file, "w")
+FileNotFoundError: [Errno 2] No such file or directory: 'src/extensions.c.tmp'
+make: *** [Makefile:1435: src/extensions.c] Error 1
+...
+
+Explicitly create dir ./src before generating src/extensions.c.tmp
+
+Upstream-Status: Submitted [xorg-devel@lists.x.org]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index bdf4a30..9defbb8 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -37,5 +37,5 @@ tests_test_LDADD = libxcb-errors.la $(XCB_LIBS)
+ CLEANFILES = src/extensions.c
+ 
+ src/extensions.c: src/extensions.py
+-	$(AM_V_GEN)$(PYTHON) $(srcdir)/src/extensions.py $@.tmp ${XCBPROTO_XCBINCLUDEDIR}/*.xml && \
++	mkdir -p src && $(AM_V_GEN)$(PYTHON) $(srcdir)/src/extensions.py $@.tmp ${XCBPROTO_XCBINCLUDEDIR}/*.xml && \
+ 	mv $@.tmp $@
+-- 
+2.34.1
+
diff --git a/meta/recipes-graphics/xorg-lib/xcb-util-errors_1.0.1.bb b/meta/recipes-graphics/xorg-lib/xcb-util-errors_1.0.1.bb
index 1f6e63d37c..5681409a09 100644
--- a/meta/recipes-graphics/xorg-lib/xcb-util-errors_1.0.1.bb
+++ b/meta/recipes-graphics/xorg-lib/xcb-util-errors_1.0.1.bb
@@ -1,12 +1,15 @@ 
 require recipes-graphics/xorg-lib/xcb-util.inc
 
+SRC_URI += " \
+    file://0001-fix-racing-on-out-of-source-tree-build.patch \
+"
 SUMMARY = "xcb-util-errors gives human readable names to error codes and event codes"
 
 DEPENDS += "xcb-util xorgproto"
 
-export PYTHON = "python3"
-
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://COPYING;md5=c90ee77011043c608617f5323a523726"
 
 SRC_URI[sha256sum] = "5628c87b984259ad927bacd8a42958319c36bdf4b065887803c9d820fb80f357"
+
+inherit python3native