On 18. 05. 21 12:23, Marc-Andre Lemburg 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.
Is there a supported way to make such binary other than Tools/freeze/freeze.py? The (lack of) docs suggests this is an implementation detail for the freeze script.
Tools/freeze does not se the Stable ABI.