Message397930
An alternative to using _dyld_shared_cache_contains_path is to use dlopen to check for library existence (which is what Apple recommends in their change notes: https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11_0_1-release-notes).
> New in macOS Big Sur 11.0.1, 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)
I have created a PR which modifies the current find_library from using _dyld_shared_cache_contains_path to dlopen. It passes all of the existing find_library-tests:
https://github.com/python/cpython/pull/27251
There might be downsides to using dlopen (performance?) or something else I haven't considered. The huge upside however, is that the function is basically available on all Unix-systems. |
|
Date |
User |
Action |
Args |
2021-07-21 08:38:50 | bergkvist | set | recipients:
+ bergkvist, ronaldoussoren, ned.deily |
2021-07-21 08:38:50 | bergkvist | set | messageid: <1626856730.88.0.61992072251.issue44689@roundup.psfhosted.org> |
2021-07-21 08:38:50 | bergkvist | link | issue44689 messages |
2021-07-21 08:38:50 | bergkvist | create | |
|