Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode 14+ creates arm64-apple-ios.abi.json by default #69576

Open
deepesh-vasthimal-cko opened this issue Nov 1, 2023 · 2 comments
Open

Xcode 14+ creates arm64-apple-ios.abi.json by default #69576

deepesh-vasthimal-cko opened this issue Nov 1, 2023 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels

Comments

@deepesh-vasthimal-cko
Copy link

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

  • Swift compiler version info : arm64-apple-darwin22.6.0
  • Xcode version info: 14.1
  • Deployment target: iOS 15.0

refer : https://forums.swift.org/t/xcode-14-creates-arm64-apple-ios-abi-json-by-default/65380

@deepesh-vasthimal-cko deepesh-vasthimal-cko added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Nov 1, 2023
@yen-dang-ts
Copy link

I got same issue

@uziwuzzy
Copy link

uziwuzzy commented May 30, 2024

hi I am also facing the same issue, my concern is the xcframework size, I am adding a swift code to my objective-c xcframework. Previously with pure objective-c the size was only 2.7MB, but after mixing it up with swift, it becomes 23MB. I checked inside the xcframework, it's because each of the -apple-ios-simulator.abi file is roughly 4.7MB. Is it possible to just remove the file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

3 participants