Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carthage reports incompatible Swift version even for 5.1+ #2887

Closed
michaeleisel opened this issue Oct 8, 2019 · 45 comments
Closed

Carthage reports incompatible Swift version even for 5.1+ #2887

michaeleisel opened this issue Oct 8, 2019 · 45 comments

Comments

@michaeleisel
Copy link

@michaeleisel michaeleisel commented Oct 8, 2019

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

Cartfile

github "michaeleisel/ZippyJSON"

Carthage Output

$ carthage bootstrap
*** No Cartfile.resolved found, updating dependencies
*** Fetching ZippyJSON
*** Fetching JJLISO8601DateFormatter
*** Fetching ZippyJSONCFamily
*** Checking out JJLISO8601DateFormatter at "0.1.2"
*** Checking out ZippyJSON at "0.0.5"
*** Checking out ZippyJSONCFamily at "0.0.2"
*** xcodebuild output can be found in /var/folders/sw/034qgw2d2351s4ljqcj4z_1c0000gn/T/carthage-xcodebuild.PFtSDv.log
*** Downloading JJLISO8601DateFormatter.framework binary at "0.1.2"
*** Downloading ZippyJSONCFamily.framework binary at "0.0.2"
*** Downloading ZippyJSON.framework binary at "0.0.5"
***  Skipped installing ZippyJSON.framework binary due to the error:
	"Incompatible Swift version - framework was built with 5.1 (swiftlang-1100.0.38.29 clang-1100.0.20.14) and the local version is 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7)."

    Falling back to building from the source
*** Skipped building ZippyJSON due to the error:
Dependency "ZippyJSON" has no shared framework schemes

If you believe this to be an error, please file an issue with the maintainers at https://github.com/michaeleisel/ZippyJSON/issues/new

Actual outcome
Carthage reported that one version of 5.1 is incompatible with another

Expected outcome
Carthage should accept any versions of Swift 5.1+ to be compatible, because of module stability

@EmDee
Copy link

@EmDee EmDee commented Nov 5, 2019

I'm getting the same error message with the latest Xcode (11.2, 11B52):

Incompatible Swift version - framework was built with 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7) and the local version is 5.1.2 (swiftlang-1100.0.278 clang-1100.0.33.9).

Are there any known workarounds?

@DavidBrunow
Copy link
Contributor

@DavidBrunow DavidBrunow commented Nov 5, 2019

A workaround would be to install an older version of Xcode on your system that uses Swift 5.1 (I believe Xcode 11.1 would work) and use the command line tools from that version of Xcode instead of the command line tools from Xcode 11.2.

@michaeleisel
Copy link
Author

@michaeleisel michaeleisel commented Nov 5, 2019

It looks like they added some changes a few weeks ago to fix it... they didn’t work?

@jdhealy
Copy link
Member

@jdhealy jdhealy commented Nov 5, 2019

@michaeleisel, those changes are about compiling carthage-the-tool, not invocations that carthage makes.

@DavidBrunow
Copy link
Contributor

@DavidBrunow DavidBrunow commented Nov 5, 2019

I'll try to get a pull request up today or tomorrow to handle module stability properly on the invocations that Carthage makes.

@DavidBrunow
Copy link
Contributor

@DavidBrunow DavidBrunow commented Nov 5, 2019

Here is that pull request: #2902

@cornr
Copy link

@cornr cornr commented Nov 8, 2019

Same error here after updating to Xcode 11.2.1 with aws-sdk-ios (build with Xcode 11.2 and Swift Compiler 5.1).
Looking forward to this fix. It takes ages to build aws-sdk-ios from scratch

@gilroykilroy
Copy link

@gilroykilroy gilroykilroy commented Feb 18, 2020

Any idea when this will be fixed? It is causing more impact with the latest Xcode (11.3.1)

@tmspzz
Copy link
Member

@tmspzz tmspzz commented Feb 18, 2020

It should be already fixed on master

@irilattada
Copy link

@irilattada irilattada commented Feb 19, 2020

I have same problem on Carthage version 0.34.0
Xcode 11.3.1

any ideas how to solve it? I've tried removing ~/Library/Caches/org.carthage.CarthageKit but still not working

