RxSwift icon indicating copy to clipboard operation
RxSwift copied to clipboard

RxTest fails to build in Xcode 7.3-beta2

Open koke opened this issue 10 years ago • 22 comments

Running the test suite (or using the RxTest pod) throws a couple build errors when using Xcode 7.3 beta 2

XCTest+Rx.swift:67:7: Cannot invoke 'XCTAssertEqual' with an argument list of type '([AnyEquatable<Event>], [AnyEquatable<Event>], file: String, line: Uint)' XCTest+Rx.swift:95:7: Cannot invoke 'XCTAssertEqual' with an argument list of type '([AnyEquatable<Recorded<Event>>], [AnyEquatable<Recorded<Event>>], file: String, line: Uint)'

It seems the file parameter on XCTAssertEqual changed from String to StaticString in https://github.com/apple/swift/pull/888

koke avatar Feb 04 '16 15:02 koke

I got a fix in https://github.com/ReactiveX/RxSwift/commit/60b4b965092c372edce7b18ed67f863d3a7a3e8b, but that breaks the builds on Xcode 7.2. I'm not sure if there's a workaround or this will have to be a new release that supports Swift 2.2 only.

koke avatar Feb 04 '16 15:02 koke

Hi @koke ,

Thnx for reporting this. I'm hoping this is just an Apple but and they will fix this soon :(.

I'm not sure it would be a good idea to pull this in immediately since it you are telling me this will break on Xcode 7.2, and this is the released version. Let's monitor this and see what will Apple do here.

If they release a version that requires StaticString, then we'll make the same breaking change.

kzaher avatar Feb 04 '16 20:02 kzaher

Hi @koke and @kzaher,

How can I use 60b4b96 with Carthage? Is it in a branch? If not, could we create a branch called, for example, Xcode7.3?

Bogidon avatar Feb 16 '16 14:02 Bogidon

Hi @Bogidon ,

I've created new branch xcode/7.3 If @koke makes PR to that branch, I would be happy to merge it.

kzaher avatar Feb 16 '16 22:02 kzaher

@kzaher the xcode/7.3 branch gets further into the build process when using Carthage (sorry, forgot to specify this), but still fails:

/Users/.../RxSwift/RxSwift/DataStructures/Queue.swift:165:16: warning: 'anyGenerator' is deprecated: renamed to 'AnyGenerator'
/Users/.../RxSwift/RxSwift/DataStructures/InfiniteSequence.swift:26:16: warning: 'anyGenerator' is deprecated: renamed to 'AnyGenerator'
<unknown>:0: error: unable to execute command: Segmentation fault: 11
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
A shell task failed with exit code 65:
** BUILD FAILED **

tomburns avatar Feb 17 '16 20:02 tomburns

¯_(ツ)_/¯

I've tried to support Xcode 7.3, but since even released 7.2.1 version still has horribly buggy compiler, it's pointless at this stage.

I'm waiting until they make transition from catastrophically unstable compiler to just the usually horrible one (when they release it) :)

Try building just Debug configuration. I believe Xcode compiler just fails when it tries to optimize the code.

kzaher avatar Feb 17 '16 21:02 kzaher

Interesting @kzaher. I was getting the same error as @tomburns.

Let's 🙏 they fix it before release. Should we file a rdar?

Bogidon avatar Feb 18 '16 01:02 Bogidon

@Bogidon if you guys can file a radar, that would be :+1:

kzaher avatar Feb 18 '16 11:02 kzaher

Seems like this is still an issue after today's release

stephenvisser avatar Mar 22 '16 02:03 stephenvisser

XCTAssertEqual(leftEquatable, rightEquatable, file: file, line: line)

Cannot invoke 'XCTAssertEqual' with an argument list of type '([AnyEquatable<Event>], [AnyEquatable<Event>], file: String, line: UInt)'

ibadcool avatar Mar 22 '16 09:03 ibadcool

It still fails to build for me, but for a different reason: Reason: Project /Carthage/Checkouts/RxSwift/RxTests/RxTests.xcodeproj cannot be opened because it is missing its project.pbxproj file.

If I try to open the project by hand, and it complains about the same issue.

If it matters, I run carthage update --platform iOS

alexpopov avatar Mar 23 '16 17:03 alexpopov

Hi guys,

I'm little confused here. I've ran the integration tests on my machine and both CocoaPods and Carthage integrations were ok.

Are you sure you've got the correct version of Xcode selected for Command Line Tools? screen shot 2016-03-23 at 22 51 21

kzaher avatar Mar 23 '16 21:03 kzaher

I do. I tried clearing the Carthage cache as well. If I run xcodebuild -version from the command line I also get Xcode 7.3 Build version 7D175 So I'm at a loss as to what to do.

alexpopov avatar Mar 23 '16 21:03 alexpopov

... and just to be clear, you've removed both ~/Library/Caches/org.carthage.CarthageKit/ and Carthage directories?

kzaher avatar Mar 23 '16 22:03 kzaher

Just to be clear... no. I removed the latter first and the build failed. Then I removed the former, and the build failed. Removing both at once did the trick! Thanks a bunch! I guess this is the solution, at least for my particular issue.

alexpopov avatar Mar 23 '16 22:03 alexpopov

Ok, glad this was a simple solution :) Weird, but simple :)

kzaher avatar Mar 23 '16 22:03 kzaher

I still get the same error:

Cannot invoke 'XCTAssertEqual' with an argument list of type '([AnyEquatable<Event>], [AnyEquatable<Event>], file: String, line: UInt)'

with XCode 7.3 this is my pod file:

pod 'RealmSwift', :git => 'https://github.com/realm/realm-cocoa.git', :branch => 'swift-2.0' pod 'RxSwift', '~> 2.2' pod 'RxCocoa', '~> 2.0' pod 'RxBlocking', '~> 2.0' pod 'CocoaLumberjack/Swift' pod 'SWXMLHash', '~> 2.1.0' pod 'Moya' pod 'Moya/RxSwift' pod 'Moya-ObjectMapper/RxSwift', '~> 1.1.6' pod 'VBFPopFlatButton'

target 'TrollTests', :exclusive => true do pod 'RxTests', '~> 2.0' pod 'Quick', '~> 0.9.0' pod 'Nimble', '~> 3.2.0' pod 'Dip' end

i tried updating to RxSwift latest version 2.3.1 but got this error upon pod install: [!] Unable to satisfy the following requirements:

  • RxSwift (~> 2.3.1) required by Podfile
  • RxSwift (~> 2.2) required by RxCocoa (2.2.0)
  • RxSwift (~> 2.2) required by RxBlocking (2.2.0)
  • RxSwift (~> 2.0) required by Moya/RxSwift (6.2.0)
  • RxSwift (~> 2.2.0) required by Moya-ObjectMapper/RxSwift (1.1.7)
  • RxSwift (~> 2.2) required by RxTests (2.2.0)

i also tried not specifying version numbers in PodFile with no success

idanhaviv avatar Mar 27 '16 08:03 idanhaviv

Your Podfile lists RxSwift at 2.2 but RxCocoa at 2.0. You need all versions to be the same (for RxTests as well).

fpillet avatar Mar 27 '16 09:03 fpillet

i changed all to 2.0 but still get the same error

idanhaviv avatar Mar 27 '16 09:03 idanhaviv

You need to use 2.3.1 with Xcode 7.3 and Swift 2.2. Previous versions of RxSwift won't compile correctly.

fpillet avatar Mar 27 '16 09:03 fpillet