TSan Breaks Exception Expectations

Yesterday, Apple released Xcode 15 β3 (15A195k) and I noticed that my tests started failing. These tests verified that an expectation was thrown from calling a method that should be unavailable. However, these tests were failing with an uncaught exception: xctest(8933,0x1f2049e00) malloc: nano zone abandoned due to inability to reserve vm space. Test Suite 'ExampleClassTest' started at 2023-07-06 07:40:43.904. Test Case '-[ExampleClassTest testInit]' started. 2023-07-06 07:40:43.907915-0500 xctest[8933:99736] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'init is unavailable for class ExampleClass' *** First throw call stack: ( 0 CoreFoundation 0x00000001971a3154 __exceptionPreprocess + 176 1 libobjc....

Leveraging Mergeable Libraries

When building your application with binary dependencies, you are either statically or dynamically linking them to your app. When statically linking, the symbols used are copied directly into the binary executable and discards the unused symbols. This increases the compile time of the app and the size of the binary executable, although some additional space savings (overall) can be had by using Link Time Optimization (LTO) and by using the -Os optimization level....

Xcode Supply Chain Security

Xcode 15 includes a few changes from Apple in an effort to harden the software supply chain. The majority of these changes are being phased in, while another is actively impacting developers attempting to test on the new OS versions with the new version of Xcode. First up is script sandboxing. Xcode 14 introduced a new build setting, ENABLE_USER_SCRIPT_SANDBOXING, that prevents shell scripts from accessing any files inside of SRCROOT and the Derived Data folder without being declared as inputs and outputs to the script....

Resource Bundle Code Signing

With Xcode 13.3, Apple introduced a new requirement for iOS applications to code sign any and all resource bundles. This has, apparently, been a requirement for Mac Catalyst for quite some time and has now made its way to the iOS platform. This is somewhat problematic for teams that consume resource bundles as part of a library/framework as the distributor cannot specify the code signing configuration on behalf of the consuming application....

Xcode Device Database

When new device models are announced, one of the things that applications that identify what device they are running on need to do is update their model to device name mapping. When referring to device model, we are not talking about the model property on UIDevice, rather the underlying device model Apple assigns to each of its devices. To get the model, you use the kernel via uname: #import <sys/utsname.h> struct utsname sysInfo; if (uname(&sysInfo) == 0) { NSString *model = @(sysInfo....