From: Eli Zaretskii <eliz@gnu.org>
To: Matthieu Longo <matthieu.longo@arm.com>
Cc: gdb-patches@sourceware.org, tom@tromey.com, aburgess@redhat.com
Subject: Re: [PATCH v2 0/2] Add experimental option --enable-py-limited-api
Date: Tue, 14 Oct 2025 20:22:56 +0300 [thread overview]
Message-ID: <868qhd2ya7.fsf@gnu.org> (raw)
In-Reply-To: <20251014164458.2000229-1-matthieu.longo@arm.com> (message from Matthieu Longo on Tue, 14 Oct 2025 17:44:56 +0100)
> From: Matthieu Longo <matthieu.longo@arm.com>
> CC: Tom Tromey <tom@tromey.com>, Andrew Burgess <aburgess@redhat.com>,
> Matthieu Longo <matthieu.longo@arm.com>
> Date: Tue, 14 Oct 2025 17:44:56 +0100
>
> This patch series introduces an experimental build option, '--enable-py-limited-api', which allows GDB to be compiled against the Python 3 stable C API.
>
> As explained in [1] and [2], using the stable API would make it possible to build GDB against one version of Python 3, while still allowing it to run with other versions available on the user's system.
>
> The migration to the stable API can be done incrementally. These patches do not attempt to port the entire codebase at once. Instead, they provide a development mode where contributors can experiment with the limited API and progressively fix incompatibilities. By default, this option is disabled (--enable-py-limited-api=no).
>
> The series contains two patches:
> - Update the Python conftest to avoid use of unstable API calls, ensuring compatibility with the limited API.
> - Introduce the --enable-py-limited-api option in GDB's configure.
>
> Tested with Python 3.4 and 3.13.
>
> Diff against revision 1:
> - addressed comments of Tom Tromey regarding code formatting, and removal of config.h
Thanks. Should this be in NEWS?
Also, I'm guessing that this change will not allow to run the MinGW
build of GDB with versions of Python other than the one against which
GDB was compiled, because AFAIK linking against shared libraries on
Windows records that library in the executable, and GDB will therefore
refuse to run when that DLL cannot be found. So, for example, if GDB
was linked against python34.dll, it will insist on finding it when
Windows loads the executable, and if not found, will not run.
If we want this to work on Windows, we need to load the Python DLL at
runtime, using the likes of dlopen, and then manually import the APIs
we need using dladdr. Which AFAIU, this patch doesn't do.
Apologies if I'm missing something, and thus make no sense.
next prev parent reply other threads:[~2025-10-14 17:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-14 16:44 Matthieu Longo
2025-10-14 16:44 ` [PATCH v2 1/2] gdb: make Python conftest compatible with Python limited C API Matthieu Longo
2025-10-14 16:44 ` [PATCH v2 2/2] gdb: add experimental option --enable-py-limited-api Matthieu Longo
2025-10-20 15:23 ` [PATCH] Drop bashism from configure script Kévin Le Gouguec
2025-10-20 15:31 ` Tom Tromey
2025-10-20 15:46 ` Kévin Le Gouguec
2025-10-14 17:22 ` Eli Zaretskii [this message]
2025-10-15 9:03 ` [PATCH v2 0/2] Add experimental option --enable-py-limited-api Matthieu Longo
2025-10-15 14:01 ` Tom Tromey
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=868qhd2ya7.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=matthieu.longo@arm.com \
--cc=tom@tromey.com \
/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