parse-community / Parse-SDK-iOS-OSX

The Apple SDK for Parse Platform (iOS, macOS, watchOS, tvOS)
https://parseplatform.org
Other
2.81k stars 871 forks source link

SDK fails to compile in Xcode 10 #1348

Closed mtrezza closed 5 years ago

mtrezza commented 6 years ago

The SDK fails to compile in Xcode 10.

ParseFacebookUtilsV4-iOS-Dynamic fails to compile with carthage v0.30.1.

Here is the an extract of the carthage error log:

CopyStringsFile /<removed>/Carthage/Checkouts/Parse-SDK-iOS-OSX/ParseFacebookUtils
    builtin-copyStrings --validate --inputencoding utf-8 --outputencoding binary --outdir /<removed>/Carthage/Checkouts/Parse-SDK-iOS-OSX/ParseFacebookUtils/Resources/Localizable.strings
error: could not decode input file using specified encoding: Unicode (UTF-8), and the file contents appear to be encoded in Unicode (UTF-16)

** ARCHIVE FAILED **

The following commands produced analyzer issues:
    AnalyzeShallow /<removed>/Carthage/Checkouts/Parse-SDK-iOS-OSX/Parse/Parse/PFObject.m normal arm64
(1 command with analyzer issues)

The following build commands failed:
    CopyStringsFile /<removed>/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A255/Parse-SDK-iOS-OSX/1.17.1/Build/Intermediates.noindex/ArchiveIntermediates/ParseFacebookUtilsV4-iOS-Dynamic/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/ParseFacebookUtilsV4.framework/Localizable.strings /<removed>/Carthage/Checkouts/Parse-SDK-iOS-OSX/ParseFacebookUtils/Resources/Localizable.strings
(1 failure)
flovilmart commented 6 years ago

Can you try the xcode10 branch? it's sill failing in CI but it should be OK.

mtrezza commented 6 years ago

Same error on the xcode10 branch.

flovilmart commented 6 years ago

I just pushed a commit that removes them all as they are empty and unused.

mtrezza commented 6 years ago

I get another error, unfortunately without any further details:

The following build commands failed:
    Ld /<removed>/org.carthage.CarthageKit/DerivedData/10.0_10A255/Parse-SDK-iOS-OSX/81549b616674408b5303fe70c308051210a4532a/Build/Intermediates.noindex/ArchiveIntermediates/ParseFacebookUtilsV4-iOS-Dynamic/IntermediateBuildFilesPath/ParseFacebookUtils.build/Release-iphoneos/ParseFacebookUtilsV4-iOS-Dynamic.build/Objects-normal/armv7/ParseFacebookUtilsV4 normal armv7
(1 failure)
flovilmart commented 6 years ago

you can probably investigate on your own then.

mtrezza commented 6 years ago

Yes, building it in Xcode instead of carthage gives more details about the error:

Undefined symbols for architecture armv7:
  "___llvm_profile_runtime", referenced from:
      ___llvm_profile_runtime_user in Parse(PFUser.o)
      ___llvm_profile_runtime_user in Parse(Parse.o)
      ___llvm_profile_runtime_user in Parse(PFConstants.o)
      ___llvm_profile_runtime_user in Parse(PFAnonymousUtils.o)
      ___llvm_profile_runtime_user in Parse(PFApplication.o)
      ___llvm_profile_runtime_user in Parse(PFCategoryLoader.o)
      ___llvm_profile_runtime_user in Parse(PFErrorUtilities.o)
      <removed>
      ...
     (maybe you meant: ___llvm_profile_runtime_user)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The ParseFacebookUtilsV4-iOS build successfully, but ParseFacebookUtilsV4-iOS-Dynamic fails. It seems there has been a similar issue #1159 in the past.

According to this Q&A the issue arises from an instrumentation framework being on in build settings. This describes how to disable GCC and LLVM instrumentation.

I was able to build ParseFacebookUtilsV4-iOS-Dynamic by setting Scheme > Test > Code Coverage from disabled to Gather coverage for all targets. Why turning on Code Coverage (instead of turning it off) makes it build successfully is unclear to me.

mtrezza commented 6 years ago

xcode10 branch building successfully now, commit 8f513ad054cc5ba910d7e1028d48b6515117cd08 solved the issue.

Thanks @flovilmart đź‘Ť

cliftonlabrum commented 6 years ago

I'm running into this. My Cartfile on Carthage 0.30.1 looks like this:

github "parse-community/Parse-SDK-iOS-OSX" "xcode10"

I'm building for iOS and Mac and this is the result:

*** Building scheme "FBSDKCoreKit-Universal" in FacebookSDK.xcworkspace
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild 
  -workspace /.../facebook-ios-sdk/FacebookSDK.xcworkspace 
  -scheme FBSDKCoreKit-Universal 
  -configuration Release 
  -derivedDataPath /.../facebook-ios-sdk/sdk-version-4.36.0 
  -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive 
  -archivePath /var/folders/.../facebook-ios-sdk SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /.../facebook-ios-sdk)

Any idea what else I can try?

flovilmart commented 6 years ago

The Xcode10 branch is highly unstable and I don’t provide any support for it as it’s a work in progress. I can’t give a timeline on when it will be stable. In the meantime feel free to investigate.

mtrezza commented 6 years ago

@cliftonlabrum This is a known issue of the Facebook SDK. Downgrade to Carthage 0.29 and try again.

brew uninstall --force carthage
brew install https://github.com/Homebrew/homebrew-core/raw/45dd24d8dfa7a2fb69812c678ceb34be0c16e295/Formula/carthage.rb
cliftonlabrum commented 6 years ago

Thank you for your quick replies. I downgraded to Carthage 0.29 and the error is a little different now:

*** Building scheme "Parse-macOS" in Parse.xcworkspace
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild 
  -workspace /.../Parse-SDK-iOS-OSX/Parse.xcworkspace 
  -scheme Parse-macOS -configuration Release 
  -derivedDataPath /.../10.0_10A254a/Parse-SDK-iOS-OSX/c49c405f3ec3f854ae96ba4aa6e068f32fb8bbf2 ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive 
  -archivePath /var/folders/g5/bj4py0313_zdqvd2_g77f4x00000gn/T/Parse-SDK-iOS-OSX SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /.../Parse-SDK-iOS-OSX)
mtrezza commented 6 years ago

@cliftonlabrum I suggest you build in Xcode to get error details and take it from there.

mtrezza commented 6 years ago

The Xcode10 branch is highly unstable and I don’t provide any support for it as it’s a work in progress. I can’t give a timeline on when it will be stable. In the meantime feel free to investigate.

@flovilmart Which instabilities are those? Maybe I can give a hand. It compiled for me in Xcode and Carthage 0.29. The only issue that I noticed still exists with the xcode10 branch (#1309) is the name conflicts of PFFile and PFLogger with PhotoFoundation (#1325).

flovilmart commented 6 years ago

It’s not merged to master and I’m pushing commits to it as the tests don’t pass on it... so do not use!

cliftonlabrum commented 6 years ago

@mtrezza I'll see if I can build it in Xcode and let you know. Can you successfully install Parse with Carthage in a test project that has a macOS target? I'm just wondering if it's my setup or if it's the framework.

mtrezza commented 6 years ago

I installed for iOS.

On 20.09.2018, at 20:53, Clifton Labrum notifications@github.com wrote:

@mtrezza I'll see if I can build it in Xcode and let you know. Can you successfully install Parse with Carthage in a test project that has a macOS target? I'm just wondering if it's my setup or if it's the framework.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

cliftonlabrum commented 6 years ago

@mtrezza Could you try installing it on a macOS target in a test project?

mtrezza commented 6 years ago

@cliftonlabrum I leave that research to you. What error details did you get when compiling in Xcode?

cliftonlabrum commented 6 years ago

I'm happy to do that, but I'm not sure how. :) I followed the instructions in Compiling for yourself here: https://github.com/parse-community/Parse-SDK-iOS-OSX/tree/xcode10

But I'm unsure what to do next.

mtrezza commented 6 years ago

After compiling you should find the compiled macOS framework in Parse-macOS.zip

cliftonlabrum commented 6 years ago

Building on my own succeeded. I installed everything via Carthage, then just added Parse.framework from the Parse-macOS.zip file to my project and it works.

Thanks everyone! :)

flovilmart commented 6 years ago

Again, the Xcode 10 branch tests don’t pass...

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. If you believe it should stay open, please let us know! As always, we encourage contributions, check out the Contributing Guide

mtrezza commented 6 years ago

Should stay open.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. If you believe it should stay open, please let us know! As always, we encourage contributions, check out the Contributing Guide

mrmarcsmith commented 5 years ago

I cloned the iOS/OSX project but I couldn’t find out how to run the OCMock tests. I also checked the OCMock website with no luck. I’ve never worked with OCMock, so any guidance would be appreciated.

mman commented 5 years ago

Just to update, I was able to successfully compile the iOS part of the SDK using the following Carthage setup:

$ cat Cartfile |grep Parse
github "parse-community/Parse-SDK-iOS-OSX"

$ carthage update --no-build
$ carthage build --cache-builds --platform iOS
Samigos commented 5 years ago

Is the SDK now compatible with Swift 4.2-5?

noobs2ninjas commented 5 years ago

@Samigos it is. Have you tried this recently? Has this issue been solved?

Samigos commented 5 years ago

@Samigos it is. Have you tried this recently? Has this issue been solved?

Yep! Everything works!

noobs2ninjas commented 5 years ago

Perfect! Ill close the issue! Thanks