luispadron / UICircularProgressRing

A circular progress bar for iOS written in Swift
MIT License
1.73k stars 291 forks source link

carthage bootstrap builds binary incorrectly #102

Closed vytautasgimbutas closed 6 years ago

vytautasgimbutas commented 6 years ago

Bug Report

Version

2.1.1

Overview of what you tried to do

bootstrap, which checkouts and builds the framework, builds older version of UICircularProgressRing.

$ carthage bootstrap UICircularProgressRing --no-use-binaries --platform iOS                                                                            
*** Checking out UICircularProgressRing at "v2.1.1"
*** xcodebuild output can be found in /var/folders/2r/3q8z6sl96rv3rh9k1c0bb4980000gn/T/carthage-xcodebuild.7nyn0q.log
*** Building scheme "UICircularProgressRing" in Example.xcworkspace

After running this command I can see that the view is missing ringStyle property. However when I ran build the correct binary is built.

$ carthage build UICircularProgressRing --platform iOS                                                                                                   *** xcodebuild output can be found in /var/folders/2r/3q8z6sl96rv3rh9k1c0bb4980000gn/T/carthage-xcodebuild.gLuzpp.log
*** Downloading UICircularProgressRing.framework binary at "Version 2.1.1"

ANSWER HERE

What is the expected outcome?

UICircularProgressRing framework built binary is of latest version. I think

What is the actual outcome?

UICircularProgressRing framework binary is taken from Examples project?

luispadron commented 6 years ago

I thought I had fixed this issue with CocoaPods by moving the actual source into the src folder. Didn’t know this was an issue with Carthage as well.

What exactly does bootstrap do and why not just use the normal Carthage update command with a Cartfile? This will pull the latest built framework from the releases page.

vytautasgimbutas commented 6 years ago

bootstrap = checkout + build. In this case I want to fetch the library's exact version that was specified in Cartfile.resolved and do not try to update it (checkout fetches the version specified in Cartfile.resolved).

btw, i'm having the same issue with update:


$ carthage update UICircularProgressRing --no-use-binaries --platform iOS
*** Fetching CHIPageControl
*** Fetching onepassword-extension
*** Fetching CocoaLumberjack
*** Fetching PhoneNumberKit
*** Fetching BonMot
*** Fetching RxSwift
*** Fetching Presentr
*** Fetching ObjectMapper
*** Fetching sentry-cocoa
*** Fetching Device
*** Fetching Regex
*** Fetching M13Checkbox
*** Fetching Stevia
*** Fetching Swinject
*** Fetching AppVersionMonitor
*** Fetching stripe-ios
*** Fetching OptionalExtensions
*** Fetching PKHUD
*** Fetching Bolts-Swift
*** Fetching SkyFloatingLabelTextField
*** Fetching ActiveLabel.swift
*** Fetching Validator
*** Fetching Siren
*** Fetching Reachability.swift
*** Fetching Alamofire
*** Fetching JWTDecode.swift
*** Fetching SAMKeychain
*** Fetching PromiseKit
*** Fetching SDWebImage
*** Fetching realm-cocoa
*** Fetching TwicketSegmentedControl
*** Fetching swift-lib-accounts-sdk
*** Fetching RevealingSplashView
*** Fetching SwiftDate
*** Fetching UICircularProgressRing
*** Fetching SwifterSwift
*** Fetching Pageboy
*** Fetching Cuckoo
*** Checking out UICircularProgressRing at "v2.1.1"
*** xcodebuild output can be found in /var/folders/2r/3q8z6sl96rv3rh9k1c0bb4980000gn/T/carthage-xcodebuild.gkM2bf.log
*** Building scheme "UICircularProgressRing" in Example.xcworkspace
luispadron commented 6 years ago

I tried with carthage update and it seemed to work just fine

*** Cloning UICircularProgressRing
*** Checking out UICircularProgressRing at "v2.1.1"
*** xcodebuild output can be found in /var/folders/fn/5r8k_dh9359_r7y6xdkn5jr40000gn/T/carthage-xcodebuild.fuA3xG.log
*** Downloading UICircularProgressRing.framework binary at "Version 2.1.1"

However you're right that with bootstrap it doesn't seem to work, what swift version are you on by the way.

vytautasgimbutas commented 6 years ago

4.1.2

try adding --no-use-binaries flag

luispadron commented 6 years ago

Yep you’re right that it builds the example when not using binaries this is due to the fact that Carthage prefers xcworkspaces thus uses the example project to build the library instead of the intended library. It seems like the only fix is to remove the example directory but this isn’t a very good solution.

Is there a reason you can’t use the prebuilt binary?

vytautasgimbutas commented 6 years ago

With swift 4.1.2 we can, but if we want to use swift 4.2 (Xcode10, iOS12) then we have to build it. I think it's really a valid case that someone might want to build the framework from scratch. I would probably just add Pods, Examples.xcworkspace directories to .gitignore. Everyone who wants to run examples will have to run pod install, which is probably a good thing.

luispadron commented 6 years ago

Could you try this now, I removed the example project and instead opted for a playground for the example

luispadron commented 6 years ago

Closing as this is now fixed in 2.1.3

carthage bootstrap UICircularProgressRing --no-use-binaries --platform iOS
*** No Cartfile.resolved found, updating dependencies
*** Fetching UICircularProgressRing
*** Checking out UICircularProgressRing at "v2.1.3"
*** xcodebuild output can be found in /var/folders/fn/5r8k_dh9359_r7y6xdkn5jr40000gn/T/carthage-xcodebuild.18zSOE.log
*** Building scheme "UICircularProgressRing" in UICircularProgressRing.xcodeproj
vytautasgimbutas commented 6 years ago

Awesome! Thanks :)