Cocoapods: Pod spec lint fails but pod lib lint passes

Created on 27 Feb 2016  路  4Comments  路  Source: CocoaPods/CocoaPods

馃寛

Report

What did you do?

Run pod spec lint

What did you expected to happen?

KSCrash passed validation.

What happened instead?

-> KSCrash (1.0.2) - ERROR | [KSCrash/Recording/Advanced] file patterns: Thepublic_header_filespattern did not match any file.

Podfile

Pod::Spec.new do |s|
  IOS_DEPLOYMENT_TARGET = '6.0' unless defined? IOS_DEPLOYMENT_TARGET
  s.name         = "KSCrash"
  s.version      = "1.0.2"
  s.summary      = "The Ultimate iOS Crash Reporter"
  s.homepage     = "https://github.com/kstenerud/KSCrash"
  s.license     = { :type => 'KSCrash license agreement', :file => 'LICENSE' }
  s.author       = { "Karl Stenerud" => "[email protected]" }
  s.ios.deployment_target =  IOS_DEPLOYMENT_TARGET
  s.osx.deployment_target =  '10.8'
  s.source       = { :git => "https://github.com/kstenerud/KSCrash.git", :tag=>s.version.to_s }
  s.frameworks = 'Foundation'
  s.libraries = 'c++', 'z'
  s.xcconfig = { 'GCC_ENABLE_CPP_EXCEPTIONS' => 'YES' }

  s.subspec 'no-arc' do |sp|
    sp.source_files = 'Source/KSCrash/Recording/**/KSZombie.{h,m}'
    sp.requires_arc = false
  end

  s.subspec 'Recording' do |recording|
    recording.dependency 'KSCrash/no-arc'
    recording.source_files   = 'Source/KSCrash/Recording/**/*.{h,m,mm,c,cpp}',
                               'Source/KSCrash/llvm/**/*.{h,m,mm,c,cpp}',
                               'Source/KSCrash/swift/**/*.{h,m,mm,c,cpp}',
                               'Source/KSCrash/Reporting/Filters/KSCrashReportFilter.h'
    recording.exclude_files = 'Source/KSCrash/Recording/**/KSZombie.{h,m}'
    recording.public_header_files = 'Source/KSCrash/Recording/KSCrash.h',
                                    'Source/KSCrash/Recording/KSCrashC.h',
                                    'Source/KSCrash/Recording/KSCrashContext.h',
                                    'Source/KSCrash/Recording/KSCrashReportWriter.h',
                                    'Source/KSCrash/Recording/KSCrashState.h',
                                    'Source/KSCrash/Recording/KSCrashType.h',
                                    'Source/KSCrash/Recording/Sentry/KSCrashSentry.h',
                                    'Source/KSCrash/Recording/Tools/KSArchSpecific.h',
                                    'Source/KSCrash/Recording/Tools/KSJSONCodecObjC.h',
                                    'Source/KSCrash/Recording/Tools/NSError+SimpleConstructor.h'

    recording.subspec 'Advanced' do |advanced|
      advanced.public_header_files = 'Source/KSCrash/Recording/KSCrashAdvanced.h',
                                     'Source/KSCrash/Recording/KSCrashDoctor.h',
                                     'Source/KSCrash/Recording/KSCrashReportFields.h',
                                     'Source/KSCrash/Recording/KSCrashReportStore.h',
                                     'Source/KSCrash/Recording/KSSystemInfo.h',
                                     'Source/KSCrash/Recording/KSSystemInfoC.h'
    end

    recording.subspec 'Tools' do |tools|
      tools.public_header_files = 'Source/KSCrash/Recording/Tools/**/*.h'
    end

  end

  s.subspec 'Reporting' do |reporting|
    reporting.dependency 'KSCrash/Recording'

    reporting.subspec 'Filters' do |filters|
      filters.subspec 'Base' do |base|
        base.source_files = 'Source/KSCrash/Reporting/Filters/Tools/**/*.{h,m,mm,c,cpp}',
                            'Source/KSCrash/Reporting/Filters/KSCrashReportFilter.h',
                            'Source/KSCrash/Reporting/Filters/KSCrashReportFilter.m'
        base.public_header_files = 'Source/KSCrash/Reporting/Filters/KSCrashReportFilter.h'
      end

      filters.subspec 'Alert' do |alert|
        alert.dependency 'KSCrash/Reporting/Filters/Base'
        alert.source_files = 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterAlert.h',
                             'Source/KSCrash/Reporting/Filters/KSCrashReportFilterAlert.m'
      end

      filters.subspec 'AppleFmt' do |applefmt|
        applefmt.dependency 'KSCrash/Reporting/Filters/Base'
        applefmt.source_files = 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterAppleFmt.h',
                             'Source/KSCrash/Reporting/Filters/KSCrashReportFilterAppleFmt.m'
      end

      filters.subspec 'Basic' do |basic|
        basic.dependency 'KSCrash/Reporting/Filters/Base'
        basic.source_files = 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterBasic.h',
                             'Source/KSCrash/Reporting/Filters/KSCrashReportFilterBasic.m'
      end

      filters.subspec 'GZip' do |gzip|
        gzip.dependency 'KSCrash/Reporting/Filters/Base'
        gzip.source_files = 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterGZip.h',
                            'Source/KSCrash/Reporting/Filters/KSCrashReportFilterGZip.m'
      end

      filters.subspec 'JSON' do |json|
        json.dependency 'KSCrash/Reporting/Filters/Base'
        json.source_files = 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterJSON.h',
                            'Source/KSCrash/Reporting/Filters/KSCrashReportFilterJSON.m'
      end

      filters.subspec 'Sets' do |sets|
        sets.dependency 'KSCrash/Reporting/Filters/Base'
        sets.dependency 'KSCrash/Reporting/Filters/AppleFmt'
        sets.dependency 'KSCrash/Reporting/Filters/Basic'
        sets.dependency 'KSCrash/Reporting/Filters/GZip'
        sets.dependency 'KSCrash/Reporting/Filters/JSON'

        sets.source_files = 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterSets.h',
                            'Source/KSCrash/Reporting/Filters/KSCrashReportFilterSets.m'
      end

      filters.subspec 'Tools' do |tools|
        tools.source_files = 'Source/KSCrash/Reporting/Filters/Tools/**/*.{h,m,mm,c,cpp}'
      end

    end

    reporting.subspec 'Tools' do |tools|
      tools.frameworks = 'SystemConfiguration'
      tools.source_files = 'Source/KSCrash/Reporting/Tools/**/*.{h,m,mm,c,cpp}'
    end

    reporting.subspec 'MessageUI' do |messageui|
    end

    reporting.subspec 'Sinks' do |sinks|
      sinks.ios.frameworks = 'MessageUI'
      sinks.dependency 'KSCrash/Reporting/Filters'
      sinks.dependency 'KSCrash/Reporting/Tools'
      sinks.source_files = 'Source/KSCrash/Reporting/Sinks/**/*.{h,m,mm,c,cpp}'
    end

  end

  s.subspec 'Installations' do |installations|
    installations.dependency 'KSCrash/Recording'
    installations.dependency 'KSCrash/Reporting'
    installations.source_files = 'Source/KSCrash/Installations/**/*.{h,m,mm,c,cpp}'
  end

