ios
ios copied to clipboard
[bug] CLANG_ENABLE_MODULES = YES -- creates broken metadata
Environment
- Using XCode 12.x
- NS 7.x
Issue
Metadata generation seems to be faulty if the CLANG_ENABLE_MODULES = YES
Steps (flavor doesn't matter):
- tns create test --js
- cd App_Resouces/ios
- edit
build.xcconfig- Add
CLANG_ENABLE_MODULES = YES - Save
- Add
- cd ../..
- ns build ios --for-device
The resulting metadata
Result: 19159 declarations from 40 top level modules
Size of Metadata file (platforms/ios/build/Debug-iphoneos/) is ~1.3m
Normal application without CLANG_ENABLE_MODULES reports:
Result: 45930 declarations from 155 top level modules
Size of Metadata file is ~6.4m
+1 we experience the same issue. Is this no longer supported or is this gonna be fixed in the near future?
To set your expectation properly; this is a lower backlog priority bug, and has very little priority. Most people in the community should never run into it as they won't set this value.
I would love to know why you have used this value and what it was solving for you, as I honestly couldn't figure out why I would want to use this flag; just ran into a client who tried it and the app was crashing on startup, and figured I should document it as a known issue.
Since this is a open source project, we do :heart: :heart: :heart: PR's. Finally, if you really need to use this flag and you don't want to spend the time digging into fix it and creating a PR -- you can hire nStudio (and other companies in the community) to fix this as a project for you.
+1 I've hit this now too. I have a 3rd party framework that I'm creating a plugin for that is importing a module that requires CLANG_ENABLE_MODULES = YES. Without turning this on I get the standard errors to turn modules on due to @import being used to include their module. Upon adding CLANG_ENABLE_MODULES = YES to build.xcconfig, ns builds okay but app crashes on launch for a real device. It builds and runs without crash on simulator and the framework works as expected.
Using XCode 12.5 NS CLI 8.0.1 NS 6 (tns-ios 6.5.4)
If anyone has any tips on a way around needing CLANG_ENABLE_MODULES on I'm all ears. I'll follow up if I find something beneficial.