Skip to contentSkip to conversation

python3-h5py: fix compile error with gcc 14

PATCH In review [email protected] 2 participants 3 messages Jul 18, 2024 – Jul 19, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python3-h5py: fix compile error with gcc 14

From: Changqing Li <[email protected]>

Backport two patches to fix following compile error:

h5py/h5l.c: In function ‘__pyx_pf_4h5py_3h5l_9LinkProxy_12get_val’:
h5py/h5l.c:8152:107: error: passing argument 4 of ‘__pyx_f_4h5py_4defs_H5Lunpack_elink_val’ from incompatible pointer type [-Wincompatible-pointer-types]

 8152 |       __pyx_t_2 = __pyx_f_4h5py_4defs_H5Lunpack_elink_val(__pyx_v_buf, __pyx_v_buf_size, (&__pyx_v_wtf), (&__pyx_v_ext_file_name), (&__pyx_v_ext_obj_name)); if (unlikely(__pyx_t_2 == ((herr_t)((herr_t)-1L)))) __PYX_ERR(1, 187, __pyx_L5_error)
      |                                                                                                          ~^~~~~~~~~~~~~~~~~~~~~~~
      |                                                                                                           |
      |
---
 ...001-Use-libc.stdint-instead-of-numpy.patch | 27 +++++++++++++++++++
 ...ast-arguments-to-H5Lunpack_elink_val.patch | 27 +++++++++++++++++++
 .../python/python3-h5py_3.10.0.bb             |  5 +++-
 3 files changed, 58 insertions(+), 1 deletion(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-h5py/0001-Use-libc.stdint-instead-of-numpy.patch
 create mode 100644 meta-python/recipes-devtools/python/python3-h5py/0002-Properly-cast-arguments-to-H5Lunpack_elink_val.patch
meta-python/recipes-devtools/python/python3-h5py/0001-Use-libc.stdint-instead-of-numpy.patch new file +27 -0
new file mode 100644
index 000000000..3c55fa697
@@ -0,0 +1,27 @@
+From 434e1bf4ab9fa53ec1293cde86f4dbec6784e50f Mon Sep 17 00:00:00 2001
+From: Orion Poplawski <[email protected]>
+Date: Thu, 22 Feb 2024 08:41:17 -0700
+Subject: [PATCH 1/2] Use libc.stdint instead of numpy
+
+Upstream-Status: Backport [https://github.com/h5py/h5py/pull/2382/commits/387a22b8c1513800c0401f496b4ed512c1639798]
+Signed-off-by: Changqing Li <[email protected]>
+---
+ h5py/api_types_ext.pxd                   | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/h5py/api_types_ext.pxd b/h5py/api_types_ext.pxd
+index 91acb128..55a239f5 100644
+--- a/h5py/api_types_ext.pxd
++++ b/h5py/api_types_ext.pxd
+@@ -20,7 +20,7 @@ from libc.string cimport strlen, strchr, strcpy, strncpy, strcmp,\
+ ctypedef long size_t
+ from libc.time cimport time_t
+ 
+-from numpy cimport int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t
++from libc.stdint cimport int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t
+ 
+ IF UNAME_SYSNAME != "Windows":
+     cdef extern from "unistd.h":
+-- 
+2.25.1
+
meta-python/recipes-devtools/python/python3-h5py/0002-Properly-cast-arguments-to-H5Lunpack_elink_val.patch new file +27 -0
new file mode 100644
index 000000000..0f77f745a
@@ -0,0 +1,27 @@
+From 9ed4f80fd482e135119086fb2015ca97dce306ae Mon Sep 17 00:00:00 2001
+From: Orion Poplawski <[email protected]>
+Date: Thu, 15 Feb 2024 20:47:50 -0700
+Subject: [PATCH 2/2] Properly cast arguments to H5Lunpack_elink_val
+
+Upstream-Status: Backport [https://github.com/h5py/h5py/pull/2380/commits/704e13ac83b42898514610c4df9f32f367e767e4]
+Signed-off-by: Changqing Li <[email protected]>
+---
+ h5py/h5l.pyx         | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/h5py/h5l.pyx b/h5py/h5l.pyx
+index 60b252fa..af725bdb 100644
+--- a/h5py/h5l.pyx
++++ b/h5py/h5l.pyx
+@@ -184,7 +184,7 @@ cdef class LinkProxy:
+             if info.type == H5L_TYPE_SOFT:
+                 py_retval = buf
+             else:
+-                H5Lunpack_elink_val(buf, buf_size, &wtf, &ext_file_name, &ext_obj_name)
++                H5Lunpack_elink_val(buf, buf_size, &wtf, <const char **>&ext_file_name, <const char **>&ext_obj_name)
+                 py_retval = (bytes(ext_file_name), bytes(ext_obj_name))
+         finally:
+             efree(buf)
+-- 
+2.25.1
+
meta-python/recipes-devtools/python/python3-h5py_3.10.0.bb +4 -1
index 8a9158525..d557a8188 100644
@@ -7,7 +7,10 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=113251d71fb0384712c719b567261c5c"
 SRC_URI[sha256sum] = "d93adc48ceeb33347eb24a634fb787efc7ae4644e6ea4ba733d099605045c049"
 
 SRC_URI += "file://0001-setup_build.py-avoid-absolute-path.patch \
-            file://0001-Fix-Cython-3-compatibility.patch"
+            file://0001-Fix-Cython-3-compatibility.patch \
+            file://0001-Use-libc.stdint-instead-of-numpy.patch \
+            file://0002-Properly-cast-arguments-to-H5Lunpack_elink_val.patch \
+"
 
 inherit pkgconfig pypi setuptools3
 
Signature · 1 line
2.25.1
#1 lore raw

You should remove the -Wno-error flags from:
https://git.openembedded.org/meta-openembedded/diff/meta-python/recipes-devtools/python/python3-h5py_3.11.0.bb?id=f0c767407d033e3f39ceeccc2f7e03a1ca7a6443
if your change fixes it.

Quoted 115 lines · Changqing Li via lists.openembedded.org

From: Changqing Li <[email protected]>

Backport two patches to fix following compile error:

h5py/h5l.c: In function ‘__pyx_pf_4h5py_3h5l_9LinkProxy_12get_val’:
h5py/h5l.c:8152:107: error: passing argument 4 of ‘__pyx_f_4h5py_4defs_H5Lunpack_elink_val’ from incompatible pointer type [-Wincompatible-pointer-types]

 8152 |       __pyx_t_2 = __pyx_f_4h5py_4defs_H5Lunpack_elink_val(__pyx_v_buf, __pyx_v_buf_size, (&__pyx_v_wtf), (&__pyx_v_ext_file_name), (&__pyx_v_ext_obj_name)); if (unlikely(__pyx_t_2 == ((herr_t)((herr_t)-1L)))) __PYX_ERR(1, 187, __pyx_L5_error)
      |                                                                                                          ~^~~~~~~~~~~~~~~~~~~~~~~
      |                                                                                                           |
      |
---
 ...001-Use-libc.stdint-instead-of-numpy.patch | 27 +++++++++++++++++++
 ...ast-arguments-to-H5Lunpack_elink_val.patch | 27 +++++++++++++++++++
 .../python/python3-h5py_3.10.0.bb             |  5 +++-
 3 files changed, 58 insertions(+), 1 deletion(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-h5py/0001-Use-libc.stdint-instead-of-numpy.patch
 create mode 100644 meta-python/recipes-devtools/python/python3-h5py/0002-Properly-cast-arguments-to-H5Lunpack_elink_val.patch
meta-python/recipes-devtools/python/python3-h5py/0001-Use-libc.stdint-instead-of-numpy.patch new file +27 -0
new file mode 100644
index 000000000..3c55fa697
@@ -0,0 +1,27 @@
+From 434e1bf4ab9fa53ec1293cde86f4dbec6784e50f Mon Sep 17 00:00:00 2001
+From: Orion Poplawski <[email protected]>
+Date: Thu, 22 Feb 2024 08:41:17 -0700
+Subject: [PATCH 1/2] Use libc.stdint instead of numpy
+
+Upstream-Status: Backport [https://github.com/h5py/h5py/pull/2382/commits/387a22b8c1513800c0401f496b4ed512c1639798]
+Signed-off-by: Changqing Li <[email protected]>
+---
+ h5py/api_types_ext.pxd                   | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/h5py/api_types_ext.pxd b/h5py/api_types_ext.pxd
+index 91acb128..55a239f5 100644
+--- a/h5py/api_types_ext.pxd
++++ b/h5py/api_types_ext.pxd
+@@ -20,7 +20,7 @@ from libc.string cimport strlen, strchr, strcpy, strncpy, strcmp,\
+ ctypedef long size_t
+ from libc.time cimport time_t
+
+-from numpy cimport int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t
++from libc.stdint cimport int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t
+
+ IF UNAME_SYSNAME != "Windows":
+     cdef extern from "unistd.h":
+--
+2.25.1
+
meta-python/recipes-devtools/python/python3-h5py/0002-Properly-cast-arguments-to-H5Lunpack_elink_val.patch new file +27 -0
new file mode 100644
index 000000000..0f77f745a
@@ -0,0 +1,27 @@
+From 9ed4f80fd482e135119086fb2015ca97dce306ae Mon Sep 17 00:00:00 2001
+From: Orion Poplawski <[email protected]>
+Date: Thu, 15 Feb 2024 20:47:50 -0700
+Subject: [PATCH 2/2] Properly cast arguments to H5Lunpack_elink_val
+
+Upstream-Status: Backport [https://github.com/h5py/h5py/pull/2380/commits/704e13ac83b42898514610c4df9f32f367e767e4]
+Signed-off-by: Changqing Li <[email protected]>
+---
+ h5py/h5l.pyx         | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/h5py/h5l.pyx b/h5py/h5l.pyx
+index 60b252fa..af725bdb 100644
+--- a/h5py/h5l.pyx
++++ b/h5py/h5l.pyx
+@@ -184,7 +184,7 @@ cdef class LinkProxy:
+             if info.type == H5L_TYPE_SOFT:
+                 py_retval = buf
+             else:
+-                H5Lunpack_elink_val(buf, buf_size, &wtf, &ext_file_name, &ext_obj_name)
++                H5Lunpack_elink_val(buf, buf_size, &wtf, <const char **>&ext_file_name, <const char **>&ext_obj_name)
+                 py_retval = (bytes(ext_file_name), bytes(ext_obj_name))
+         finally:
+             efree(buf)
+--
+2.25.1
+
meta-python/recipes-devtools/python/python3-h5py_3.10.0.bb +4 -2
index 8a9158525..d557a8188 100644
@@ -7,7 +7,10 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=113251d71fb0384712c719b567261c5c"
 SRC_URI[sha256sum] = "d93adc48ceeb33347eb24a634fb787efc7ae4644e6ea4ba733d099605045c049"
 
 SRC_URI += "file://0001-setup_build.py-avoid-absolute-path.patch \
-            file://0001-Fix-Cython-3-compatibility.patch"
+            file://0001-Fix-Cython-3-compatibility.patch \
+            file://0001-Use-libc.stdint-instead-of-numpy.patch \
+            file://0002-Properly-cast-arguments-to-H5Lunpack_elink_val.patch \
+"
 
 inherit pkgconfig pypi setuptools3
 
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#111389): https://lists.openembedded.org/g/openembedded-devel/message/111389
Mute This Topic: https://lists.openembedded.org/mt/107411257/3617156
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw
Quoted 6 lines · Martin Jansa

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.

You should remove the -Wno-error flags from:
https://git.openembedded.org/meta-openembedded/diff/meta-python/recipes-devtools/python/python3-h5py_3.11.0.bb?id=f0c767407d033e3f39ceeccc2f7e03a1ca7a6443
if your change fixes it.

You are right,  this can be removed.  I will send another patch for master to remove this.

3.11.0 already contains the fix. This patch is for scarthgap which still 3.10.0.

Thanks

Changqing

Quoted 118 lines
Quoted 114 lines · Changqing Li via lists.openembedded.org

From: Changqing Li<[email protected]>

Backport two patches to fix following compile error:

h5py/h5l.c: In function ‘__pyx_pf_4h5py_3h5l_9LinkProxy_12get_val’:
h5py/h5l.c:8152:107: error: passing argument 4 of ‘__pyx_f_4h5py_4defs_H5Lunpack_elink_val’ from incompatible pointer type [-Wincompatible-pointer-types]

  8152 |       __pyx_t_2 = __pyx_f_4h5py_4defs_H5Lunpack_elink_val(__pyx_v_buf, __pyx_v_buf_size, (&__pyx_v_wtf), (&__pyx_v_ext_file_name), (&__pyx_v_ext_obj_name)); if (unlikely(__pyx_t_2 == ((herr_t)((herr_t)-1L)))) __PYX_ERR(1, 187, __pyx_L5_error)
       |                                                                                                          ~^~~~~~~~~~~~~~~~~~~~~~~
       |                                                                                                           |
       |
---
  ...001-Use-libc.stdint-instead-of-numpy.patch | 27 +++++++++++++++++++
  ...ast-arguments-to-H5Lunpack_elink_val.patch | 27 +++++++++++++++++++
  .../python/python3-h5py_3.10.0.bb             |  5 +++-
  3 files changed, 58 insertions(+), 1 deletion(-)

create mode 100644 meta-python/recipes-devtools/python/python3-h5py/0001-Use-libc.stdint-instead-of-numpy.patch create mode 100644 meta-python/recipes-devtools/python/python3-h5py/0002-Properly-cast-arguments-to-H5Lunpack_elink_val.patch

meta-python/recipes-devtools/python/python3-h5py/0001-Use-libc.stdint-instead-of-numpy.patch new file +27 -0
new file mode 100644
index 000000000..3c55fa697
@@ -0,0 +1,27 @@
+From 434e1bf4ab9fa53ec1293cde86f4dbec6784e50f Mon Sep 17 00:00:00 2001
+From: Orion Poplawski<[email protected]>
+Date: Thu, 22 Feb 2024 08:41:17 -0700
+Subject: [PATCH 1/2] Use libc.stdint instead of numpy
+
+Upstream-Status: Backport [https://github.com/h5py/h5py/pull/2382/commits/387a22b8c1513800c0401f496b4ed512c1639798]
+Signed-off-by: Changqing Li<[email protected]>
+---
+ h5py/api_types_ext.pxd                   | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/h5py/api_types_ext.pxd b/h5py/api_types_ext.pxd
+index 91acb128..55a239f5 100644
+--- a/h5py/api_types_ext.pxd
++++ b/h5py/api_types_ext.pxd
+@@ -20,7 +20,7 @@ from libc.string cimport strlen, strchr, strcpy, strncpy, strcmp,\
+ ctypedef long size_t
+ from libc.time cimport time_t
+
+-from numpy cimport int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t
++from libc.stdint cimport int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t
+
+ IF UNAME_SYSNAME != "Windows":
+     cdef extern from "unistd.h":
+--
+2.25.1
+
meta-python/recipes-devtools/python/python3-h5py/0002-Properly-cast-arguments-to-H5Lunpack_elink_val.patch new file +27 -0
new file mode 100644
index 000000000..0f77f745a
@@ -0,0 +1,27 @@
+From 9ed4f80fd482e135119086fb2015ca97dce306ae Mon Sep 17 00:00:00 2001
+From: Orion Poplawski<[email protected]>
+Date: Thu, 15 Feb 2024 20:47:50 -0700
+Subject: [PATCH 2/2] Properly cast arguments to H5Lunpack_elink_val
+
+Upstream-Status: Backport [https://github.com/h5py/h5py/pull/2380/commits/704e13ac83b42898514610c4df9f32f367e767e4]
+Signed-off-by: Changqing Li<[email protected]>
+---
+ h5py/h5l.pyx         | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/h5py/h5l.pyx b/h5py/h5l.pyx
+index 60b252fa..af725bdb 100644
+--- a/h5py/h5l.pyx
++++ b/h5py/h5l.pyx
+@@ -184,7 +184,7 @@ cdef class LinkProxy:
+             if info.type == H5L_TYPE_SOFT:
+                 py_retval = buf
+             else:
+-                H5Lunpack_elink_val(buf, buf_size, &wtf, &ext_file_name, &ext_obj_name)
++                H5Lunpack_elink_val(buf, buf_size, &wtf, <const char **>&ext_file_name, <const char **>&ext_obj_name)
+                 py_retval = (bytes(ext_file_name), bytes(ext_obj_name))
+         finally:
+             efree(buf)
+--
+2.25.1
+
meta-python/recipes-devtools/python/python3-h5py_3.10.0.bb +0 -0
index 8a9158525..d557a8188 100644
@@ -7,7 +7,10 @@ LIC_FILES_CHKSUM ="file://LICENSE;md5=113251d71fb0384712c719b567261c5c"
  SRC_URI[sha256sum] = "d93adc48ceeb33347eb24a634fb787efc7ae4644e6ea4ba733d099605045c049"
 
  SRC_URI +="file://0001-setup_build.py-avoid-absolute-path.patch \ - 

file://0001-Fix-Cython-3-compatibility.patch"

meta-python/recipes-devtools/python/python3-h5py_3.10.0.bb +4 -1
+file://0001-Fix-Cython-3-compatibility.patch  \
+file://0001-Use-libc.stdint-instead-of-numpy.patch  \
+file://0002-Properly-cast-arguments-to-H5Lunpack_elink_val.patch  \
+"
 
  inherit pkgconfig pypi setuptools3
 
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#111389):https://lists.openembedded.org/g/openembedded-devel/message/111389 Mute This Topic:https://lists.openembedded.org/mt/107411257/3617156
Group Owner:[email protected] Unsubscribe:https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-