public inbox for [email protected]
help / color / mirror / Atom feedFrom: Bryan Green <[email protected]>
To: Jakob Egger <[email protected]>
To: Peter Eisentraut <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: Use Python "Limited API" in PL/Python
Date: Fri, 2 Jan 2026 12:12:22 -0600
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
On 1/2/2026 11:40 AM, Bryan Green wrote:
> On 1/15/2025 5:28 AM, Jakob Egger wrote:
>> On 14.01.2025, at 16:51, Jakob Egger <[email protected]> wrote:
>>> I've tried to create a patch with this change. I'm attaching it to this message so that cfbot picks it up. (I was unable to reproduce the issue locally)
>>
>> Apologies, please disregard my last patch. It does not work.
>>
>> It looks like meson just can't build libraries that link with Python that use the limited API.
>>
>> My understanding of Meson is limited, so I am unsure how to best work around this limitation.
>>
>> I've spent two days trying to figure it out; I'm at the end of my wits.
>>
>> Best regards,
>> Jakob
> Hi Jakob and Peter,
>
> I've been working on enabling the Python Limited API on MSVC, which was
> disabled in the recent commit due to build failures.
>
> The issue is that Meson doesn't automatically link against python3.lib
> when using the Limited API. Meson's Python dependency always returns the
> version-specific library (python3XX.lib) regardless of whether
> limited api is defined. This appears to be a known Meson limitation:
> https://github.com/mesonbuild/meson/issues/13824
>
> Initially, I thought that maybe the library wasn't being installed, but
> that is not the case and the patch to our CI Windows MSVC image is not
> needed.
>
> I have a patch that works around this by manually constructing the
> Python dependency on MSVC to use python3.lib instead of python3XX.lib,
> using cc.find_library('python3') and building the dependency with the
> appropriate include directory. It passes CI when I push. I'll see what
> cfbot thinks.
>
> Still testing, but wanted to share progress and get feedback on the
> approach.
>
cfbot seems to be happy:
https://cirrus-ci.com/github/postgresql-cfbot/postgresql/cf%2F6369
--
Bryan Green
EDB: https://www.enterprisedb.com
view thread (14+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Use Python "Limited API" in PL/Python
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox