I have a question concerning BitCode on iOS. As fa...
# kotlin-native
d
I have a question concerning BitCode on iOS. As far as I know, K/N is not able to embed bitcode which does make kotlin/native somewhat usuable for us (currently). However, I was wondering why or if there is a C / obj-c output target which I can just feed in to the Apple LLVM compiler. Somehwat like Kotlin/js which transpiles to JavaScript and is the JIT compiled in the browser? Even bigger brands like UNITY use this way to compile C# on iOS.
s
https://github.com/JetBrains/kotlin-native/blob/master/FAQ.md#q-how-do-i-enable-bitcode-for-my-kotlin-framework (it doesn’t embed real bitcode yet, but makes the binary conform to Apple bitcode requirements; real bitcode will be available in 1.3.50)
However, I was wondering why or if there is a C / obj-c output target which I can just feed in to the Apple LLVM compiler.
No.
🎉 1
l
That means Kotlin/Native will support watchOS and tvOS in 1.3.50?
s
Why do you find these equivalent?
l
I'm not sure I'm understanding your question. AFAIK, watchOS and tvOS both require Apple bitcode to work, while iOS (for now in dev mode at least) and macOS don't. If 1.3.50 produces proper bitcode, then support for watchOS and tvOS will become possible, right?
s
If 1.3.50 produces proper bitcode, then support for watchOS and tvOS will become possible, right?
Not exactly. If 1.3.50 produces proper bitcode, then support for watchOS and tvOS will not be blocked by lack of bitcode support.
l
"if"? Now it's no longer certain it's coming in 1.3.50?
k
I have a multiplatform project with a framework target and bitcode is included by default
s
“if”? Now it’s no longer certain it’s coming in 1.3.50?
Proper bitcode is coming in 1.3.50. I’ve just copied your phrase.
k
based on your comment, "(it doesn’t embed real bitcode yet, but makes the binary conform to Apple bitcode requirements; real bitcode will be available in 1.3.50)", it sounds like the docs are misleading, then?
when the ipa is installed on the device, will the app store include all platforms from that framework, or only those platforms that are specific to the device?
s
it sounds like the docs are misleading, then?
It depends on whether real bitcode is distinguishable from fake one in your use case. Is it?
when the ipa is installed on the device, will the app store include all platforms from that framework, or only those platforms that are specific to the device?
Is this relevant to bitcode?
k
that's my understanding. which admittedly, I gained second hand.
with bitcode enabled, only the relevant architectures from fat libraries are sent to the device. we had to enable it in one of our app because it's so large in size.
s
This question still remains unanswered:
It depends on whether real bitcode is distinguishable from fake one in your use case.
Is it?
Does this work with Kotlin/Native binaries in your application?
only the relevant architectures from fat libraries are sent to the device
k
i guess we'll find out when we submit to the app store.
but it definitely would have been good to know this was a risk up front
s
AFAIK, you can check app thining by using ad-hoc distribution in Xcode.
k
I am sure there is a way I can go check it now, but at this point I may have to rip out the work that was merged, and more troubling, we've invested in a cross-platform tool chain that may end up being an Android-only tool chain until this particular feature is delivered, unbeknownst to me
bitcode was a primary question up front, and our concerns seemed to be covered based on what I had read in the docs
d
My question is still, why not output C or C++ code directly from the compiler. This is how Unity tackles this Problem with C# and Mono. Just curious why this is not feasable?
🤔 1
s
@Kris Wong
with bitcode enabled, only the relevant architectures from fat libraries are sent to the device. we had to enable it in one of our app because it’s so large in size.
Are you sure that bitcode is required for App Slicing? Have you checked that having bitcode enabled made your app significantly smaller on the device?
@Daniel Hauschildt
why not output C or C++ code directly from the compiler.
Because translating to C or C++ code limits the capabilities of the compiler.
k
Are you sure that bitcode is required for App Slicing? Have you checked that having bitcode enabled made your app significantly smaller on the device?
This is how my colleagues explained it. However, it seems our test builds are being accepted by test flight, so it could be a non-issue.