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

Current build scripts does not generate dSYMs which may cause warnings under Xcode 16 #3014

Open
vincentneo opened this issue Aug 8, 2024 · 12 comments

Comments

@vincentneo
Copy link
Contributor

Issue pertains to usage of TDLib in Xcode 16 betas, hence only concerns Apple OS platforms. dSYM refers to a debug symbols.

When uploading an app that uses TDLib's framework to App Store Connect, Xcode 16 displays a warning(?) after it's uploaded:
The archive did not include a dSYM for the libtdjson.framework with the UUIDs. Ensure that the archive's dSYM folder includes a DWARF file for libtdjson.framework with the expected UUIDs.

Not sure what kind of real impact this currently has, as it was later reported by App Store Connect that the app did still complete processing. Unsure if this can impact actual App Store submission and review in future.

Tested platforms:
Xcode 16 beta 5 (16A5221g)
watchOS 11 SDK

Tested TDLib build: 1.8.33 (97ded01) (As iOS build scripts did not change in the meantime, this should be irrelevant)

@levlam
Copy link
Contributor

levlam commented Aug 8, 2024

Could you change the line options="$options -DCMAKE_BUILD_TYPE=Release" to options="$options -DCMAKE_BUILD_TYPE=RelWithDebInfo" and check whether build succeeds and is suitable for production?

@vincentneo
Copy link
Contributor Author

I've given that a try:

  • It builds fine
  • Built binaries are much larger than before (likely due to RelWithDebInfo's optimisation level)
  • No dSYM or DWARF files found within xcframework
  • Other built files appears similar or the same (let me know if there's any files to look out for)
  • Xcode gives same warning

Also, update on yesterday - TestFlight deployment does work, so as of now likely this is really just a warning.

@vincentneo
Copy link
Contributor Author

vincentneo commented Aug 9, 2024

Did a bit of reading and found a that there's a dsymutil command.

Running dsymutil libtdjson.dylib -o libtdjson.dSYM generates a 1.26GB dSYM file, so I guess that could be something. The .dSYM appears to be consistently around 10x larger than the original .dylib, with a .dylib in the DWARF directory of the .dSYM that is taking most of that space. Unsure if that is normal.

Running the same command on a typical Release mode libtdjson.dylib yields a very small practically empty dSYM.

@levlam
Copy link
Contributor

levlam commented Aug 9, 2024

Does Xcode accepts the empty dSYM? If so, then providing it could be the best option, given it is unlikely needed to debug TDLib internals.

@vincentneo
Copy link
Contributor Author

vincentneo commented Aug 10, 2024

Does Xcode accepts the empty dSYM?

Yes, Xcode uploaded with no warnings!

xcodebuild -create-xcframework -library <libtdjson.dylib> -debug-symbols <libtdjson.dSYM> -library <libtdjson.dylib> -debug-symbols <libtdjson.dSYM> -output "libtdjson.xcframework"

@levlam
Copy link
Contributor

levlam commented Aug 10, 2024

Then, it is fine.

@vincentneo
Copy link
Contributor Author

vincentneo commented Aug 10, 2024

If anyone wishes to have the actual dSYM in their submission, that works too (albeit a longer uploading time).
Note: In that case, App Store Connect reports about a 15% increase in install size, even after stripping the dylib, likely due to optimisation level differences.

The nice benefit obviously is the user will get TDLib symbolicated in the event of crash or if one wishes to debug.

@levlam
Copy link
Contributor

levlam commented Aug 10, 2024

There should be no optimization level differences between Release and RelWithDebInfo builds. After full strip the binaries should be identical.

@vincentneo
Copy link
Contributor Author

My bias was based on some quick reading that suggest O2 optimisation level for RelWithDebInfo and O3 for Release - though the two aren't all that different on size it seems.

Regardless, I’ve seen in the past that the entire build path is everywhere inside the dylib (like if you decompile or when Xcode points to some breakpoint or crash) - often a longer path yields a larger dylib, though not by much. Could be a factor to my observation too since the RelWithDebInfo build was housed an a folder with a longer name.

(I’m probably embarrassing myself with my lack of compiler knowledge through whatever I typed above 😅, hoping I can learn something out of this though)

@levlam
Copy link
Contributor

levlam commented Aug 10, 2024

You are actually right, the flags often differ by default between Release and RelWithDebInfo builds, but nevertheless O3 shouldn't decrease executable size that much. Moreover, some optimization enabled in O3 increase executable size, and for mobile platforms -Oz/-Os are more preferable.

@Kylmakalle
Copy link
Contributor

My two cents. App Store does not have a mandatory requirement to ship dSYMS. For example, official iOS App does not ship them. Developers preserve symbols in their build environment to symbolicate and investigate crashes later.
When shipping them to App Store, Apple may symbolicate crashes for you.

@vincentneo
Copy link
Contributor Author

@Kylmakalle well, dSYM or not, it doesn’t really bother me, it’s just Xcode 16 beta’s warning that bothers me 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants