On 18 May 2021, at 12:23, Marc-Andre Lemburg <mal@egenix.com> wrote:
On 18.05.2021 11:16, Petr Viktorin wrote:
On 14. 05. 21 20:07, Ronald Oussoren wrote:
On 14 May 2021, at 19:05, Victor Stinner <vstinner@python.org <mailto:vstinner@python.org>> wrote:
Hi Petr,
I reproduced the issue with Python is built without --enable-shared.
But when Python is built with --enable-shared, Py_FrozenMain() is exported as expected!
I createdhttps://bugs.python.org/issue44133 <https://bugs.python.org/issue44133>and https://github.com/python/cpython/pull/26130 <https://github.com/python/cpython/pull/26130>to fix the issue.
I guess exporting it for completeness sake is harmless, but I wonder how useful exporting the symbol from the python binary in a static build is.
AFAIK Py_FrozenMain is the main entry point for frozen binaries (linked to libpython). It does not seem to have other uses.
That's what I now think as well.
That's the case, yes.
It's OK if Py_FrozenMain is exported, but also OK if it's missing (unless you're compiling a special build with frozen modules, which won't work at all without Py_FrozenMain).
Skipping any tests for it based on something like
hasattr(ctypes.pythonapi, 'Py_FrozenMain')should work fine.I'll remove it from the Stable ABI list; there's still time for that in 3.10.
If you are embedding a Python with frozen modules, you will need to call the Py_FrozenMain() API from your application's main() (or other entry point within your application).
Removing the export will break such applications. Removing the API from the stable ABI makes it impossible to use the stable ABI from such applications.
Is that intended ? Perhaps I'm missing something.
The discussion is about having a Py_FrozenMain() ABI in a statically linked python executable. That executable cannot be used to create a frozen application because, as you say, those need a custom main function that calls Py_FrozenMain() and should therefore link to libpython (either dynamically or statically).
Ronald
-- Marc-Andre Lemburg eGenix.com <http://egenix.com/>
Professional Python Services directly from the Experts (#1, May 18 2021)
Python Projects, Coaching and Support ... https://www.egenix.com/ <https://www.egenix.com/> Python Product Development ... https://consulting.egenix.com/ <https://consulting.egenix.com/>
::: We implement business ideas - efficiently in both time and costs :::
eGenix.com <http://egenix.com/> Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 https://www.egenix.com/company/contact/ <https://www.egenix.com/company/contact/> https://www.malemburg.com/ <https://www.malemburg.com/>
capi-sig mailing list -- capi-sig@python.org <mailto:capi-sig@python.org> To unsubscribe send an email to capi-sig-leave@python.org <mailto:capi-sig-leave@python.org> https://mail.python.org/mailman3/lists/capi-sig.python.org/ <https://mail.python.org/mailman3/lists/capi-sig.python.org/> Member address: ronaldoussoren@mac.com <mailto:ronaldoussoren@mac.com>
—
Twitter / micro.blog: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/