Closed drkibitz closed 7 years ago
Hey @drkibitz,
Thanks for filling an issue.
Short answer: Normally just using carthage checkout
seems to work just in SwiftGit2. And as the issue that you filed on that project suggests, using the submodules will probably work fine too.
Longer answer: Bitcode is a weird state when any framework links to XCTest. It roughly approximates to the fact that XCTest doesn't actually support bitcode on any platform.
There's some trickery that goes on with xcodebuild test
when linking against XCTest. xcodebuild
will intelligently modify build settings (aka - disables bitcode) when building for tests. Add a tool like Carthage which builds binaries separate from a test action causes it to fail. Carthage doesn't allow Xcode to infer that the entire project is being built for tests or not.
If you'd like more context, here's two issues that cover most of it from Nimble's perspective:
I've attempted to build SwiftGit2 as your issue mentioned on SwiftGit2 and got Guanaco linker errors (carthage checkout
):
xqejmjz/Build/Intermediates/Guanaco.build/Release-iphoneos/Guanaco-iOS.build/Objects-normal/armv7/Guanaco (No such file or directory)
error: cannot parse the debug map for "/Users/jeff/Library/Developer/Xcode/DerivedData/Guanaco-eysiauicwtxjnxdaagvywxqejmjz/Build/Products/Release-iphoneos/Guanaco.framework/Guanaco": No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: /Users/jeff/Library/Developer/Xcode/DerivedData/Guanaco-eysiauicwtxjnxdaagvywxqejmjz/Build/Intermediates/Guanaco.build/Release-iphoneos/GuanacoTests-iOS.build/Objects-normal/armv7/GuanacoTests (No such file or directory)
error: cannot parse the debug map for "/Users/jeff/Library/Developer/Xcode/DerivedData/Guanaco-eysiauicwtxjnxdaagvywxqejmjz/Build/Products/Release-iphoneos/GuanacoTests.xctest/GuanacoTests": No such file or directory
A shell task (/usr/bin/xcrun xcodebuild -workspace /Users/jeff/workspace/SwiftGit2/Carthage/Checkouts/Guanaco/Guanaco.xcworkspace -scheme Guanaco-iOS -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build) failed with exit code 65:
** BUILD FAILED **
The following build commands failed:
Ld /Users/jeff/Library/Developer/Xcode/DerivedData/Guanaco-eysiauicwtxjnxdaagvywxqejmjz/Build/Intermediates/Guanaco.build/Release-iphoneos/Guanaco-iOS.build/Objects-normal/armv7/Guanaco normal armv7
Ld /Users/jeff/Library/Developer/Xcode/DerivedData/Guanaco-eysiauicwtxjnxdaagvywxqejmjz/Build/Intermediates/Guanaco.build/Release-iphoneos/Guanaco-iOS.build/Objects-normal/arm64/Guanaco normal arm64
CreateUniversalBinary /Users/jeff/Library/Developer/Xcode/DerivedData/Guanaco-eysiauicwtxjnxdaagvywxqejmjz/Build/Products/Release-iphoneos/Guanaco.framework/Guanaco normal armv7\ arm64
GenerateDSYMFile /Users/jeff/Library/Developer/Xcode/DerivedData/Guanaco-eysiauicwtxjnxdaagvywxqejmjz/Build/Products/Release-iphoneos/Guanaco.framework.dSYM /Users/jeff/Library/Developer/Xcode/DerivedData/Guanaco-eysiauicwtxjnxdaagvywxqejmjz/Build/Products/Release-iphoneos/Guanaco.framework/Guanaco
Ld /Users/jeff/Library/Developer/Xcode/DerivedData/Guanaco-eysiauicwtxjnxdaagvywxqejmjz/Build/Intermediates/Guanaco.build/Release-iphoneos/GuanacoTests-iOS.build/Objects-normal/armv7/GuanacoTests normal armv7
Ld /Users/jeff/Library/Developer/Xcode/DerivedData/Guanaco-eysiauicwtxjnxdaagvywxqejmjz/Build/Intermediates/Guanaco.build/Release-iphoneos/GuanacoTests-iOS.build/Objects-normal/arm64/GuanacoTests normal arm64
CreateUniversalBinary /Users/jeff/Library/Developer/Xcode/DerivedData/Guanaco-eysiauicwtxjnxdaagvywxqejmjz/Build/Products/Release-iphoneos/GuanacoTests.xctest/GuanacoTests normal armv7\ arm64
GenerateDSYMFile /Users/jeff/Library/Developer/Xcode/DerivedData/Guanaco-eysiauicwtxjnxdaagvywxqejmjz/Build/Products/Release-iphoneos/GuanacoTests.xctest.dSYM /Users/jeff/Library/Developer/Xcode/DerivedData/Guanaco-eysiauicwtxjnxdaagvywxqejmjz/Build/Products/Release-iphoneos/GuanacoTests.xctest/GuanacoTests
(8 failures)
It seems like Guanaco needs to set ENABLE_BITCODE=NO
.
If you have any other questions or issues. Feel free to reply here or open a new issue.
-Jeff
What did you do?
Tested SwiftGit2
What did you expect to happen?
Able to link with test frameworks with BITCODE enabled.
What actually happened instead?
Failed during linking:
I enabled BITCODE in Nimble, and was able to build and test successfully.
Environment
List the software versions you're using:
Xcode Default
Please also mention which package manager you used and its version. Delete the other package managers in this list:
Project that demonstrates the issue
Related to SwiftGit2: https://github.com/SwiftGit2/SwiftGit2 Issue: https://github.com/SwiftGit2/SwiftGit2/issues/80