Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Fix static framework packaging #5209

Merged
merged 2 commits into from
Jun 1, 2016
Merged

Conversation

friedbunny
Copy link
Contributor

@friedbunny friedbunny commented Jun 1, 2016

Fixes #5071, where make ipackage would produce a static framework that did not include our Objective-C symbols.

  • Adds libMapbox.a to the libtool binary conglomeration step for the static framework.
  • Simulator debug builds now include x86_64 slices (by setting ONLY_ACTIVE_ARCH=NO).
  • Per 9732f02 (More Makefile cleanup #5120), the default build type is now debug for make ipackage-foo.
    • The deploy script has been updated to explicitly build for release.
    • For manual release builds, run make ipackage-foo BUILDTYPE=Release.

/cc @1ec5 @boundsj

@friedbunny friedbunny added iOS Mapbox Maps SDK for iOS build labels Jun 1, 2016
@friedbunny friedbunny added this to the ios-v3.3.0 milestone Jun 1, 2016
@friedbunny friedbunny self-assigned this Jun 1, 2016
@1ec5
Copy link
Contributor

1ec5 commented Jun 1, 2016

👍

@friedbunny
Copy link
Contributor Author

friedbunny commented Jun 1, 2016

@1ec5 reminded me that I should mention a weird issue I encountered while trying to use libtool to smoosh together the constituent libraries: When the simulator libraries did not include an x86_64 slice (because BUILDTYPE=Debug defaults to ONLY_ACTIVE_ARCH=YES), the resulting file from libtool would only include the contents of libgeojsonvt.a.

I don’t understand why, but libtool became able to combine all of the constituent libraries once I set ONLY_ACTIVE_ARCH=NO.

@friedbunny
Copy link
Contributor Author

friedbunny commented Jun 1, 2016

Another note, with a hat-tip to @1ec5: otool -L and lipo -info are very useful for identifying which classes/sub-libraries and architectures a library has (respectively).

$ otool -L build/ios/pkg/static/Mapbox.framework/Mapbox
Archive : build/ios/pkg/static/Mapbox.framework/Mapbox
build/ios/pkg/static/Mapbox.framework/Mapbox(MGLPointAnnotation.o):
build/ios/pkg/static/Mapbox.framework/Mapbox(MGLFeature.o):
... and so on...
build/ios/pkg/static/Mapbox.framework/Mapbox(tile.o):
build/ios/pkg/static/Mapbox.framework/Mapbox(wrap.o):
$ lipo -info build/ios/pkg/static/Mapbox.framework/Mapbox
Architectures in the fat file: build/ios/pkg/static/Mapbox.framework/Mapbox are: armv7 arm64 i386 x86_64 armv7s 

- Include libMapbox.a, which contains our Obj-C classes, in the fat archive.
- Simulator libraries now always include x86_64 slices.
@friedbunny friedbunny force-pushed the fb-make-static-whole-again branch from 9eaa05a to f41546e Compare June 1, 2016 19:55
@friedbunny friedbunny merged commit f41546e into master Jun 1, 2016
@friedbunny friedbunny deleted the fb-make-static-whole-again branch June 1, 2016 20:16
@@ -84,6 +84,7 @@ xcodebuild \
CURRENT_SHORT_VERSION=${SHORT_VERSION} \
CURRENT_SEMANTIC_VERSION=${SEM_VERSION} \
CURRENT_COMMIT_HASH=${HASH} \
ONLY_ACTIVE_ARCH=NO \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should revisit whether this flag is necessary after mapbox/mason#181 lands. Ideally we’d stick to just the standard architectures, to minimize the build size.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants