Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podspec depending on FMDB/SQLCipher fails #7232

Closed
1 task done
tomblench opened this issue Nov 21, 2017 · 10 comments
Closed
1 task done

Podspec depending on FMDB/SQLCipher fails #7232

tomblench opened this issue Nov 21, 2017 · 10 comments

Comments

@tomblench
Copy link

Sorry if this has been raised before, I am still not clear whether this is a CocoaPods issue, or a SQLCipher issue.

I have seen read the discussion at the links below [1] [2] but the suggested work-around (a post_install hook in the podfile) is not applicable since we need to publish a spec which depends on FMDB/SQLCipher. We can't publish our spec because pod lib lint is currently failing.

[1] https://discuss.zetetic.net/t/ios-11-xcode-issue-implicit-declaration-of-function-sqlite3-key-is-invalid-in-c99/2198/27

[2] ccgus/fmdb#612

Report

What did you do?

Ran pod lib lint --allow-warnings with a minimal podspec with the dependency s.dependency 'FMDB/SQLCipher', '= 2.7.2' (see below).

What did you expect to happen?

Command should succeed.

What happened instead?

Command fails with the following errors:

...
    - ERROR | xcodebuild:  FMDB/src/fmdb/FMDatabase.m:401:14: error: implicit declaration of function 'sqlite3_rekey' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
...
    - ERROR | xcodebuild:  FMDB/src/fmdb/FMDatabase.m:427:14: error: implicit declaration of function 'sqlite3_key' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
...
[!] TestFmdbSqlcipher did not pass validation, due to 4 errors.
You can use the `--no-clean` option to inspect any issue.

CocoaPods Environment

[Note the same result is obtained running CocoaPods 1.3.1]

Stack

   CocoaPods : 1.4.0.beta.2
        Ruby : ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
    RubyGems : 2.5.2
        Host : Mac OS X 10.13.1 (17B48)
       Xcode : 9.1 (9B55)
         Git : git version 2.11.1
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : cloudant - https://github.com/cloudant/CloudantQueryObjc.git @ f810251f4ff7ba61297d71d923f65333a39cb61f
               local_repo - /Users/tomblench/pod_repo/ @ 574c423e5e7a1c01d451c4c34c5a3902847e03cb
               master - https://github.com/CocoaPods/Specs.git @ d0a98eab09f74c930faeabfb8e1ee0867f9d7278
               users-tomblench-pod_repo - file:///Users/tomblench/pod_repo/ @ 574c423e5e7a1c01d451c4c34c5a3902847e03cb

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.1
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

Project that demonstrates the issue

This is the minimal podspec which depends on FMDB/SQLCipher. I am aware that some of the values (homepage etc) are not "real" values but were just chosen to suppress non-material errors in pod lib lint. Likewise, this test project doesn't have any source files, headers etc, because we're just trying to isolate the issue with FMDB/SQLCipher.

Pod::Spec.new do |s|
  s.name         = "TestFmdbSqlcipher"
  s.version      = "0.0.1"
  s.summary      = "A short description of TestFmdbSqlcipher."
  s.description  = <<-DESC
                   A description
                   DESC
  s.homepage     = "http://EXAMPLE/TestFmdbSqlcipher"
  s.license      = "MIT"
  s.author             = { "Tom Blench" => "tblench@uk.ibm.com" }
  s.source       = { :git => "http://example.com/TestFmdbSqlcipher.git", :tag => "#{s.version}" }
  s.source_files  = "Classes", "Classes/**/*.{h,m}"
  s.exclude_files = "Classes/Exclude"
  s.dependency 'FMDB/SQLCipher', '= 2.7.2'
end
@tomblench
Copy link
Author

FWIW the FMDB team think that their pod is correct: I just can't think of any way that we could "fix" this in the SQLCipher pod itself. The header is being properly generated and packaged, it's just not placed where Xcode can find it by Cocoapods. (ccgus/fmdb#591 (comment))

@paulb777
Copy link
Member

Looks like using Xcode 8 would be a workaround since this seems to be a new Xcode 9 error.

Otherwise, you could explore adding the right WARNING_FLAG to the FMDB's podspec pod_target_xcconfig attribute or add the right search path to HEADER_SEARCH_PATHS in the pod_target_xcconfig.

@ekingo
Copy link

ekingo commented Jan 27, 2018

For now, just use '--use-libraries' param to ignore this error.

@stale
Copy link

stale bot commented Apr 27, 2018

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

@stale stale bot added the s1:awaiting input Waiting for input from the original author label Apr 27, 2018
@rmccu
Copy link

rmccu commented May 2, 2018

It would be nice if this was not closed. I am still seeing this issue.

@stale stale bot removed the s1:awaiting input Waiting for input from the original author label May 2, 2018
@stale
Copy link

stale bot commented Jul 31, 2018

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

@stale stale bot added the s1:awaiting input Waiting for input from the original author label Jul 31, 2018
@amorde
Copy link
Member

amorde commented Jul 31, 2018

I believe FMDB has fixed this in ccgus/fmdb#672 but hasn't publish a new version to CocoaPods

@stale stale bot removed the s1:awaiting input Waiting for input from the original author label Jul 31, 2018
@tomblench
Copy link
Author

OK thanks, we have a workaround for now (--use-libraries) which works for us.

@sri94aa
Copy link

sri94aa commented Oct 26, 2018

In which file we must use the (--use-libraries) param?

@amorde
Copy link
Member

amorde commented Oct 26, 2018

@sri94aa --use-libraries is an option for pod spec lint and pod lib lint

I believe FMDB updated their Podspec to fix this issue, so I recommend updating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants