Cocoapods: I need push a repo with lint fail

Created on 1 Sep 2016  ·  17Comments  ·  Source: CocoaPods/CocoaPods

What did you do?

pod trunk push AlipaySDK_No_UTDID_SUN.podspec

What did you expect to happen?

I want publish AlipaySDK_No_UTDID_SUN spec

What happened instead?

  • ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use --verbose for more information.

    CocoaPods Environment

Stack

   CocoaPods : 1.0.1
        Ruby : ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
    RubyGems : 2.6.6
        Host : Mac OS X 10.11.6 (15G31)
       Xcode : 7.3.1 (7D1014)
         Git : git version 2.7.4 (Apple Git-66)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 44439b6b2ef5238c8ec9f763d3679d2352905ace

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.0
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.0.0
cocoapods-try         : 1.0.0

AlipaySDK_No_UTDID_SUN.podspec

English Version:

UTDID (which include UTDeviceclass)is come from ALIBABA. They have many frameworks or static librarys contain it.

AlipaySDK_No_UTDID_SUN.podspec has a dependency UTDID(contain UTDevice class)

But,as many users have add some other frameworks or static librarys whose have include UTDevice class.

So,I need publish it without contain it or set spec.dependency = "UTDID"

中文版本:

UTDID (包含 UTDevice 类)是 阿里系的一个基础库,用于产生唯一设备id。大部分的阿里系SDK依赖该库。

AlipaySDK_No_UTDID_SUN.podspec 需要依赖 UTDID

因为用户可能已经安装了其它的包含 UTDevice 类的库,所以,我们无法设置 spec.dependency = "UTDID"。

现在希望官方添加 在编译失败的情况下也能发布的新功能

Most helpful comment

I regularly do this because linting PromiseKit takes ~40 minutes and CocoaPods doesn't “fail fast”, so otherwise I can waste hours. When I am sure I fixed all issues I simply edit cocoapods-trunk/lib/pod/command/trunk/push.rb and comment out one line:

def run
  update_master_repo
  #validate_podspec
  status, json = push_to_trunk
  update_master_repo

  #…
end

Honestly I agree with the maintainers, this should not be an option. The linting is very thorough and guarantees the index is robust.

“fail-fast” would be nice though.

I usually only resort to this after the second failure as I can't spend all day pushing releases.

All 17 comments

Hey there, this looks like a great example of a question that you should ask on StackOverflow - there is an active tag CocoaPods where people can help out with questions like this. We try to keep the CocoaPods issues focused only on bug reports for the tool, and for upcoming feature requests. Which this doesn't look like.

@orta

I am so sorry.

But this issue is a feature requests.

I need a feature that we can perform pod trunk push without lint.

I found a options --allow-warnings Allows push even if there are lint warnings.

But I need --allow-errors or --no-lint.

Hrm, I don't think we're going to add those features, we don't want to make it possible for people to ship code that doesn't work. It's an anti-pattern for the ecosystem on the whole.

Anyone else got any ideas on how to help?

I don't think we want to make this easy or officially supported, but you can push to trunk via the trunk API instead of the CLI

I also don't want to make it default.But I want have options.

Yeah, I agree with @segiddins - we're not making it easy ( which adding it as a command line flag would make it so ) - the API is available, and documented if you'd like to submit your Podspec via that 👍

I am also feeling the need for this functionality - an option to push to trunk without lint. This is because we are trying to automate the step of publishing to cocoapods as part of our CI pipeline. The linting happens in a separate step without which the publish step will not run. So it's guaranteed that at the time of pushing to trunk, pod spec lint is successful for the spec file.

@segiddins Thanks for mentioning the trunk API, where can I find docs for the same?

Trunk is open source, files relating to the API are here - you also have access to the source for pod trunk push here.

Yes, we ended up patching cocoapods-trunk. Thanks.

@naiquevin hey, can you please explain how you did that? I am tying to push my podspec on the same way with no lint.

Thanks!

I also faced the need to push podspec to private specs repo for which pod lib lint fails. Solved it by hint from http://stackoverflow.com/a/33210884/1971301 to create proper repo structure and copy the podspec manually to ~/.cocoapods/repos/private_repo, and then commit & push the change.

The reason to push failing podspec is the fact that it depends on static lib pods which can't be added directly to podspec because of "transitive dependencies" issue that arises in such case.

Having the same issue as @kambala-decapitator. Need this so I can use a pod with transitive dependencies issue. I agree this should not be the default, but makes usage on this scenario quite difficult.

I regularly do this because linting PromiseKit takes ~40 minutes and CocoaPods doesn't “fail fast”, so otherwise I can waste hours. When I am sure I fixed all issues I simply edit cocoapods-trunk/lib/pod/command/trunk/push.rb and comment out one line:

def run
  update_master_repo
  #validate_podspec
  status, json = push_to_trunk
  update_master_repo

  #…
end

Honestly I agree with the maintainers, this should not be an option. The linting is very thorough and guarantees the index is robust.

“fail-fast” would be nice though.

I usually only resort to this after the second failure as I can't spend all day pushing releases.

This should be fairly easy to add, @mxcl, I might implement --fail-fast myself or make it the default.

It seems you've already been slightly in the codebase it would be nice to get a PR for this.

Also this is a closed issue so we should file a new one. I don't think what you are posting is correct in terms of publishing libraries you know they work for your consumers.

We should not promote such behavior to publish pods without validation.

I don't think what you are posting is correct in terms of publishing libraries you know they work for your consumers.

I agree.

We should not promote such behavior to publish pods without validation.

I agree, but practically sometimes I just have to get on with my day, and well, there's probably other people in my situation so I felt that anyone resourceful enough to find this thread maybe deserved my workaround.

Sorry to keep posting in this closed thread.

I have the same issue with transitive dependencies as @kambala-decapitator: there is no correct way to add static library via CocoaPods and no way to publish podspec with --allow-errors. So people have to invent some scripts and mimic repo structures in private github repository - I feel like it's more dangerous for end users than option in command line tool.. It's like having build system where you cannot skip tests because everybody knows that tests are good 🙂 and should be executed all the time (but in that case you at least have some freedom to comment/ignore them in a code).

Was this page helpful?
0 / 5 - 0 ratings