end

The files in the advanced pattern do exist, and have for years. 1.0.2 points to the head of master. Even specifically checking out 1.0.2 and running pod lib lint works, but pod spec lint fails.

Using the latest cocoapods (0.39.0)

awaiting input

Most helpful comment

I wonder if this was a caching issue, the only difference between pod lib lint and pod spec lint is that it will download the tagged release and run the linting. Can you try pod cache clean and re-try.

Failing that, append --no-clean --verbose and you can open up the tmp folder that the linting is being done in, and verify if those files somehow don't exist in there?

All 4 comments

I wonder if this was a caching issue, the only difference between pod lib lint and pod spec lint is that it will download the tagged release and run the linting. Can you try pod cache clean and re-try.

Failing that, append --no-clean --verbose and you can open up the tmp folder that the linting is being done in, and verify if those files somehow don't exist in there?

@kstenerud can you share the results of doing what Orta suggested?

@kstenerud Do you have anything in Pods/Local Podspecs?

I face somewhat similar issue.

When I use path: option in Podfile for development purposes, I end up having a bunch of .json podspecs generated in Pods/Local Podspecs and when I run pod spec lint later, it will pick up those local podspecs for some reason and try to validate them too, while pod lib lint doesn't do that.

I'm wiping Pods/Local Podspecs each time I run lint, but overall this does look like a bug.

This issue has been inactive for a long time and will be closed because we want to move forward with a clean slate after our 1.0 release. If you believe this is still relevant, please retest with the 1.0 release candidate and comment with a reproducible project in order for this to become actionable again. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gerchicov-bp picture gerchicov-bp  路  3Comments

k06a picture k06a  路  3Comments

tlandsmancars picture tlandsmancars  路  3Comments

pallaviMN picture pallaviMN  路  3Comments

Mingmingmew picture Mingmingmew  路  3Comments