Incompatible Swift version - framework was built with 5.1

@DavidBrunow
Copy link
Contributor

@DavidBrunow DavidBrunow commented Feb 19, 2020

While the fix has been merged to master a new release has not been created. To use the latest Carthage with this fix (and others) you would need to build from master at this point.

@cornr
Copy link

@cornr cornr commented Feb 19, 2020

@DavidBrunow good to hear and thanks for your work. This probably causes million of build time minutes around the planet. for example we are using https://github.com/aws-amplify/aws-sdk-ios which takes about 45 mins to build. So I guess a new release would be awesome for the climate :)
I hope a new release is coming soon.

@irilattada
Copy link

@irilattada irilattada commented Feb 20, 2020

Thank you David, it worked

git clone https://github.com/Carthage/Carthage.git master
make install
carthage update --platform iOS --no-use-binaries

@mavinion
Copy link

@mavinion mavinion commented Apr 2, 2020

While the fix has been merged to master a new release has not been created. To use the latest Carthage with this fix (and others) you would need to build from master at this point.

Still no new release build....

@artemmelnyk
Copy link

@artemmelnyk artemmelnyk commented Apr 2, 2020

Same problem
Incompatible Swift version - framework was built with 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7) and the local version is 5.2 (swiftlang-1103.0.32.1 clang-1103.0.32.29).

@michaeleisel
Copy link
Author

@michaeleisel michaeleisel commented Apr 2, 2020

What are the blockers on doing a new release? Who owns that?

@sam-w
Copy link

@sam-w sam-w commented Apr 14, 2020

@DavidBrunow any chance of a release soon? :)

@g-enius
Copy link

@g-enius g-enius commented Apr 15, 2020

still getting "Incompatible Swift version - framework was built with 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15) and the local version is 5.2 (swiftlang-1103.0.32.1 clang-1103.0.32.29).
"

any chance it would be resolved soon?

@DavidBrunow
Copy link
Contributor

@DavidBrunow DavidBrunow commented Apr 15, 2020

@DavidBrunow any chance of a release soon? :)

Unfortunately I'm not the person that can make that decision but I'm doing what I can to move things forward.

@itndehuiP
Copy link

@itndehuiP itndehuiP commented May 22, 2020

I had a problem for compile my project in latest Xcode versions because of Realm framework integrated with Carthage, Emre Gürses answer in next post solved my problem.
This worked for me: https://stackoverflow.com/questions/46726077/module-compiled-with-swift-4-0-cannot-be-imported-in-swift-4-0-1

@mpahuja
Copy link

@mpahuja mpahuja commented Jun 2, 2020

+1 on getting this into a release.

@isaacmendez
Copy link

@isaacmendez isaacmendez commented Jun 3, 2020

I am unable to compile the aws-ios-sdk due to the same error on the CI side as it takes over an hour which times out even 'elite' machines with Bitrise.
Skipped installing aws-sdk-ios.framework binary due to the error: "Incompatible Swift version - framework was built with 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51) and the local version is 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)." Falling back to building from the source

@ensighten-ekolinko
Copy link

@ensighten-ekolinko ensighten-ekolinko commented Jun 3, 2020

+1 for getting this resolved as well. My team works on an SDK for Swift that is deployed through Carthage and we're currently forced to build and release a version-specific version every time a new version of Swift is available. As Xcode has almost monthly releases, we have to constantly release new versions to keep up with Xcode releases due to this issue.

peteranny pushed a commit to peteranny/Carthage that referenced this issue Jun 16, 2020
@sam-w
Copy link

@sam-w sam-w commented Jun 22, 2020

@DavidBrunow @jdhealy thanks for your work getting this fixed, merged and released! My project is working with v0.35.0

@tmspzz
Copy link
Member

@tmspzz tmspzz commented Jun 22, 2020

Closing. Released in 0.35.0

@tmspzz tmspzz closed this Jun 22, 2020
@greenrobot
Copy link

@greenrobot greenrobot commented Jun 30, 2020

Using the released 0.35.0 I'm getting this error log now:

Detected Carthage version 0.35.0
 
*** Downloading binary-only framework ObjectBox at "https://raw.githubusercontent.com/objectbox/objectbox-swift/master/cartspec/ObjectBox.json"
[...]
 *** Downloading ObjectBox.framework binary at "1.3.1"
 
