ReSwift/ReSwift-Thunk

Can't pass Xcode 12.5.1 build

funsiyuan opened this issue ยท 7 comments

@DivineDominion @mjarvis

Hi ๐Ÿ˜„

I'm using Xcode 12.5.1 to build carthage, but it doesn't look like it's working.
On the failure log it says something like this:

image

MyProject/Carthage/Checkouts/ReSwift-Thunk/ReSwift-Thunk/createThunkMiddleware.swift:10:8: 
error: module compiled with Swift 5.3.1 cannot be imported by the Swift 5.4.2 compiler: 

/Users/username/my-project/Carthage/Checkouts/
ReSwift-Thunk/Carthage/Build/iOS/ReSwift.framework/
Modules/ReSwift.swiftmodule/arm64-apple-ios.swiftmodule

I'm pretty sure that I used the correct xcode-version to build this.

Can you guys please help with this issue.

By the way i'm using this version of ReSwift&Thunk.

github "ReSwift/ReSwift" "6.1.0"
github "ReSwift/ReSwift-Thunk" "2.0.1"

looks like you're using cached build or binary downloads -- either way, a module sneaked in with the wrong Swift version.

Try

carthage build

The actual ReSwift version doesn't matter because you should be able to compile more or less any version with any Swift compiler. So this is a tooling problem. Am closing the issue becuase it's not ReSwift-Thunk's fault, but we can continue trying to figure this out nevertheless

Hi, @DivineDominion .

Thank you for your reply.
I have tried the following two command without success. Does this have something to do with xcframeworks?

carthage bootstrap --use-xcframeworks --platform iOS --cache-builds

carthage bootstrap --use-xcframeworks --platform iOS --no-use-binaries

I will try using carthage build --use-xcframeworks to see what happens.

Sadly, the same thing happened again.

Try this to check your setup:

$ git clone git@github.com:ReSwift/ReSwift-Thunk.git
$ cd ReSwift-Thunk

$ carthage update --use-xcframeworks
# just to invalidate your Carthage caches and fetch the latest stuff

$ carthage build --no-ski-current --use-xcframeworks
*** xcodebuild output can be found in /var/folders/62/8k21681d08z9lhq8h433z3rh0000gp/T/carthage-xcodebuild.BXRhoe.log
*** Building scheme "ReSwift-watchOS" in ReSwift.xcworkspace
*** Building scheme "ReSwift-macOS" in ReSwift.xcworkspace
*** Building scheme "ReSwift-iOS" in ReSwift.xcworkspace
*** Building scheme "ReSwift-tvOS" in ReSwift.xcworkspace
*** Building scheme "ReSwift-Thunk tvOS" in ReSwift-Thunk.xcodeproj
*** Building scheme "ReSwift-Thunk macOS" in ReSwift-Thunk.xcodeproj
*** Building scheme "ReSwift-Thunk watchOS" in ReSwift-Thunk.xcodeproj
*** Building scheme "ReSwift-Thunk iOS" in ReSwift-Thunk.xcodeproj

The --no-skip-current builds ReSwift-Thunk right there (even though it's not a dependency)

$ mkdir test
$ cd test
$ cat Cartfile
github "ReSwift/ReSwift" "6.1.0"
github "ReSwift/ReSwift-Thunk" "2.0.1"

$ carthage bootstrap --use-xcframeworks

Output:

*** No Cartfile.resolved found, updating dependencies
*** Cloning ReSwift-Thunk
*** Fetching ReSwift
*** Checking out ReSwift at "6.1.0"
*** Checking out ReSwift-Thunk at "2.0.1"
*** xcodebuild output can be found in /var/folders/62/8k21681d08z9lhq8h433z3rh0000gp/T/carthage-xcodebuild.ZtVm2q.log
*** Downloading ReSwift binary at "6.1.0"
*** Downloading ReSwift-Thunk binary at "Fix Carthage Build Errors"
***  Skipped installing ReSwift binary due to the error:
	"Incompatible Swift version - framework was built with 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55) and the local version is 5.5.1 (swiftlang-1300.0.31.4 clang-1300.0.29.6)."

    Falling back to building from the source
***  Skipped installing ReSwift-Thunk binary due to the error:
	"Incompatible Swift version - framework was built with 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1) and the local version is 5.5.1 (swiftlang-1300.0.31.4 clang-1300.0.29.6)."

    Falling back to building from the source
*** Building scheme "ReSwift-tvOS" in ReSwift.xcworkspace
*** Building scheme "ReSwift-watchOS" in ReSwift.xcworkspace
*** Building scheme "ReSwift-iOS" in ReSwift.xcworkspace
*** Building scheme "ReSwift-macOS" in ReSwift.xcworkspace
*** Building scheme "ReSwift-Thunk macOS" in ReSwift-Thunk.xcodeproj
*** Building scheme "ReSwift-Thunk tvOS" in ReSwift-Thunk.xcodeproj
*** Building scheme "ReSwift-Thunk iOS" in ReSwift-Thunk.xcodeproj
*** Building scheme "ReSwift-Thunk watchOS" in ReSwift-Thunk.xcodeproj

Can't test with Xcode 12 because that doesn't work on M1 Monterey anymore

@DivineDominion
Thank you so muck.

I succeeded in getting ReSwift-Thunk to compile and pass.
but now I'm stuck on RxGesture with this message.


*** Building scheme "RxGesture-OSX" in RxGesture.xcodeproj
Build Failed
	Task failed with exit code 65:

# error log:
note: Using new build system
note: Building targets in parallel
note: Using codesigning identity override: 
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
error: There is no XCFramework found at '/Users/username/Project/Carthage/Checkouts/RxGesture/Carthage/Build/RxCocoa.xcframework'. (in target 'RxGesture-OSX' from project 'RxGesture')

This is strange, because I have successfully compiled RxSwift, which should contain RxCocoa.
But this should be a matter for another library. I'll ask them about it sometime.

Thank you again :)