From: Matthieu Longo <matthieu.longo@arm.com>
To: Eli Zaretskii <eliz@gnu.org>
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: Wed, 15 Oct 2025 10:03:22 +0100 [thread overview]
Message-ID: <6f940f3b-31b7-4e20-a1af-f62c988c724f@arm.com> (raw)
In-Reply-To: <868qhd2ya7.fsf@gnu.org>
On 2025-10-14 18:22, Eli Zaretskii wrote:
>> 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?
>
For now, this patch only provides the first brick of a migration of GDB
to the Python limited API, i.e. an experimentation flag to enable
developers who want to contribute to the migration to rebuild GDB easily
with the limited API enabled.
There remains much to be done. Consequently, I don't think that there is
much to write in NEWS today.
> 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.
>
This issue is discussed in [2], section "Shared library naming issue in
CPython" (see cover letter). The proposed approach would rely on
python3.dll, but it can be reviewed later on if it becomes a blocker.
> Apologies if I'm missing something, and thus make no sense.
No worry.
Matthieu
next prev parent reply other threads:[~2025-10-15 9:04 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 ` [PATCH v2 0/2] Add experimental option --enable-py-limited-api Eli Zaretskii
2025-10-15 9:03 ` Matthieu Longo [this message]
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=6f940f3b-31b7-4e20-a1af-f62c988c724f@arm.com \
--to=matthieu.longo@arm.com \
--cc=aburgess@redhat.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--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