Opened 3 years ago

Closed 2 years ago

#63088 closed defect (duplicate)

python39 @3.9.5_0: failed lib-dynload

Reported by: RobertAdesam (Robert Adesam) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc:
Port: python39

Description

Installing python39 on MacOSX 10.15.7 (build 19H1217) with xcode 12.4 or 11.7, results in multiple failed so-files in lib-dynload:

$ cd /opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/ && ls -1 *failed.so
_bz2.cpython-39-darwin_failed.so
_ctypes.cpython-39-darwin_failed.so
_curses.cpython-39-darwin_failed.so
_curses_panel.cpython-39-darwin_failed.so
_elementtree.cpython-39-darwin_failed.so
_lzma.cpython-39-darwin_failed.so
_sqlite3.cpython-39-darwin_failed.so
pyexpat.cpython-39-darwin_failed.so
readline.cpython-39-darwin_failed.so

Configure step gives warning:

Warning: Configuration logfiles contain indications of -Wimplicit-function-declaration; check that features were not accidentally disabled:
  getrandom: found in Python-3.9.5/config.log
  le64toh: found in Python-3.9.5/config.log

Also python complains the module msvcrt does not exist when importing subprocess (e.g. py39-setuptools fails to install):

$ python3.9
Python 3.9.5 (default, Jun 13 2021, 11:15:41)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 73, in <module>
    import msvcrt
ModuleNotFoundError: No module named 'msvcrt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 78, in <module>
    import _posixsubprocess
ImportError: dynamic module does not define module export function (PyInit__posixsubprocess)
>>>

Might be related to ticket #61282? Also had the the -Wimplicit-function-declaration warning on several other ports but seem to work fine, eg libiconv and xz.

Change History (4)

comment:1 in reply to:  description Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to jmroot
Status: newassigned

Replying to RobertAdesam:

Installing python39 on MacOSX 10.15.7 (build 19H1217) with xcode 12.4 or 11.7, results in multiple failed so-files in lib-dynload:

$ cd /opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/ && ls -1 *failed.so
_bz2.cpython-39-darwin_failed.so
_ctypes.cpython-39-darwin_failed.so
_curses.cpython-39-darwin_failed.so
_curses_panel.cpython-39-darwin_failed.so
_elementtree.cpython-39-darwin_failed.so
_lzma.cpython-39-darwin_failed.so
_sqlite3.cpython-39-darwin_failed.so
pyexpat.cpython-39-darwin_failed.so
readline.cpython-39-darwin_failed.so

This is either a new problem or something specific to your computer, because we've been using python39 successfully for months without hearing of such issues.

Configure step gives warning:

Warning: Configuration logfiles contain indications of -Wimplicit-function-declaration; check that features were not accidentally disabled:
  getrandom: found in Python-3.9.5/config.log
  le64toh: found in Python-3.9.5/config.log

As far as I know, these two functions do not exist on any version of macOS so it is safe to ignore these messages and we should add those two functions to the global whitelist files.

Also python complains the module msvcrt does not exist when importing subprocess (e.g. py39-setuptools fails to install):

$ python3.9
Python 3.9.5 (default, Jun 13 2021, 11:15:41)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 73, in <module>
    import msvcrt
ModuleNotFoundError: No module named 'msvcrt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 78, in <module>
    import _posixsubprocess
ImportError: dynamic module does not define module export function (PyInit__posixsubprocess)
>>>

Might be related to ticket #61282?

It does seem like a similar symptom to the one reported in that ticket, but that ticket has been resolved so perhaps there is a different cause here.

Also had the the -Wimplicit-function-declaration warning on several other ports but seem to work fine, eg libiconv and xz.

I guess separate tickets should be filed about those. The implicit function declaration checks are new as of MacPorts 2.7.0 so you may encounter many ports in which this has not yet been researched, so please file individual tickets so that the research can be done and the appropriate fix can be applied, whatever that may be for each individual situation.

comment:2 Changed 3 years ago by reneeotten (Renee Otten)

Priority: HighNormal

comment:3 in reply to:  2 Changed 3 years ago by RobertAdesam (Robert Adesam)

Replying to reneeotten:

Thanks for your prompt reply. During next week I will try to do a clean OS install on the machine and report back.

However I find the ImportError a bit odd as _posixsubprocess.cpython-39-darwin.se is not marked as failed, also when doing

$ nm -gU _posixsubprocess.cpython-39-darwin.so
0000000000002396 T _PyInit__posixsubprocess

it should be definded...

comment:4 Changed 2 years ago by jmroot (Joshua Root)

Resolution: duplicate
Status: assignedclosed
Note: See TracTickets for help on using tickets.