grab / cocoapods-binary-cache

MIT License
478 stars 69 forks source link

Prebuild with specified targets fails to build properly for new Swift version #78

Closed SrikanthKabadi closed 3 years ago

SrikanthKabadi commented 3 years ago

Checklist

Issue Description

Command executed

pod binary prebuild --push my-branch-name --targets=BadgeSwift

What went wrong?

I had BadgeSwift pod of version 8.0.0 prebuilt with Xcode 12.4 & Swift version 5.3.1. It was working fine till date. Now, I tried building my app with Xcode 12.5, it started showing compile-time error saying BadgeSwift is built with Swift 5.3.1 and is not compatible with Swift 5.4. So I used the pod binary prebuild --push my-branch-name --targets=BadgeSwift command to rebuild the pod but unfortunately Xcode 12.5 continued to show the same error.

I solved it by:

  1. Updated the BadgeSwift pod version to 8.0.2 from 8.0.0. Since there was a version mismatch, it missed the cache validation and rebuilt the binary and started working fine with Xcode 12.5 as well.
  2. Commented the BadgeSwift dependency in Podfile, ran pod install, uncommented BadgeSwift dependency in Podfile and ran pod binary prebuild --push my-branch-name --targets=BadgeSwift.

I expected it to rebuild with the proper Swift version without doing above mentioned steps. I had around 12 dependencies for which I had to do similar steps. It was very troublesome.

Environment

Plugin version

1. Used the 14 days back commitID: `d366f1084c55b0a0533edaebc3e337194c783868` as a source in my gem file.
2. Cocoapods version - `1.10.0`
trinhngocthuyen commented 3 years ago

Hey @SrikanthKabadi, by default, this plugin does not validate changes in swift version.

In your particular case, I suggest redeploying all the cache with Xcode 12.5. Remember to use option --all in the prebuild command.

Some alternatives: 1/ Enable library evolution when prebuilding frameworks. 2/ Using the validate_prebuilt_settings option.