icecc / icecream

Distributed compiler with a central scheduler to share build load
GNU General Public License v2.0
1.58k stars 248 forks source link

icecc-create-env does not work on macOS Big Sur #592

Open rubenvb opened 2 years ago

rubenvb commented 2 years ago

Big Sur introduced the dyld global cache, and removed all system libraries from /usr/lib. See the release notes, which contain the following passage:

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)

There is no simple way to extract the actual dylib files from the cache (located at /System/Library/dyld/dyld_shared_cache_x86_64 or similar for other architectures), the only thing I could find was a glorious (but functional) hack relying on internal APIs: https://lapcatsoftware.com/articles/bigsur.html. These dylibs are also not present inside the Xcode SDKs, so cannot be taken from there.

I don't see a simple way for one to create a standalone chroot environment as Icecream expects. The generated chroot with current Icecream fails to work because the system libraries in question cannot be found on the client inside the icecream chroot.

Is there a way to extend the chroot with system libraries of the client for this purpose?

rubenvb commented 1 year ago

A possible way out would be to use a tool like this: https://github.com/keith/dyld-shared-cache-extractor

Which is able to extract the dylibs from the cache as actual files which could then be included by icecc-create-env.