From db9bd6c22efde9a78c608503bad177dd63fe8818 Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Mon, 11 Nov 2019 10:14:40 -0800 Subject: [PATCH] Fixes the broken build of Sample app on open source Summary: This diff fixes the broken sample app for xcode 11. Followed the remediation mentioned in the following links https://github.com/Carthage/Carthage/issues/2825 https://twitter.com/krzyzanowskim/status/1151549874653081601?s=21 Remediation: Adding Dummy swift file and assigning `"LD_VERIFY_BITCODE": "NO"` solves the problem as suggested in the above links Reviewed By: jknoxville Differential Revision: D18420954 fbshipit-source-id: e87930790329ffb2bb92c40aa197552efeedecd3 --- FlipperKit.podspec | 2 +- iOS/Sample/Dummy.swift | 14 ++++ iOS/Sample/Sample-Bridging-Header.h | 11 +++ iOS/Sample/Sample.xcodeproj/project.pbxproj | 14 ++++ .../xcshareddata/xcschemes/Sample.xcscheme | 78 +++++++++++++++++++ 5 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 iOS/Sample/Dummy.swift create mode 100755 iOS/Sample/Sample-Bridging-Header.h create mode 100644 iOS/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme diff --git a/FlipperKit.podspec b/FlipperKit.podspec index 288d88a52..70a6f476f 100644 --- a/FlipperKit.podspec +++ b/FlipperKit.podspec @@ -4,7 +4,7 @@ # LICENSE file in the root directory of this source tree. folly_compiler_flags = '-DDEBUG=1 -DFLIPPER_OSS=1 -DFB_SONARKIT_ENABLED=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_HAVE_LIBGFLAGS=0 -DFOLLY_HAVE_LIBJEMALLOC=0 -DFOLLY_HAVE_PREADV=0 -DFOLLY_HAVE_PWRITEV=0 -DFOLLY_HAVE_TFO=0 -DFOLLY_USE_SYMBOLIZER=0' -yogakit_version = '~> 1.14' +yogakit_version = '~> 1.18' flipperkit_version = '0.27.0' Pod::Spec.new do |spec| spec.name = 'FlipperKit' diff --git a/iOS/Sample/Dummy.swift b/iOS/Sample/Dummy.swift new file mode 100644 index 000000000..3b553ff4d --- /dev/null +++ b/iOS/Sample/Dummy.swift @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import Foundation + +// Added this dummy swift file to solve the sample app's compilation issue for Xcode 11. +// Following are the links with the explanation for this fix. +// D18420963, D18420963 +// https://github.com/Carthage/Carthage/issues/2825 +// https://twitter.com/krzyzanowskim/status/1151549874653081601?s=21 diff --git a/iOS/Sample/Sample-Bridging-Header.h b/iOS/Sample/Sample-Bridging-Header.h new file mode 100755 index 000000000..5caf6516e --- /dev/null +++ b/iOS/Sample/Sample-Bridging-Header.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + diff --git a/iOS/Sample/Sample.xcodeproj/project.pbxproj b/iOS/Sample/Sample.xcodeproj/project.pbxproj index 14ecc1c5f..8c34b675e 100644 --- a/iOS/Sample/Sample.xcodeproj/project.pbxproj +++ b/iOS/Sample/Sample.xcodeproj/project.pbxproj @@ -10,6 +10,7 @@ 0D0B1CF0E859D91C55CC453B /* libPods-Sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F97F4E8C3E28D8BFAAEE60F4 /* libPods-Sample.a */; }; 4E102341216AD7B400160734 /* UserDefaultsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E102340216AD7B400160734 /* UserDefaultsViewController.m */; }; 53B4A36B217E2B6200B36A53 /* CommunicationDemoViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 53B4A36A217E2B6200B36A53 /* CommunicationDemoViewController.mm */; }; + 53B8C8D323788AC600D2D1FD /* Dummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53B8C8D223788AC600D2D1FD /* Dummy.swift */; }; 53D59DB320ABA18400207065 /* NetworkViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 53D59DAA20ABA18300207065 /* NetworkViewController.m */; }; 53D59DB420ABA18400207065 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 53D59DAB20ABA18300207065 /* AppDelegate.m */; }; 53D59DB520ABA18400207065 /* MainViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 53D59DAD20ABA18300207065 /* MainViewController.mm */; }; @@ -25,6 +26,8 @@ 4E102340216AD7B400160734 /* UserDefaultsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UserDefaultsViewController.m; sourceTree = ""; }; 534252A9217DECCD0092D02B /* CommunicationDemoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CommunicationDemoViewController.h; sourceTree = ""; }; 53B4A36A217E2B6200B36A53 /* CommunicationDemoViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CommunicationDemoViewController.mm; sourceTree = ""; }; + 53B8C8D123788AC500D2D1FD /* Sample-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Sample-Bridging-Header.h"; sourceTree = ""; }; + 53B8C8D223788AC600D2D1FD /* Dummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dummy.swift; sourceTree = ""; }; 53D59DAA20ABA18300207065 /* NetworkViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NetworkViewController.m; sourceTree = SOURCE_ROOT; }; 53D59DAB20ABA18300207065 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = SOURCE_ROOT; }; 53D59DAC20ABA18300207065 /* NetworkViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkViewController.h; sourceTree = SOURCE_ROOT; }; @@ -80,10 +83,12 @@ 53E0DE3820ABA0E3005682E1 = { isa = PBXGroup; children = ( + 53B8C8D223788AC600D2D1FD /* Dummy.swift */, 53D59DB920ABA19900207065 /* Sample */, 53E0DE4220ABA0E3005682E1 /* Products */, 56F86505D10A36D42C8D0302 /* Pods */, C89232DD95E032B5B6FA95A1 /* Frameworks */, + 53B8C8D123788AC500D2D1FD /* Sample-Bridging-Header.h */, ); sourceTree = ""; }; @@ -144,6 +149,7 @@ TargetAttributes = { 53E0DE4020ABA0E3005682E1 = { CreatedOnToolsVersion = 9.4; + LastSwiftMigration = 1120; }; }; }; @@ -205,6 +211,7 @@ files = ( 53E0DE5420ABA0E4005682E1 /* main.m in Sources */, 4E102341216AD7B400160734 /* UserDefaultsViewController.m in Sources */, + 53B8C8D323788AC600D2D1FD /* Dummy.swift in Sources */, 53D59DB320ABA18400207065 /* NetworkViewController.m in Sources */, 53D59DB420ABA18400207065 /* AppDelegate.m in Sources */, 53B4A36B217E2B6200B36A53 /* CommunicationDemoViewController.mm in Sources */, @@ -332,6 +339,7 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; GCC_NO_COMMON_BLOCKS = YES; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -415,6 +423,9 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.facebook.flipper; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Sample-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -425,6 +436,7 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; GCC_NO_COMMON_BLOCKS = YES; HEADER_SEARCH_PATHS = ( @@ -504,6 +516,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.facebook.flipper; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Sample-Bridging-Header.h"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/iOS/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme b/iOS/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme new file mode 100644 index 000000000..dde00876d --- /dev/null +++ b/iOS/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +