#9021: Fixed static framework size #9022
Conversation
1ec5
left a comment
There was a problem hiding this comment.
This looks OK to me, but I’d like to get more 👀 on it from folks who’ve worked on our packaging more recently. Not sure whether our -symbols packaging would override this setting.
There was a problem hiding this comment.
If this change should go into iOS SDK v3.6.0, this PR would need to be retargeted and rebased onto the release-ios-v3.6.0-android-v5.1.0 branch. Otherwise, this note should be moved up to the “master” section, which will go into iOS SDK v3.7.0.
/cc @boundsj
Indeed, I don’t see how setting And yet, this does appear to work. The number of symbols is roughly the same as in v3.6.0-alpha.1: And file sizes are decreased: Until we understand the mechanism at work here, I wouldn’t feel comfortable merging this PR. |
friedbunny
left a comment
There was a problem hiding this comment.
Let’s hold this until it can be fully vetted and the mechanism explained.
…ase scheme for strip command
|
@friedbunny I re-targeted this at the release branch for v3.6.0 and convinced the bots to run the tests. What are you thinking the next steps we need to do are before we can land this? |
|
|
@friedbunny here is an update: Despite what was suggested in the SO post mentioned in #9021 (comment),
I think this has to do with the ability to attach and use a debugger to step through implementations in the binary. When it is set to NO, the resulting static binary shrinks significantly and is not visible in the debugger. When it is set to YES, the resulting binary is significantly larger, is visible in the debugger, and these debugging symbols cannot be fully stripped by our current
I created an app using the static Mapbox Map SDK I created with
I think you mean that we should test the dynamic framework, too. This proposal changes only the So, I think |
It looks like the changes affect all of |
|
The dynamic framework does change, but in apparently harmless/positive ways:
Here’s a diff of After running both the static and dynamic frameworks in apps, I don’t see any compile or runtime issues. |
There was a problem hiding this comment.
@fabian-guerra @boundsj Let’s give this a shot in b3, then back it out if any issues arise.
|
I updated the changelog entry — we should also reword the commit message when this is merged. |
|
There's a similar PR in #7604 that achieves the same thing by removing symbol visibility. We completed it for macOS, but it stalled for iOS. When removing symbols, we have to make sure we're not accidentally stripping symbol visibility for things that are declared in the public headers but not used anywhere. |
|
In #7604, we're using |
|
Note that there is a script called |
|
In that case, let’s hold here and revisit/reevaluate #7604. If we don’t come to a determination today, I think this is the type of fix we should make a patch release for. |
|
The symbol visibility portion of this PR ( That means that we need to refocus this PR on |
|
These debug symbols are useful for development and are stripped in the archive/App Store submission process, so they don’t contribute to the effective download size of your app. To that end, I think we should keep As an open source project, we want to enable developers to see the internal workings of our SDK and be able to easily open issues, file bug reports, and (with any luck) make contributions. If it’s not possible to step-debug our SDK in the context of a developer’s own app, that throws up a barrier to contribution. It definitely is true that these debug symbols add significantly to the size of the uncompressed static binary (about 60%) and we should keep investigating less invasive ways to bring this size down. Binary size metrics.
master @ 8ae7010GCC_GENERATE_DEBUGGING_SYMBOLS=NO @ 8ae7010MACH_O_TYPE = mh_object; DEAD_CODE_STRIPPING = NO; @ 8ae7010master @ 8ae7010 with Xcode 8.2.1master @ 8ae7010 with Xcode 7.3.1 |
|
For comparison, the size of realm-cocoa’s uncompressed static library is 602 MB. |
Fix #9021 by using correct llvm flags on release scheme for strip command.