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

Static frameworks - Task failed with exit code 65 #2425

Closed
floschliep opened this issue Apr 21, 2018 · 20 comments
Closed

Static frameworks - Task failed with exit code 65 #2425

floschliep opened this issue Apr 21, 2018 · 20 comments

Comments

@floschliep
Copy link

  • carthage install method: homebrew
  • which carthage: /usr/local/bin/carthage
  • carthage version: 0.29.0
  • xcodebuild -version: Xcode 9.3 Build version 9E145
  • Are you using --no-build? No
  • Are you using --no-use-binaries? Yes
  • Are you using --use-submodules? No
  • Are you using --cache-builds? No
  • Are you using --new-resolver? No

Cartfile

github "onevcat/Kingfisher" ~> 4.0
github "aws/aws-sdk-ios"
github "facebook/facebook-ios-sdk"
github "airbnb/lottie-ios" "master"
github "tonyarnold/Differ"
github "uber/ios-snapshot-test-case"

Carthage Output

Build Failed
	Task failed with exit code 65:
	/usr/bin/xcrun xcodebuild -project /Users/florianschliep/Code/iOS/TryNotToLaugh/Carthage/Checkouts/Differ/Differ.xcodeproj -scheme Differ -configuration Release -derivedDataPath /Users/florianschliep/Library/Caches/org.carthage.CarthageKit/DerivedData/9.3_9E145/Differ/1.2.2 -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/4t/fg591t79335363zm3b23z9qr0000gn/T/Differ SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/florianschliep/Code/iOS/TryNotToLaugh/Carthage/Checkouts/Differ)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/4t/fg591t79335363zm3b23z9qr0000gn/T/carthage-xcodebuild.kxbc67.log

Actual outcome
Carthage fails to build the Differ dependency. I've attached the log file. When running the command (xcrun codebuild …) manually, the archive succeeds with this log.

Expected outcome
Carthage should build all dependencies.

I'm using a build script as described here to build static frameworks:

#!/bin/sh -e

xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT

echo "LD = $PWD/ld.py" >> $xcconfig
echo "DEBUG_INFORMATION_FORMAT = dwarf" >> $xcconfig

export XCODE_XCCONFIG_FILE="$xcconfig"

carthage build --platform ios --no-use-binaries
@tmspzz tmspzz changed the title Task failed with exit code 65 Static frameworks - Task failed with exit code 65 Apr 21, 2018
@tmspzz
Copy link
Member

tmspzz commented Apr 21, 2018

Building static frameworks is experimental at best. Also, as pointed out on the page of ld.py there is no need to override LD anymore.

@tmspzz
Copy link
Member

tmspzz commented Apr 21, 2018

You can build Carthage from this branch #2415 currently under development and try out static framework support.

@floschliep
Copy link
Author

floschliep commented Apr 21, 2018

@blender Thanks for pointing that out, removing the LD overwrite seems to fix this.

I should also mention that everything worked fine before upgrading to Xcode 9.3, in case anyone else ever runs into this.

@floschliep
Copy link
Author

Forget what I said about removing the LD overwrite, as I now discovered this apparently made Carthage build dynamic frameworks.

@floschliep floschliep reopened this Apr 21, 2018
@floschliep
Copy link
Author

@blender I'm now using the branch from #2415 but can't get Carthage to build static frameworks. I tried altering my build script to do the following:

echo "MACH_O_TYPE = staticlib" >> $xcconfig

but with this, Carthage is unable to find the scheme.

@Aranoledur
Copy link
Contributor

What if you change Mach-O Type in xcode project at Carthage/Checkouts/Differ and then run carthage build again?

@floschliep
Copy link
Author

That doesn't seem to make a difference, I still get the same error:

Dependency "Differ" has no shared framework schemes for any of the platforms: iOS

If I remove the --platform ios option, the error is:

Dependency "Differ" has no shared framework schemes

@Aranoledur
Copy link
Contributor

Ok, will try to find what is wrong here. Thanks for pointing this out

@Aranoledur
Copy link
Contributor

Aranoledur commented Apr 24, 2018

@floschliep Well, I don't know how to debug custom script, but I was able to build static framework by using carthage from branch Aranoledur:support-building-static-frameworks and changing Mach-O Type in Differ.xcodeproj

@floschliep
Copy link
Author

floschliep commented Apr 24, 2018

@Aranoledur That's what I did too. I deleted Carthage/Checkouts/Differ, ran carthage bootstrap --platform ios --no-use-binaries --no-build, changed the Mach-O type and then carthage build Differ --platform ios --no-use-binaries --verbose:

*** Skipped building Differ due to the error:
Dependency "Differ" has no shared framework schemes for any of the platforms: iOS

If you believe this to be an error, please file an issue with the maintainers at https://github.com/tonyarnold/Differ/issues/new

@Aranoledur
Copy link
Contributor

I use carthage built by XCode. Do you call make install or use XCode too? They have to be the same, but still

@floschliep
Copy link
Author

@Aranoledur I used make install.

@Aranoledur
Copy link
Contributor

commit sha ce73a6e51362ee30a1c785e2bc26dc39c46f1677?

@floschliep
Copy link
Author

Yes.

@Aranoledur
Copy link
Contributor

It's a kind of magic 😃 I have bumped carthage version, so pull, make install again and check what version do you use, it should be 0.29.1. Think it can help

@floschliep
Copy link
Author

It's version 0.29.0 for me. I even changed the version manually in the Xcode project and ran make install again. Are you also using the support-building-static-frameworks branch from your fork?

@Aranoledur
Copy link
Contributor

Yes, I don't have rights to push to original repo. Commit sha: 661fb613af5778410709f5fab25351ea34d7014e

@tmspzz
Copy link
Member

tmspzz commented Apr 25, 2018

@floschliep on this repo, Carthage/Carthage you can check @Aranoledur PR by:

$ git fetch origin pull/2415/head:pull/2415
$ git checkout pull/2415
$ make install

see https://help.github.com/articles/checking-out-pull-requests-locally/

@floschliep
Copy link
Author

@blender That did the trick, thanks! Also my custom script that modifies the config file works now:

#!/bin/sh -e

xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT

echo "MACH_O_TYPE = staticlib" >> $xcconfig
echo "DEBUG_INFORMATION_FORMAT = dwarf" >> $xcconfig

export XCODE_XCCONFIG_FILE="$xcconfig"

carthage build --platform ios --no-use-binaries

With this you don't need to manually edit the Xcode projects anymore.

Thanks @Aranoledur for your work 🙌

@tmspzz
Copy link
Member

tmspzz commented Apr 25, 2018

@floschliep @Aranoledur awesome.

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