Open NorseGaud opened 2 years ago
Using unxip on macOS Big Sur is a bit complicated because it requires the use of the Swift Concurrency backcompat libraries, which are typically meant to be shipped alongside an app. One way you can make this work is copy the code into an app target, which will set up the run paths correctly and you can just invoke it from the command line. I feel like you can also probably use something like LD_LIBRARY_PATH too but I haven't explored it much.
Since I build an Anka macOS VM for each macOS version that's in the public Apple mirrors and >= Mojave, it would be extremely valuable to have unxip supported on those versions. Right now I'm doing unxip {XIPFILE} || xip --expand {XIPFILE}
for full support.
That sounds like a reasonable workaround for now. I'm going to try to get some insight into how to distribute the backdeployment library on macOS 11, but until then that works I guess. Especially since I have no plans of supporting anything below that due to the use of Swift Concurrency.
I managed to make building the command line tool with the backdeployment library work on macOS 11.7 without building a full .app bundle. Plus how it can be done should enable making a .pkg release for Big Sur do-able. Here's what you can do...
Pull the code into a command line tool Xcode project to start.
In order to link the runpath you need to copy and edit the libswift_concurrency.tbd
file that normally gets added to the project when you try to link the concurrency dylib in the 'Link Binary With Libraries' build phase. You can find the file here: Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift/libswift_Concurrency.tbd
.
Place a duplicate copy of it into the project as a framework. Edit line 18 (install-name line) in your copied libswift_concurrency.tbd
to be: install-name: '<path>/libswift_Concurrency.dylib'
. Where <path>
will be the path you are going to place the libswift_Concurrency.dylib
file to be found at.
Next you want to get the dylib file that gets bundled in an App for back deployment here (swap out swift version for yours in the file path): Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/macosx/libswift_Concurrency.dylib
Place libswift_Concurrency.dylib
at the path you said it would be. Then build!
It also looks like this can be used to support back to Catalina as well
Yeah, you don't actually need to make an app bundle, just provide the Swift Concurrency libraries somehow. An app just provides a convenient bundle to keep everything together.