You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Method Py_FrozenMain missing in libpython3.9 #86757
Thus, when trying the provided freeze example via
freeze.py hello.py & make
one gets the linker error
/usr/bin/ld: frozen.o: in function main': frozen/frozen.c:681: undefined reference to Py_FrozenMain' .
The same under Python 3.9.1 (Package from Debian bullseye/testing). As the method Py_FrozenMain is contained in the source code, maybe ist has something to do with the build process, a change in makefile? As far as I can see, the builder of the distribution packages call the makefile as provided.
Yes, unfortunately I have to keep a large old system running and there are only few options left. It is a University learning system, where students upload program code and then a huge amount of automtic quality checks are executed within a sandbox. The grading is done in a half automtic way. A real alternative is not existing, we tried hard to find one...
This tool seems to
be broken for 4 years, since Python 3.6: bpo-42613.
4. freeze.py wants wants this for a very long time:
ln -s /usr/local/lib/python3.10/config-3.10-x86_64-linux-gnu
/usr/local/lib/python3.10/config-3.10
The symlink does the trick. So it may be easy for you to fix that, so it does operate out of the box again.
If you can test it, I can backport the fix to stable branches.
chba commented on Dec 16, 2020
chbamannequin
MannequinAuthor
More actions
Vistor Stinner:
If you can test it, I can backport the fix to stable branches.
Seems to work like a charm. Basically I used the same testing setup as previously on Dec 10th under Debian testing/bullseye without step 2, as master already contains your fix.
Is this function actually usable in Windows? ISTM that you need to define three more functions, PyWinFreeze_ExeInit, PyWinFreeze_ExeTerm and PyInitFrozenExtensions.
Was adding this undocumented function to the Windows stable ABI deliberate? I see no discussion about that.
New changeset 68b9c20 by Miss Islington (bot) in branch '3.10': bpo-43795: Remove Py_FrozenMain from the Limited API & Stable ABI (GH-26241) (GH-26353) 68b9c20
Activity
chba commentedon Dec 7, 2020
Thus, when trying the provided freeze example via
freeze.py hello.py & make
one gets the linker error
/usr/bin/ld: frozen.o: in function
main': frozen/frozen.c:681: undefined reference toPy_FrozenMain' .In previous Python 3.8.x the bug does not show.
Thanks,
Chris
chba commentedon Dec 10, 2020
The same under Python 3.9.1 (Package from Debian bullseye/testing). As the method Py_FrozenMain is contained in the source code, maybe ist has something to do with the build process, a change in makefile? As far as I can see, the builder of the distribution packages call the makefile as provided.
Chris
chba commentedon Dec 10, 2020
The file containing the source code is Python/frozenmain.c .
vstinner commentedon Dec 10, 2020
I wrote PR 23730 to fix the issue. Would it be possible for you to test it?
Since Python 3.9, symbols which are not explicitly exported are no longer exported. Python now uses -fvisibility=hidden.
chba commentedon Dec 10, 2020
Dear Victor,
a simple test with the tools/freeze/hello.py example was successfull with your patch and the newest cpython from github.
3. configure, make, amke install to xxx
ln -s /usr/local/lib/python3.10/config-3.10-x86_64-linux-gnu
/usr/local/lib/python3.10/config-3.10
Helo world...
Thanks again,
Chris
vstinner commentedon Dec 10, 2020
New changeset b5c7b38 by Victor Stinner in branch 'master':
bpo-42591: Export missing Py_FrozenMain() symbol (GH-23730)
b5c7b38
vstinner commentedon Dec 10, 2020
Oh great, thanks for your quick feedback! I applied your PR to master and I will backport it to 3.9.
vstinner commentedon Dec 14, 2020
New changeset 6b2ed38 by Victor Stinner in branch '3.9':
bpo-42591: Export missing Py_FrozenMain() symbol (GH-23730) (GH-23734)
6b2ed38
vstinner commentedon Dec 14, 2020
Thanks Christian Bachmaier for the bug report, it's now fixed.
vstinner commentedon Dec 16, 2020
Christian Bachmaier:
Do you mean freeze.py from Tools/freeze/freeze.py? This tool seems to be broken for 4 years, since Python 3.6: bpo-42613.
Oh, you fixed manually freeze.py?
chba commentedon Dec 16, 2020
Yes, unfortunately I have to keep a large old system running and there are only few options left. It is a University learning system, where students upload program code and then a huge amount of automtic quality checks are executed within a sandbox. The grading is done in a half automtic way. A real alternative is not existing, we tried hard to find one...
The symlink does the trick. So it may be easy for you to fix that, so it does operate out of the box again.
vstinner commentedon Dec 16, 2020
Christian Bachmaier:
I pushed a fix in bpo-42613. It would be great if you could test it.
See my manual test: https://bugs.python.org/issue42613#msg383153
If you can test it, I can backport the fix to stable branches.
chba commentedon Dec 16, 2020
Vistor Stinner:
Seems to work like a charm. Basically I used the same testing setup as previously on Dec 10th under Debian testing/bullseye without step 2, as master already contains your fix.
Victor, many thanks again, you are great!
encukou commentedon May 18, 2021
Is this function actually usable in Windows? ISTM that you need to define three more functions, PyWinFreeze_ExeInit, PyWinFreeze_ExeTerm and PyInitFrozenExtensions.
Was adding this undocumented function to the Windows stable ABI deliberate? I see no discussion about that.
pablogsal commentedon May 25, 2021
New changeset 68b9c20 by Miss Islington (bot) in branch '3.10':
bpo-43795: Remove Py_FrozenMain from the Limited API & Stable ABI (GH-26241) (GH-26353)
68b9c20