RxSwift: Build error 65 with Xcode 10.2 (Swift 5)

Short description of the issue:

RxSwift 4.4.2 fails to build with:

  • Xcode 10.2 (10E125)
  • Carthage 0.32.0
  • iOS platform

Expected outcome:

RxSwift builds.

What actually happens:

carthage update RxSwift --platform iOS --no-use-binaries

Console output:

*** Fetching RxSwift
*** Checking out RxSwift at "4.4.2"
*** xcodebuild output can be found in /var/folders/3s/n9cx3jx57ms9pcrn7yc14sl00000gn/T/carthage-xcodebuild.2K3DkT.log
*** Building scheme "RxAtomic" in Rx.xcworkspace
*** Building scheme "RxCocoa" in Rx.xcworkspace
Build Failed
    Task failed with exit code 65:
    /usr/bin/xcrun xcodebuild -workspace .../Carthage/Checkouts/RxSwift/Rx.xcworkspace -scheme RxCocoa -configuration Release -derivedDataPath .../Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/RxSwift/4.4.2 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/3s/n9cx3jx57ms9pcrn7yc14sl00000gn/T/RxSwift SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in .../Carthage/Checkouts/RxSwift)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/3s/n9cx3jx57ms9pcrn7yc14sl00000gn/T/carthage-xcodebuild.2K3DkT.log

Log file contents:

...

Linting Swift files in current working directory
Linting 'Cancelable.swift' (1/283)
Could not cast value of type 'Swift.Int64' (0x1032abf80) to 'Swift.String' (0x1032b24d8).
.../Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/RxSwift/4.4.2/Build/Intermediates.noindex/ArchiveIntermediates/RxCocoa/IntermediateBuildFilesPath/Rx.build/Release-iphoneos/RxSwift.build/Script-A21F589121E109AD0051AEA2.sh: line 6: 72924 Abort trap: 6           swiftlint
Command PhaseScriptExecution failed with a nonzero exit code

Ditto .../Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/RxSwift/4.4.2/Build/Intermediates.noindex/ArchiveIntermediates/RxCocoa/IntermediateBuildFilesPath/Rx.build/Release-iphoneos/RxSwift.build/module.modulemap .../Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/RxSwift/4.4.2/Build/Intermediates.noindex/ArchiveIntermediates/RxCocoa/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/RxSwift.framework/Modules/module.modulemap (in target: RxSwift)
    cd .../Carthage/Checkouts/RxSwift
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks .../Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/RxSwift/4.4.2/Build/Intermediates.noindex/ArchiveIntermediates/RxCocoa/IntermediateBuildFilesPath/Rx.build/Release-iphoneos/RxSwift.build/module.modulemap .../Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/RxSwift/4.4.2/Build/Intermediates.noindex/ArchiveIntermediates/RxCocoa/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/RxSwift.framework/Modules

** ARCHIVE FAILED **


The following build commands failed:
        PhaseScriptExecution SwiftLint .../Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/RxSwift/4.4.2/Build/Intermediates.noindex/ArchiveIntermediates/RxCocoa/IntermediateBuildFilesPath/Rx.build/Release-iphoneos/RxSwift.build/Script-A21F589121E109AD0051AEA2.sh
(1 failure)

Self contained code example that reproduces the issue:

// No Swift code needed.  Just try to build RxSwift after upgrading Xcode to 10.2

RxSwift/RxCocoa/RxBlocking/RxTest version/commit

4.4.2

Platform/Environment

  • iOS
  • macOS
  • tvOS
  • watchOS
  • playgrounds

How easy is to reproduce? (chances of successful reproduce after running the self contained code)

  • easy, 100% repro
  • sometimes, 10%-100%
  • hard, 2% - 10%
  • extremely hard, %0 - 2%

Xcode version:

10.2 (10E125)

Installation method:

  • CocoaPods
  • Carthage
  • Git submodules

I have multiple versions of Xcode installed:

  • yes (which ones)
  • no

Level of RxSwift knowledge:

  • just starting
  • I have a small code base
  • I have a significant code base

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 4
  • Comments: 37 (29 by maintainers)

Commits related to this issue

Most upvoted comments

Still not an RxSwift bug … this is on Apple’s side as far as we can understand.

As always, appreciate your help 🙏🙏

Yeah @freak4pc 😃) I’ve noticed that, was just curious about the issue and want to drop this as an option to you guys maybe consider in a discussion moving forward 👍

Hey, we actually already dropped RxAtomic in favor of AtomicInc (with RecursiveLock). I think kruno spent too much time chasing down TSAN oddities so it made sense to stop fiddling with it:)

As you mention before: “Fun times” 😆

Hey, we actually already dropped RxAtomic in favor of AtomicInc (with RecursiveLock). I think kruno spent too much time chasing down TSAN oddities so it made sense to stop fiddling with it:)

Oh,

Linking against a static Swift library might create a binary with missing type metadata because the object files that define the metadata inside the static archive are mistakenly considered unused. (47598583)

This can manifest as a Swift runtime error with a message such as: “failed to demangle superclass of MyClass from mangled name ‘<mangled name>’”.

Workaround: If you can rebuild the static library, try building it with whole module optimization enabled. Otherwise, add -all_load to the linker flags in the client binary to ensure all object files are linked into it.

WTF, how the hell do they decide to release with these kinds of bugs. This is insane. In any case, this is on CocoaPods to solve IMHO.

develop branch builds and runs fine for me for iOS