Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Varying deployment targets, bug in lint? #745

Closed
Cocoanetics opened this Issue · 13 comments

3 participants

@Cocoanetics

I have this DTCoreText spec: https://github.com/CocoaPods/Specs/blob/master/DTCoreText/1.1.0/DTCoreText.podspec

This references two sub spects from DTFoundation:
https://github.com/CocoaPods/Specs/blob/master/DTFoundation/1.0.0/DTFoundation.podspec

Generally all should support 4.3, which is default. But there are two subspects in DTFoundation that require iOS 5.0: DTBonjour and DTDownloadCache.

If I set the global deployment target on DTFoundation to 4.3 or remove it, then it does not lint

Resolving dependencies for target `default' (iOS 4.3)
[!] DTFoundation/DTBonjour (1.0.0) is not compatible with iOS 4.3.

The default target assumes 4.3 and the subspec DTBonjour requires 5.0 and so this fails.

If I set the global deployment target to 5.0 everything lints on DTFoundation, BUT then I get an error linting DTCoreText:

Resolving dependencies for target `default' (iOS 4.3)
[!] DTFoundation (1.0.0) is not compatible with iOS 4.3.

So my question is: is this a bug in lint?

@alloy
Owner

Please try them in a test project to see if the same problem occurs when installing, or if it’s only during linting.

@Cocoanetics

Same result:

pod install
Resolving dependencies of `./Podfile'
Updating spec repositories
Resolving dependencies for target `default' (iOS 4.3)
Downloading dependencies
[!] DTFoundation (1.0.0) is not compatible with iOS 4.3.
@Cocoanetics Cocoanetics referenced this issue in Cocoanetics/DTFoundation
Closed

Create Spec and Subspecs for Cocoapods #18

@fabiopelosin

It is not a bug in the linter. If some modules of DTFoundation require iOS 5.0 then DTFoundation requires iOS 5.0.

platform :ios, '5.0'
pod 'DTFoundation' #=> works
platform :ios, '4.3'
pod 'DTFoundation' #=> doesn't works because DTFoundation depends on DTBonjour and DTDownloadCache which require 5.0
platform :ios, '4.3'
pod 'DTFoundation/Core' #=> works
@Cocoanetics

@irrationalfab So what do you recommend? Move the subspecs that require a lesser version into a separate pod spec?

@Cocoanetics

@irrationalfab Also this setting a lower version for a subspec does not work from inside the DTCoreText spec.

@Cocoanetics

My dilemma is now that having the global version be 5.0 on DTFoundation makes it incompatible with DTCoreText which is 4.3:

Resolving dependencies for target `default' (iOS 4.3)
  - DTCoreText (from `/Users/oliver/Documents/Projects/DTCoreText/DTCoreText.podspec')
    -> Fetching podspec for `DTCoreText' from: /Users/oliver/Documents/Projects/DTCoreText/DTCoreText.podspec
    - DTFoundation/Core (~> 1.0)
    - DTFoundation/DTHMLParser (~> 1.0)
      - DTFoundation/Core

Downloading dependencies
[!] DTFoundation (1.0.0) is not compatible with iOS 4.3.

You can see that it does not try to link the total project, but only two sub-specs.

@fabiopelosin

Sorry, I realized that I missed the point of your issue. I'm investigating it.

@fabiopelosin

This is a bug in CocoaPods (the installer, not in the linter). The resolver correctly detects that the set up would work however the installer checks that DTFoundation/Core is actually compatible. Doing so it also checks the root of every specification (even if not requested) leading to this bug.

I think that this could be easily fixed in 0.16, but it should be fixed in 0.17 which being refactored has a different architecture. Can you leave the deployment target to 5.0 in DTCoreText for a couple of weeks?

$ pod spec lint DTCoreText.podspec --verbose                                                                                                                                             [ruby-2.0.0-rc1]

 -> DTCoreText

DTCoreText (1.1.0) - Analyzing on iOS 4.3 platform.

Resolving dependencies of

Resolving dependencies for target `default' (iOS 4.3)
  - DTCoreText (from `/Users/fabio/Desktop/DTCoreText.podspec')
    -> Fetching podspec for `DTCoreText' from: /Users/fabio/Desktop/DTCoreText.podspec
    - DTFoundation/Core (~> 1.0)
    - DTFoundation/DTHMLParser (~> 1.0)
      - DTFoundation/Core

Downloading dependencies
[!] DTFoundation (1.0.0) is not compatible with iOS 4.3.
@Cocoanetics

Damn, weeks? I think that leaves me with two options:

  • require iOS 5 for people who want to use CocoaPods - who includes is as submodule can go lower
  • or remove the subspecs that need 5.0 and possibly create separate podspecs for them, maybe even move them into separate github repos

Which would be better?

@fabiopelosin

(Un)fortunately 0.17 is huge and we need at least a week to go from the first RC to the proper release.

I think that both of the options that you described would work. However, I don't think that it is a bad idea to move DTBonjour and DTDownloadCache to their own repo because I think that DTFoundation, from its name should not provide such a functionality (this is my just opinion).

@Cocoanetics

@irrationalfab thanks for your support. I'll do option 2 then. More logical, you are right.

@fabiopelosin

All due after so much I've learned from your blog :-)

@fabiopelosin

This should have been fixed in 0.17.

@Abizern Abizern referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@abstractj abstractj referenced this issue from a commit in abstractj/Specs
@Cocoanetics Cocoanetics Set DTCoreText 1.1.0 deployment minimum to 5.0
... because it appears that subspecs cannot have a lower version than the spec, see CocoaPods/CocoaPods#745
1b47327
@kwojtaszek kwojtaszek referenced this issue from a commit in appunite/DTCoreText
@Cocoanetics Cocoanetics Set deployment target to 5.0
... because it appears that subspecs cannot have a lower version than the spec, see CocoaPods/CocoaPods#745
02082d1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.