Been un-mothballing an old Swift 3 project and upgrading it to Swift 4, for which I need XCode 10.1. Set up a new VM (Big Sur 11.4), migrated the whole user and project with User Migration, and built the project.
All the code is compiling, but during the "Compile Asset Catalogs" phase, it reports "Command CompileAssetCatalog failed with a nonzero exit code".
Inspecting the output reveals that it's running actool, which is returning with a "Bus error: 10". I can re-create it from the command line with the same arguments. Or without them. Simply running actool with any arguments gets that error.
On the old working system, running /Applications/Xcode.app/Contents/Developer/usr/bin/actool -? produces an XML error message. On the new system, it produces "Bus Error: 10". So it doesn't matter what code is being compiled, the entire actool is malfunctioning.
(The new system also has a /usr/bin/actool on the path -- same problem.)
UPDATE: I got a bit more info from running actool from the other admin account (the one that was on the machine before I ported the old machine's account). Here's the misfire:
sh: line 1: 1468 Bus error: 10 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -find actool 2> /dev/null
actool: error: unable to find utility "actool", not a developer tool or in PATH
Curious that the SDK that's been referred to is OSX 10.14, when I'm running 11.4! Will XCode 10.1 work with a more up-to-date SDK?
Anyone got any ideas on this? I suspect there may be a permissions issue somewhere -- when I first tried to build the project on the new machine I got a whole string of EPERM errors, which were resolved by giving XCode permissions for Full Disk Access. Does "Bus Error" suggest in this context an attempt to access protected memory or something? Where should I look?
Found the fix! The ibtool crash logs pointed to the problem being in Xcode.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib . Turned out it was this known issue: https://stackoverflow.com/questions/64817964/xcode-10-3-does-not-work-on-macos-big-sur-11-0-1-non-beta . The solution was to install a newer XCode (12.5), and copy its libMainThreadChecker.dylib into the XCode 10 package.
Saved me having to start all over again with a Mojave VM!