From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Ralf Dragon <hypnotoad@lindra.de>
Cc: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>,
Asaf Kahlon <asafka7@gmail.com>,
buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] python-sip: fix compile error
Date: Sat, 25 Nov 2023 23:04:39 +0100 [thread overview]
Message-ID: <20231125220439.GQ3177259@scaer> (raw)
In-Reply-To: <20231123174105.2435757-1-hypnotoad@lindra.de>
Ralf, All,
On 2023-11-23 18:41 +0100, Ralf Dragon spake thusly:
> Without the patch, python-sip fails with:
>
> siplib.c: In function ‘sip_api_get_frame’:
> siplib.c:13750:22: error: invalid use of undefined type ‘struct _frame’
> 13750 | frame = frame->f_back;
>
> Signed-off-by: Ralf Dragon <hypnotoad@lindra.de>
Thanks for this patch; please find below a few comments.
> ---
> package/python-sip/0002-fixframe.patch | 46 ++++++++++++++++++++++++++
> 1 file changed, 46 insertions(+)
> create mode 100644 package/python-sip/0002-fixframe.patch
>
> diff --git a/package/python-sip/0002-fixframe.patch b/package/python-sip/0002-fixframe.patch
> new file mode 100644
> index 0000000000..86eb878b11
> --- /dev/null
> +++ b/package/python-sip/0002-fixframe.patch
> @@ -0,0 +1,46 @@
> +Signed-off-by: Ralf Dragon <hypnotoad@lindra.de>
$ ./utils/docker-run make check-package
package/python-sip/0002-fixframe.patch:0: missing Upstream in the header (http://nightly.buildroot.org/#_additional_patch_documentation)
A bundled patch should be formatted like a proper patch, with a commit
log and explanations for the patch, ready to be submitted upstream:
https://buildroot.org/downloads/manual/manual.html#patch-policy
Here, you'd want to explain why it now fails, so that we can assess
whether we need to backport the fix to maintainance branches.
So, something along the lines of:
siplib: fix build with python >= 3.11
With python 3.11, the PyFrameObject structure members have been
removed from the public C API:
https://docs.python.org/3.11/whatsnew/3.11.html#whatsnew311-c-api-porting
https://docs.python.org/3.11/whatsnew/3.11.html#pyframeobject-3-11-hiding
So, use the proper object type that can store an actual
PyFrameObject.
Signed-off-by: Your Name <your@mail>
Upstream: [upstream status]
(please adapt the above, it's mostly for illustration)
We also try hard to push patches upstream so that we do not have to
carry them indefinitely. Please try and submit that patch to the SIP
project:
https://riverbankcomputing.com/support/lists
> +Index: host-python-sip-4.19.25/siplib/sip.h
> +===================================================================
What diff fornat is that? We usually have plain diff, or git-formatted
patches.
Can you look into reworking this patch of yours, please?
Regards,
Yann E. MORIN.
> +--- host-python-sip-4.19.25.orig/siplib/sip.h
> ++++ host-python-sip-4.19.25/siplib/sip.h
> +@@ -1799,7 +1799,7 @@ typedef struct _sipAPIDef {
> + int (*api_get_time)(PyObject *, sipTimeDef *);
> + PyObject *(*api_from_time)(const sipTimeDef *);
> + int (*api_is_user_type)(const sipWrapperType *);
> +- struct _frame *(*api_get_frame)(int);
> ++ PyFrameObject *(*api_get_frame)(int);
> + int (*api_check_plugin_for_type)(const sipTypeDef *, const char *);
> + PyObject *(*api_unicode_new)(SIP_SSIZE_T, unsigned, int *, void **);
> + void (*api_unicode_write)(int, void *, int, unsigned);
> +Index: host-python-sip-4.19.25/siplib/siplib.c
> +===================================================================
> +--- host-python-sip-4.19.25.orig/siplib/siplib.c
> ++++ host-python-sip-4.19.25/siplib/siplib.c
> +@@ -448,7 +448,7 @@ static PyObject *sip_api_from_datetime(c
> + static int sip_api_get_time(PyObject *obj, sipTimeDef *time);
> + static PyObject *sip_api_from_time(const sipTimeDef *time);
> + static int sip_api_is_user_type(const sipWrapperType *wt);
> +-static struct _frame *sip_api_get_frame(int);
> ++static PyFrameObject *sip_api_get_frame(int);
> + static int sip_api_check_plugin_for_type(const sipTypeDef *td,
> + const char *name);
> + static PyObject *sip_api_unicode_new(SIP_SSIZE_T len, unsigned maxchar,
> +@@ -13741,13 +13741,13 @@ static int sip_api_is_user_type(const si
> + /*
> + * Return a frame from the execution stack.
> + */
> +-static struct _frame *sip_api_get_frame(int depth)
> ++static PyFrameObject *sip_api_get_frame(int depth)
> + {
> +- struct _frame *frame = PyEval_GetFrame();
> ++ PyFrameObject *frame = PyEval_GetFrame();
> +
> + while (frame != NULL && depth > 0)
> + {
> +- frame = frame->f_back;
> ++ frame = PyFrame_GetBack(frame);
> + --depth;
> + }
> +
> +
> --
> 2.39.2
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2023-11-25 22:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-23 17:41 [Buildroot] [PATCH 1/1] python-sip: fix compile error Ralf Dragon
2023-11-25 22:04 ` Yann E. MORIN [this message]
2023-11-27 21:14 ` Ralf Dragon
2023-11-29 6:42 ` Yann E. MORIN
2023-11-29 22:10 ` Ralf Dragon
2023-12-12 15:20 ` Ralf Dragon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231125220439.GQ3177259@scaer \
--to=yann.morin.1998@free.fr \
--cc=asafka7@gmail.com \
--cc=buildroot@buildroot.org \
--cc=gwenhael.goavec-merou@trabucayre.com \
--cc=hypnotoad@lindra.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox