Carthage: Xcode 11.0 Beta 4 fails to archive Swift-containing frameworks w/ Bitcode 路 Workaround Available

Created on 18 Jul 2019  路  24Comments  路  Source: Carthage/Carthage

  • carthage install method: [ ] .pkg, [x ] homebrew, [ ] source
  • which carthage: /usr/local/bin/carthage
  • carthage version: 0.33.0
  • xcodebuild -version: Build version 11M374r
  • Are you using --no-build? no
  • Are you using --no-use-binaries? no
  • Are you using --use-submodules? no
  • Are you using --cache-builds? no
  • Are you using --new-resolver? no

Cartfile

<YOUR CARTFILE>

github "soffes/CommonCrypto"
github "soffes/Crypto"
github "MagicalPanda/MagicalRecord"
github "timbueno/TBDirectoryKit"
github "https://github.com/dropbox/SwiftyDropbox" ~> 5.0.0
github "timbueno/GCDWebServer" ~> 3.3.34
github "ashleymills/Reachability.swift" ~> 4.0
github "shinydevelopment/SimulatorStatusMagic" ~> 1.9.2
github "PierrePerrin/ShadowView"

Carthage Output

ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** ARCHIVE FAILED **


The following build commands failed:
    Ld /Users/tim/Library/Caches/org.carthage.CarthageKit/DerivedData/11.0_11M374r/Alamofire/4.8.2/Build/Intermediates.noindex/ArchiveIntermediates/Alamofire\ iOS/IntermediateBuildFilesPath/Alamofire.build/Release-iphoneos/Alamofire\ iOS.build/Objects-normal/arm64/Binary/Alamofire normal arm64
(1 failure)
Build Failed
    Task failed with exit code 65:
    /usr/bin/xcrun xcodebuild -workspace /Users/tim/Projects/Bound/Carthage/Checkouts/Alamofire/Alamofire.xcworkspace -scheme Alamofire\ iOS -configuration Release -derivedDataPath /Users/tim/Library/Caches/org.carthage.CarthageKit/DerivedData/11.0_11M374r/Alamofire/4.8.2 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/tl/v7ygpjb93xgbk8mz478x769m0000gn/T/Alamofire SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/tim/Projects/Bound/Carthage/Checkouts/Alamofire)

This usually indicates that project itself failed to compile.

Actual outcome
Carthage fails to compile dependencies after updating to Xcode 11 Beta 4.

Expected outcome
Carthage should compile these dependencies.

possible-workaround question stale upstream

Most helpful comment

To solve the issue create a workaround.xcconfig file. This file can live elsewhere - like your desktop.

LD_VERIFY_BITCODE=NO

Then doing the following should work

XCODE_XCCONFIG_FILE=/Users/SomeUser/SomeDirectory/Project/workaround.xcconfig carthage update platform iOS

All 24 comments

I think I'm seeing a similar issue and the source of the problem is Xcode. If you look through the log file are there references to Swift methods not being found?

I also found this issue, platform Mac no this issue .

I also found this issue, platform Mac no this issue .

MacOS Schemes are building just fine on mine as well...

I think I'm seeing a similar issue and the source of the problem is Xcode. If you look through the log file are there references to Swift methods not being found?

ld: warning: Could not find or use auto-linked library 'swiftFoundation'
ld: warning: Could not find or use auto-linked library 'swiftDarwin'
ld: warning: Could not find or use auto-linked library 'swiftCoreGraphics'
ld: warning: Could not find or use auto-linked library 'swiftCore'
ld: warning: Could not find or use auto-linked library 'swiftCoreFoundation'
ld: warning: Could not find or use auto-linked library 'swiftObjectiveC'
ld: warning: Could not find or use auto-linked library 'swiftDispatch'

I'm not sure if that is what you were asking about or not though...

Yes, that is the same thing I'm seeing when trying to archive a framework directly from Xcode. Haven't found a workaround yet.

Looks like Xcode can't find the Swift standard libraries for phone or watch architectures.

So, not a Carthage issue :)

To solve the issue create a workaround.xcconfig file. This file can live elsewhere - like your desktop.

LD_VERIFY_BITCODE=NO

Then doing the following should work

XCODE_XCCONFIG_FILE=/Users/SomeUser/SomeDirectory/Project/workaround.xcconfig carthage update platform iOS

Setting a custom xcconfig file didn't work for me, so I whipped up a small ruby script to add the build setting, you have to run it after updating, and then just tell carthage to build. This may save some time for someone.

https://gist.github.com/octover/fd7da48cd35794cc5f1766031ccc7994

Actually the xcconfig file worked for me, it just had to be an absolute path and not relative, that would be much easier to do what @kaandedeoglu suggested.

As suggested by @jdhealy in a private conversation the best workaround is:

1) Create a Xcode11Beta4Fix.xcconfig containing:

LD_VERIFY_BITCODE__XCODE_PRODUCT_BUILD_VERSION_11M374r=NO
LD_VERIFY_BITCODE=$(LD_VERIFY_BITCODE__XCODE_PRODUCT_BUILD_VERSION_$(XCODE_PRODUCT_BUILD_VERSION))

2) Then

XCODE_XCCONFIG_FILE=/absolute/path/to/Xcode11Beta4Fix.xcconfig carthage update --platform iOS

All credit to @jdhealy

Workaround is not working.

@ajmeerkhan are you using an absolute path? Did you name the variables correctly? Are you using beta4 ? It ONLY works on beta4

@tmspzz yes am using the absolute path, and naming variables are correct, and off course using beta 4

@ajmeerkhan try following other suggestions in the thread. Or wait for the next beta. This is not a Carthage issue.

@tmspzz Totally unrelated, but looking to install some dependencies for Xcode 11 & Swift 5.1
I cloned the Carthage repo and ran make install, but got an error. Below is the error output, could you point me in the right direction to successfully run make install?

:0: error: fatal error encountered during compilation; please file a bug report with your project and the crash log
:0: note: Type variable id overflow
Stack dump:

  1. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/user/Workspaces/Carthage/Source/carthage/Archive.swift /Users/user/Workspaces/Carthage/Source/carthage/Bootstrap.swift /Users/user/Workspaces/Carthage/Source/carthage/Build.swift /Users/user/Workspaces/Carthage/Source/carthage/Checkout.swift /Users/user/Workspaces/Carthage/Source/carthage/CopyFrameworks.swift /Users/user/Workspaces/Carthage/Source/carthage/Environment.swift /Users/user/Workspaces/Carthage/Source/carthage/Extensions.swift /Users/user/Workspaces/Carthage/Source/carthage/Fetch.swift /Users/user/Workspaces/Carthage/Source/carthage/Formatting.swift /Users/user/Workspaces/Carthage/Source/carthage/Outdated.swift /Users/user/Workspaces/Carthage/Source/carthage/RemoteVersion.swift /Users/user/Workspaces/Carthage/Source/carthage/Update.swift /Users/user/Workspaces/Carthage/Source/carthage/Validate.swift /Users/user/Workspaces/Carthage/Source/carthage/Version.swift /Users/user/Workspaces/Carthage/Source/carthage/main.swift -supplementary-output-file-map /var/folders/yz/xqh03bcn2rq5rt7p6kpj1fy5vzpy00/T/supplementaryOutputs-824661 -target x86_64-apple-macosx10.10 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I /Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release -I /Users/user/Workspaces/Carthage/.build/checkouts/swift-llbuild/products/libllbuild/include -I /Users/user/Workspaces/Carthage/.build/checkouts/swift-llbuild/lib/BuildSystem/include -I /Users/user/Workspaces/Carthage/.build/checkouts/swift-llbuild/lib/Core/include -I /Users/user/Workspaces/Carthage/.build/checkouts/swift-llbuild/lib/Basic/include -I /Users/user/Workspaces/Carthage/.build/checkouts/swift-llbuild/lib/llvm/Support/include -I /Users/user/Workspaces/Carthage/.build/checkouts/swift-llbuild/lib/llvm/Demangle/include -I /Users/user/Workspaces/Carthage/.build/checkouts/swift-package-manager/Sources/clibc/include -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -module-cache-path /Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/ModuleCache -suppress-warnings -swift-version 4.2 -O -D SWIFT_PACKAGE -color-diagnostics -Xcc -fmodule-map-file=/Users/user/Workspaces/Carthage/.build/checkouts/swift-llbuild/products/libllbuild/include/module.modulemap -Xcc -fmodule-map-file=/Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/llbuildBuildSystem.build/module.modulemap -Xcc -fmodule-map-file=/Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/llbuildCore.build/module.modulemap -Xcc -fmodule-map-file=/Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/llbuildBasic.build/module.modulemap -Xcc -fmodule-map-file=/Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/llvmSupport.build/module.modulemap -Xcc -fmodule-map-file=/Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/llvmDemangle.build/module.modulemap -Xcc -fmodule-map-file=/Users/user/Workspaces/Carthage/.build/checkouts/swift-package-manager/Sources/clibc/include/module.modulemap -module-name carthage -num-threads 12 -o /Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/carthage.build/Archive.swift.o -o /Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/carthage.build/Bootstrap.swift.o -o /Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/carthage.build/Build.swift.o -o /Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/carthage.build/Checkout.swift.o -o /Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/carthage.build/CopyFrameworks.swift.o -o /Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/carthage.build/Environment.swift.o -o /Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/carthage.build/Extensions.swift.o -o /Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/carthage.build/Fetch.swift.o -o /Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/carthage.build/Formatting.swift.o -o /Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/carthage.build/Outdated.swift.o -o /Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/carthage.build/RemoteVersion.swift.o -o /Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/carthage.build/Update.swift.o -o /Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/carthage.build/Validate.swift.o -o /Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/carthage.build/Version.swift.o -o /Users/user/Workspaces/Carthage/.build/x86_64-apple-macosx/release/carthage.build/main.swift.o
  2. While type-checking 'evaluate(_:)' (at /Users/user/Workspaces/Carthage/Source/carthage/Update.swift:64:10)
  3. While type-checking statement at [/Users/user/Workspaces/Carthage/Source/carthage/Update.swift:64:103 - line:77:3] RangeText="{
    let buildDescription = "skip the building of dependencies after updating\n(ignored if --no-checkout option is present)"
        let dependenciesUsage = "the dependency names to update, checkout and build"

        return curry(Options.init)
            <*> mode <| Option(key: "checkout", defaultValue: true, usage: "skip the checking out of dependencies after updating")
            <*> mode <| Option(key: "build", defaultValue: true, usage: buildDescription)
            <*> mode <| Option(key: "verbose", defaultValue: false, usage: "print xcodebuild output inline (ignored if --no-build option is present)")
            <*> mode <| Option(key: "log-path", defaultValue: nil, usage: "path to the xcode build output. A temporary file is used by default")
            <*> mode <| Option(key: "new-resolver", defaultValue: false, usage: "use the new resolver codeline when calculating dependencies. Default is false")
            <*> BuildOptions.evaluate(mode, addendum: "\n(ignored if --no-build option is present)")
            <*> CheckoutCommand.Options.evaluate(mode, dependenciesUsage: dependenciesUsage)
    "

  1. While type-checking statement at [/Users/user/Workspaces/Carthage/Source/carthage/Update.swift:69:4 - line:76:84] RangeText="return curry(Options.init)
    <> mode <| Option(key: "checkout", defaultValue: true, usage: "skip the checking out of dependencies after updating")
    <
    > mode <| Option(key: "build", defaultValue: true, usage: buildDescription)
    <> mode <| Option(key: "verbose", defaultValue: false, usage: "print xcodebuild output inline (ignored if --no-build option is present)")
    <
    > mode <| Option(key: "log-path", defaultValue: nil, usage: "path to the xcode build output. A temporary file is used by default")
    <> mode <| Option(key: "new-resolver", defaultValue: false, usage: "use the new resolver codeline when calculating dependencies. Default is false")
    <
    > BuildOptions.evaluate(mode, addendum: "\n(ignored if --no-build option is present)")
    <*> CheckoutCommand.Options.evaluate(mode, dependenciesUsage: dependenciesUsage"
  2. While type-checking expression at [/Users/user/Workspaces/Carthage/Source/carthage/Update.swift:69:11 - line:76:84] RangeText="curry(Options.init)
    <> mode <| Option(key: "checkout", defaultValue: true, usage: "skip the checking out of dependencies after updating")
    <
    > mode <| Option(key: "build", defaultValue: true, usage: buildDescription)
    <> mode <| Option(key: "verbose", defaultValue: false, usage: "print xcodebuild output inline (ignored if --no-build option is present)")
    <
    > mode <| Option(key: "log-path", defaultValue: nil, usage: "path to the xcode build output. A temporary file is used by default")
    <> mode <| Option(key: "new-resolver", defaultValue: false, usage: "use the new resolver codeline when calculating dependencies. Default is false")
    <
    > BuildOptions.evaluate(mode, addendum: "\n(ignored if --no-build option is present)")
    <> CheckoutCommand.Options.evaluate(mode, dependenciesUsage: dependenciesUsage"
    0 swift 0x000000010d52a0e3 PrintStackTraceSignalHandler(void
    ) + 51
    1 swift 0x000000010d5298b6 SignalHandler(int) + 358
    2 libsystem_platform.dylib 0x00007fff7b2cdb5d _sigtramp + 29
    3 libsystem_platform.dylib 0x0000000117273b76 _sigtramp + 2616877110
    4 libsystem_c.dylib 0x00007fff7b1876a6 abort + 127
    5 swift 0x000000010917b2a0 std::__1::unique_ptr > llvm::function_ref > (swift::InputFile const&)>::callback_fn(long, swift::InputFile const&) + 0
    6 swift 0x000000010d4a32e6 llvm::report_fatal_error(llvm::Twine const&, bool) + 278
    7 swift 0x000000010d4a31cb llvm::report_fatal_error(char const, bool) + 43
    8 swift 0x0000000109bb52e8 swift::constraints::ConstraintSystem::createTypeVariable(swift::constraints::ConstraintLocator
    , unsigned int) + 408
    9 swift 0x0000000109c1bf4c swift::constraints::ConstraintSystem::openGeneric(swift::DeclContext, swift::DeclContext, swift::GenericSignature, bool, swift::constraints::ConstraintLocatorBuilder, llvm::DenseMap, llvm::detail::DenseMapPair >&, bool) + 412
    10 swift 0x0000000109c1ce96 swift::constraints::ConstraintSystem::openFunctionType(swift::AnyFunctionType
    , unsigned int, swift::constraints::ConstraintLocatorBuilder, llvm::DenseMap, llvm::detail::DenseMapPair >&, swift::DeclContext, swift::DeclContext, bool, bool) + 182
    11 swift 0x0000000109c1e1e9 swift::constraints::ConstraintSystem::getTypeOfReference(swift::ValueDecl, swift::FunctionRefKind, swift::constraints::ConstraintLocatorBuilder, swift::DeclContext) + 1097
    12 swift 0x0000000109c20a72 swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator, swift::Type, swift::constraints::OverloadChoice, swift::DeclContext) + 802
    13 swift 0x0000000109bb4594 swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 804
    14 swift 0x0000000109bb4c19 swift::constraints::ConstraintSystem::simplifyDisjunctionChoice(swift::constraints::Constraint) + 25
    15 swift 0x0000000109bd1099 swift::constraints::DisjunctionStep::attempt(swift::constraints::DisjunctionChoice const&) + 185
    16 swift 0x0000000109bd08e3 swift::constraints::BindingStep::take(bool) + 595
    17 swift 0x0000000109bbb9e4 swift::constraints::ConstraintSystem::solve(llvm::SmallVectorImpl&) + 276
    18 swift 0x0000000109bc0a64 swift::constraints::ConstraintSystem::solve(swift::Expr
    , llvm::SmallVectorImpl&, swift::FreeTypeVariableBinding) + 52
    19 swift 0x0000000109bc02b8 swift::constraints::ConstraintSystem::solve(swift::Expr&, swift::Type, swift::ExprTypeCheckListener, llvm::SmallVectorImpl&, swift::FreeTypeVariableBinding) + 9240
    20 swift 0x0000000109cb8b02 swift::TypeChecker::typeCheckExpressionImpl(swift::Expr&, swift::DeclContext, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet, swift::ExprTypeCheckListener&, swift::constraints::ConstraintSystem) + 1042
    21 swift 0x0000000109d69c06 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt
    , void, void, void, void>::visit(swift::Stmt) + 20678
    22 swift 0x0000000109d6ada1 bool (anonymous namespace)::StmtChecker::typeCheckStmt(swift::Stmt
    &) + 129
    23 swift 0x0000000109d6a833 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt, void, void, void, void>::visit(swift::Stmt) + 23795
    24 swift 0x0000000109d64ae1 bool (anonymous namespace)::StmtChecker::typeCheckStmt(swift::BraceStmt&) + 129
    25 swift 0x0000000109d645e0 swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl
    , swift::SourceLoc) + 5440
    26 swift 0x0000000109d6c741 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl) + 561
    27 swift 0x0000000109d89222 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) + 2082
    28 swift 0x00000001094868ab swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t)::$_0::operator()(swift::SourceFile&) const + 91
    29 swift 0x0000000109485658 swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 5448
    30 swift 0x000000010917badf performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef, int&, swift::FrontendObserver
    , swift::UnifiedStatsReporter) + 815
    31 swift 0x0000000109177fa4 swift::performFrontend(llvm::ArrayRef, char const
    , void, swift::FrontendObserver) + 6820
    32 swift 0x0000000109105af3 main + 1219
    33 libdyld.dylib 0x00007fff7b0e23d5 start + 1
    make: * [installables] Error 1

@tmspzz @DavidBrunow I clone your repo from https://github.com/Shepherd-Dog/Carthage.git, ran make install and still got the same error. Are there any prerequisite needed for a successful install?

@henrysaintjuste Please see #2831

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Same Issue With Xcode 11.1 (11a1027)
Workaround listed does not work

@pacu, are you seeing The following build commands failed: 卢 Ld /Users and then Task failed with exit code 65?

And, if so, could you file a new issue with at least a subset of your dependencies?

thanks it's open under #2888
I had originally created an issue on swift-grpc thinking there was something wrong on that side. grpc/grpc-swift#604

Was this page helpful?
0 / 5 - 0 ratings