Cocoapods: Unable to lint a pod that requires modular headers

Created on 25 Apr 2018  ·  22Comments  ·  Source: CocoaPods/CocoaPods

Report

What did you do?

pod lib lint SportsKit.podspec --allow-warnings --verbose --use-libraries

What did you expect to happen?

lint success!!!

What happened instead?

The Swift pod SportsKit depends upon YYImage, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers! globally in your Podfile, or specify :modular_headers => true for particular dependencies.

CocoaPods Environment

ℹ Please replace these two lines with the output of pod env.

Stack

   CocoaPods : 1.5.0
        Ruby : ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
    RubyGems : 2.7.6
        Host : Mac OS X 10.13.4 (17E199)
       Xcode : 9.3 (9E145)
         Git : git version 2.15.1 (Apple Git-101)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories :master - https://github.com/CocoaPods/Specs.git @ 0f66338609cb62a08c18919bbce219fc799dde18

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.2
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.0
cocoapods-try         : 1.1.0

Podfile

platform:ios,'8.0'

inhibit_all_warnings!
use_frameworks!

target "SwiftAndOc" do

pre_install do |installer|
    # workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end

pod 'SportsKit', :path => 'SportsKit.podspec'

end

Project that demonstrates the issue

Demo

All 22 comments

I don't have a podfile when lib lint podspec with --use-libraries,So can't use use_modular_headers! or :modular_headers => true.

Now,What will I push my spec ?

@amorde

@amorde cocoapods1.5.2 has the same problem. how to write the spec?'DEFINES_MODULE' => 'YES' doesn't work for me.

Unfortunately there's not a way around this at this point in time, unless the spec you depend on adds 'DEFINES_MODULE' => 'YES' to their pod_target_xcconfig

Can the pod you're writing not be built as a dynamic framework instead?

Someone needs to add a flag to the lint (& push) commands that will allow enabling modular headers for static libraries

@segiddins what flag need add? how to write it? can you show a example?

Hi , is there any workaround for this issue. I am also facing same error

As @segiddins mentioned, a command line flag needs to be added to tell the linter to use modular headers. It may need to be added to the trunk push command as well.

For an example of adding a new flag to the lint command, checkout this PR: https://github.com/CocoaPods/CocoaPods/pull/7786

If someone wants to take a stab at implementing this please do so, otherwise I can start working on it relatively soon

I'm looking into this, but unfortunately this is a bigger change than I expected

@amorde any update on this? I tried to clone the repo which was causing the issue and added 'DEFINES_MODULE' => 'YES' in the podspec like so,

s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }

The issue is still popping up when I package my pod. Is there any other workaround ?

I've been meaning to add a --use-modular-headers to the pod spec lint command but it's going to take more time than I anticipated. Aside from that I don't have any update for you. @segiddins would know more about this than I do

Yeah, that option just needs to be added to the different lint commands (and pod trunk push)

Made some progress on this, #7959 adds the flag to the lint commands. Once that merges I can add it to pod trunk

@amorde can we add this flag to trunk before we ship 1.6.0.beta.1 (hopefully but no promises next week?)

Yup been meaning to do it, I’m on vacation until Tuesday but will try to get it done before the end of next week

On Aug 3, 2018, at 12:47, D. Koutsogiorgas notifications@github.com wrote:

@amorde can we add this flag to trunk before we ship 1.6.0.beta.1 (hopefully but no promises next week?)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

The issue is still existing @segiddins

I believe this is fixed in the latest beta (1.6.0.beta.2) - @MarcSteven could you try it out with gem install cocoapods --pre?

more specifically, the flag --use-modular-headers was added to the lint and trunk push commands

@amorde Yes it work in pod lib lint , but pod package isn't added. Is there a plant to add it ?

@tanpengsccd sounds like you're referring to https://github.com/CocoaPods/cocoapods-packager, in which case I would check to see if there's a matching issue on that repo

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dawnnnnn picture dawnnnnn  ·  3Comments

Mingmingmew picture Mingmingmew  ·  3Comments

pallaviMN picture pallaviMN  ·  3Comments

soleares picture soleares  ·  3Comments

luhui picture luhui  ·  3Comments