Author sumanthratna
Recipients sumanthratna
Date 2020-07-01.02:10:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1593569457.74.0.77283115603.issue41179@roundup.psfhosted.org>
In-reply-to
Content
The following all return None on macOS Big Sur, but return a valid path (str) on macOS Catalina:

python3.6 -c "from ctypes import util; print(util.find_library('objc'))"
python3.7 -c "from ctypes import util; print(util.find_library('objc'))"
python3.8 -c "from ctypes import util; print(util.find_library('objc'))"

The solution I'm thinking of is using platform.mac_ver() in ctypes.util.find_library to see if the macOS version is either 10.16 or 11.0; if so, use an alternative method to locate the path of the library somehow—else, use the current functionality. I'm hoping that looking in /System/Library/Frameworks/ is enough. 

From the macOS Big Sur release notes (https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11-beta-release-notes):

> New in macOS Big Sur 11 beta, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to `dlopen()` the path, which will correctly check for the library in the cache. (62986286)

Related links:
- https://bugs.python.org/issue41116 (this is a build issue, but is related I think)
- https://stackoverflow.com/questions/62587131/macos-big-sur-python-ctypes-find-library-does-not-find-libraries-ssl-corefou
- https://www.reddit.com/r/MacOSBeta/comments/hfknpa/is_corefoundation_missing_for_everyone_on_big_sur/
- https://github.com/vispy/vispy/issues/1885
- https://github.com/napari/napari/issues/1393
- https://github.com/espressif/esptool/issues/540


This is my first issue in Python; sorry in advance if I've made a mistake anywhere.
History
Date User Action Args
2020-07-01 02:10:57sumanthratnasetrecipients: + sumanthratna
2020-07-01 02:10:57sumanthratnasetmessageid: <1593569457.74.0.77283115603.issue41179@roundup.psfhosted.org>
2020-07-01 02:10:57sumanthratnalinkissue41179 messages
2020-07-01 02:10:57sumanthratnacreate