Incompatible Swift version - framework was built with 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53) and the local version is 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51).

Did the fix not address this issue?

@monolithic-adam
Copy link

@monolithic-adam monolithic-adam commented Jun 30, 2020

I am still getting this error as well on 0.35.0

@EmDee
Copy link

@EmDee EmDee commented Jun 30, 2020

@greenrobot It seems your issue is a different one. Your framework was built with a newer version of Swift. AFAIK module stability only guarantees forward-compatibility, not backwards-compatibility, which makes sense, otherwise the Swift would not be able to add new features anymore.

@greenrobot
Copy link

@greenrobot greenrobot commented Jun 30, 2020

@EmDee I'd be surprised if Apple would break contracts in patch version updates. Is this officially documented? I had a quick look, but didn't find anything.

@EmDee
Copy link

@EmDee EmDee commented Jun 30, 2020

@greenrobot I'm sure it's documented somewhere, but a quick search only gave me the discussion by Jordan Rose (which is rather official) regarding the forward-compatibility: https://forums.swift.org/t/plan-for-module-stability/14551.

Having said that, when I'm looking at the changes implemented by @DavidBrunow, Carthage should only be checking for both Swift versions being >= 5.1 and including an interface file: https://github.com/Carthage/Carthage/blob/master/Source/CarthageKit/Xcode.swift#L157. So maybe your framework is missing that build flag?

@greenrobot
Copy link

@greenrobot greenrobot commented Jun 30, 2020

@EmDee Good find! Quite possible that the framework is missing something. If it is, the error message might be considered somewhat misleading. It be nice if it would have a separate error message in that case?

@greenrobot
Copy link

@greenrobot greenrobot commented Jun 30, 2020

The framework zip actually comes with a couple of .swiftinterface files. E.g. here: Carthage/Build/iOS/ObjectBox.framework/Modules/ObjectBox.swiftmodule/arm64-apple-ios.swiftinterface

Is this ignored?

Separating those cases for which you referenced the code to better identify the reason would really be helpful.

@EmDee
Copy link

@EmDee EmDee commented Jun 30, 2020

Unfortunately I can’t answer your question if the file is being ignored or if it even is the correct file or not, without taking a deep dive here.

However, I agree with you that the error message could be more precise here. I’m sure the maintainers would be more than happy over a pull request.

@nikolaitarasov
Copy link

@nikolaitarasov nikolaitarasov commented Jul 29, 2020

I also have this issue on 0.35.0 and Xcode 12 beta 3.

@nguyenminhkhmt
Copy link

@nguyenminhkhmt nguyenminhkhmt commented Sep 9, 2020

I got the same issue on 0.35.0 and XCode 12 beta, pls help to fix. thx

@Ku6ep
Copy link

@Ku6ep Ku6ep commented Sep 28, 2020

Some problem with Xcode 12.0.1
Need help.

@mohamadrezakoohkan
Copy link

@mohamadrezakoohkan mohamadrezakoohkan commented Oct 1, 2020

Same on Xcode 12.0.1 with Swift 5.3 on RxSwift which built with Swift 5.2.2

@muhasturk
Copy link

@muhasturk muhasturk commented Dec 18, 2020

Please reopen this issue until stable release has been released. Issue still there.

@marcusziade
Copy link

@marcusziade marcusziade commented Jan 23, 2021

Getting this error when trying to carthage bootstrap --platform ios the kickstarter OSS iOS project

"Incompatible Swift version - framework was built with 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7) and the local version is 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)."

Xcode 12.3. macOS Catalina

@drinkius
Copy link

@drinkius drinkius commented Jun 2, 2021

Same issue with RxSwift installation:

"Incompatible Swift version - framework was built with 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5) and the local version is 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)."

Xcode 12.5, Big Sur

@Bruce9487
Copy link

@Bruce9487 Bruce9487 commented Jul 29, 2021

Incompatible Swift version - framework was built with 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53) and the local version is 5.4.2 (swiftlang-1205.0.28.2 clang-1205.0.19.57)

Xcode 12.5.1
macOS Big Sur 11.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests