Xcode 14+ creates arm64-apple-ios.abi.json by default #69576
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Description
I have noticed that starting from Xcode 14 when I build my XCFramework it contains arm64-apple-ios.abi.json files. This file contains values of private/internal properties of the classes from the framework. For example:
{
"filePath": "/Users/jakub/Framework/Test.swift",
"kind": "StringLiteral",
"offset": 2041,
"length": 38,
"value": ""506D5F19-6B44-43A4-M15F-4462A9100899""
},
Is this behaviour intended? Now anybody can read private values from the framework from this json file. I would expect that at least this will be opt-in feature of Xcode. After little bit of searching I have found that this can be turned off by OTHER_SWIFT_FLAGS = "-Xfrontend -empty-abi-descriptor"; in the Build Settings. Another thing is that there is very little documentation about this feature. I think this can be a big surprise for some SDK developers that suddenly XCode reveals their private values in the arm64-apple-ios.abi.json file.
I have also noticed that this file is created only if BUILD_LIBRARY_FOR_DISTRIBUTION is set to YES in Build Settings. I have tried building my XCFramework with Xcode 14.1, removing arm64-apple-ios.abi.json and then use it in my app in Xcode 14.3 and it worked fine. So I am not sure if this file is required to support Library evolution or not.
Steps to reproduce
Build xcframework using Xcode 14.1
open xcframework to see modules folder containing arm64-apple-ios.abi.json by deff
The arm64-apple-ios.abi.json seems to have information about private classes and variables
Expected behavior
The arm64-apple-ios.abi.json does not expose private function, classes and variable names
Environment
refer : https://forums.swift.org/t/xcode-14-creates-arm64-apple-ios-abi-json-by-default/65380
The text was updated successfully, but these errors were encountered: