Skip to content

CocoaPods fix: Xcode 7.3 #380

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

Merged
merged 3 commits into from
Mar 25, 2016
Merged

CocoaPods fix: Xcode 7.3 #380

merged 3 commits into from
Mar 25, 2016

Conversation

stephencelis
Copy link
Owner

This should hopefully fix issues #349 #378 and includes work from #379.

Please test on your platform and report if it works!

pod "SQLite.swift",
  git: "https://github.com/stephencelis/SQLite.swift",
  branch: "cocoapods-xcode-7-3"

Will merge when things look good!

fuxx added 2 commits March 23, 2016 11:41
Imports the SDK based on current architecture. Fixes incompatibility problems for Xcode 7.3.
Also includes link flag for convenience.
I've just missed arm64 compatibility. Works now fine with Xcode 7.2.1
Xcode 7.3 got more strict about SDK headers. We need to use multiple
module maps to accommodate various platforms and we need to scope
`requires` to accommodate various architecturers.

Signed-off-by: Stephen Celis <[email protected]>
@gblotter
Copy link

@stephencelis any word on when this will be merged in?

@stephencelis
Copy link
Owner Author

@gblotter Can you verify that it works for you and list the simulators/devices you tested?

@gblotter
Copy link

@stephencelis I can't... I rely on SQLiteCipher.swift... I'm trying to get a pod spec stood up in that project that I can submit a PR to you for... but it relies on this project. I've essentially applied this same fix to the SQLiteCipher.swift project but the spec won't/can't lint properly because of this issue in this project hasn't been merged into master. I can't point it to a branch, or else I'd test it that way...

So I'm trying to wait patiently 😊

@stephencelis
Copy link
Owner Author

Hope to get some confirmations soon :)

@ohlsont
Copy link

ohlsont commented Mar 23, 2016

I'm getting lots of sqlite3 errors when installing the pod above. Im going from a frameworkless installation and dropping my iOS 7 support.
ex.
"Use of unresolved identifier 'sqlite3_bind_blob'"

@stephencelis
Copy link
Owner Author

@Hinken Can you provide much more detailed information on your situation? Is pod install what's failing for you, or something else? Xcode version? CocoaPods version? The contents of your Podfile (does it call use_frameworks!)? Are you building for the simulator? Device? Which OS? Anything else that you think relevant?

@ohlsont
Copy link

ohlsont commented Mar 23, 2016

I was hoping for a common error :)
it is when compiling the project, xcode 7.3, cocoa pod 0.39, it calls use_frameworks! using that for a lot of other stuff. Simulator iOS 9.3 iphone 6.
Also, thanks for a great project. I've been using it for a long time now

image

@gblotter
Copy link

@stephencelis I can confirm that I'm seeing the same thing. One thing I noticed... Here are the contents of the SQLite.swift module file that is being generated:

framework module SQLite {
  umbrella header "SQLite.swift-umbrella.h"

  export *
  module * { export * }

  private header "fts3_tokenizer.h"
}

No header import of the sqlite3 library

@brandenr
Copy link
Collaborator

I'm seeing the same thing as @gblotter

@stephencelis
Copy link
Owner Author

Can someone provide much more detailed information around their setup? I'm at a loss troubleshooting this because it's working for me :(

@gblotter
Copy link

Same as the previous two people... Xcode 7.3, building for the iOS simulator...

@brandenr
Copy link
Collaborator

I have pod "SQLite.swift",
git: "https://github.com/stephencelis/SQLite.swift",
branch: "cocoapods-xcode-7-3"
in my pod file

pod install (I've also tried pod update, but same results)
I did a project clean
I get build failures as if it can't find the sqlite3.h

@stephencelis
Copy link
Owner Author

Can you paste the contents of Podfile.lock?

@stephencelis
Copy link
Owner Author

Can you also try the CocoaPods 1.0.0 beta?

gem install --pre cocoapods

I wonder if this is fixed in newer versions.

@brandenr
Copy link
Collaborator

PODS:

  • Alamofire (3.2.1)
  • AlamofireImage (2.3.1):
    • Alamofire (~> 3.2)
  • Crashlytics (3.7.0):
    • Fabric (~> 1.6.3)
  • Fabric (1.6.7)
  • GMCRadialProgressView (1.0.2)
  • google-cast-sdk (2.10.4):
    • google-cast-sdk/Assets (= 2.10.4)
    • google-cast-sdk/Core (= 2.10.4)
  • google-cast-sdk/Assets (2.10.4):
    • google-cast-sdk/Core
  • google-cast-sdk/Core (2.10.4)
  • LDSAnalytics (3.2.1):
    • Reachability
  • LDSCommons/ChurchLogo (8.0.1)
  • LDSCommons/Core (8.0.1)
  • LDSCommons/Languages (8.0.1)
  • LDSCommons/LDSAccount (8.0.1)
  • LDSCommons/OtherApps (8.0.1)
  • LDSCommons/UIKit (8.0.1):
    • LDSCommons/Core
    • MMMarkdown
  • MMMarkdown (0.5.1)
  • Reachability (3.2)
  • SQLite.swift (0.9.2)
  • SSKeychain (1.4.0)
  • SVProgressHUD (2.0)
  • Swiftification (5.3.0)
  • UIDevice-DisplayName (1.4)

DEPENDENCIES:

  • Alamofire
  • AlamofireImage
  • Crashlytics
  • Fabric
  • GMCRadialProgressView
  • google-cast-sdk
  • LDSAnalytics
  • LDSCommons/ChurchLogo
  • LDSCommons/Languages
  • LDSCommons/LDSAccount
  • LDSCommons/OtherApps
  • LDSCommons/UIKit
  • SQLite.swift (from https://github.com/stephencelis/SQLite.swift, branch cocoapods-xcode-7-3)
  • SSKeychain
  • SVProgressHUD
  • Swiftification
  • UIDevice-DisplayName

EXTERNAL SOURCES:
SQLite.swift:
:branch: cocoapods-xcode-7-3
:git: https://github.com/stephencelis/SQLite.swift

CHECKOUT OPTIONS:
SQLite.swift:
:commit: 98a4cc0
:git: https://github.com/stephencelis/SQLite.swift

SPEC CHECKSUMS:
Alamofire: f11d8624a05f5d39e0c99309b3e600a3ba64298a
AlamofireImage: e52336282757bbe1644f075d6cb85f19c891f939
Crashlytics: c3a2333dea9e2733d2777f730910321fc9e25c0d
Fabric: caf7580c725e64db144f610ac65cd60956911dc7
GMCRadialProgressView: ff2eb1ac717dbaa86b78517724cf162fd02ce77f
google-cast-sdk: eb83ef6b875969e765011c457b254539c0978792
LDSAnalytics: 19feb42ff425d5e49094398d908748d9ff16e2ae
LDSCommons: 7c723a51e0f129d9e81807e16b56eaf51f0c98cb
MMMarkdown: 06f7989e0350d10a7de50516af6c812402ce554b
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
SQLite.swift: 021e011812e5546628e5b8752f3b71d757356dd8
SSKeychain: c71293fa57216a40ab06c23f4085387583293de4
SVProgressHUD: e9e7c893686a20da55a28015ed384d9425e15479
Swiftification: be032aa7435a457d4ddf2110589741c3c636d2b8
UIDevice-DisplayName: e96e795e89ffe8ad0ecc62e9a20afaea917e98f9

COCOAPODS: 0.39.0

@gblotter
Copy link

Pods/Local Podspecs/SQLite.swift.podspec.json:

{
  "name": "SQLite.swift",
  "version": "0.9.2",
  "summary": "A type-safe, Swift-language layer over SQLite3 for iOS and OS X.",
  "description": "SQLite.swift provides compile-time confidence in SQL statement syntax and\nintent.",
  "homepage": "https://github.com/stephencelis/SQLite.swift",
  "license": "MIT",
  "authors": {
    "Stephen Celis": "[email protected]"
  },
  "source": {
    "git": "https://github.com/stephencelis/SQLite.swift.git",
    "tag": "0.9.2"
  },
  "social_media_url": "https://twitter.com/stephencelis",
  "module_name": "SQLite",
  "platforms": {
    "ios": "8.0",
    "tvos": "9.0",
    "osx": "10.9"
  },
  "ios": {
    "module_map": "CocoaPods/ios.modulemap"
  },
  "tvos": {
    "module_map": "CocoaPods/tvos.modulemap"
  },
  "osx": {
    "module_map": "CocoaPods/osx.modulemap"
  },
  "libraries": "sqlite3",
  "source_files": "SQLite/**/*.{c,h,m,swift}",
  "private_header_files": "SQLite/Core/fts3_tokenizer.h"
}

But my directory isn't showing a path for CocoaPods/*. Do you need to preserve the path?

@gblotter
Copy link

@stephencelis are you running the beta cocoapods??

@stephencelis
Copy link
Owner Author

@gblotter I meant the Podfile.lock, not the podspec. The path shouldn't need to be preserved. It's relative to the pod repo.

@stephencelis
Copy link
Owner Author

@gblotter Yep. I think it may be required.

@brandenr
Copy link
Collaborator

Sorry, mine's still doing the deep fetch of master

@gblotter
Copy link

... updating to cocoapods beta ...

@fabiorodella
Copy link

I was using cocoapods 1.0.0.beta.4, and had the same errors as @gblotter. I have just upgraded to 1.0.0.beta.6 and now it works, but I had to completely delete the Pods folder before running pod install again, otherwise I got some "module map not found" errors.

@brandenr
Copy link
Collaborator

Okay. The deep fetch finally finished. I can build now with your branch. I can build for iOS Device and iOS Simulator. I can also seem to build for tvOS simulator (I get an error later on in my code since I haven't built it in a while).

@jjohnsonvng
Copy link

@gblotter
screen shot 2016-03-25 at 10 09 32 am

I have to do both SQLite and SQLiteCipher using Manual method. But in the SQLiteCipher I had to make the 2 adjustments (copy the sqlite3.h file to the Vendor/SQLite.swift/SQLite3 directory, and modify the module.modulemap file to this
screen shot 2016-03-25 at 10 11 33 am

Then Product/Clean then Build and it works. I am going to submit later today to AppStore to make sure there are no other issues I am not seeing.

@brandenr
Copy link
Collaborator

@stephencelis Since it seems that it was a bad Xcode upgrade for those that this branch didn't work for, is it okay to merge this in now?

@stephencelis
Copy link
Owner Author

👍 Sounds good!

@stephencelis stephencelis merged commit 7139feb into master Mar 25, 2016
@stephencelis
Copy link
Owner Author

@brandenr One last one to figure out before cutting a release, though: #384

@cjwirth
Copy link
Collaborator

cjwirth commented Mar 25, 2016

Ahh, it seems like my build that works just fine locally is failing on CirlceCI now 😕

❌  /Users/distiller/abema-ios/Pods/SQLite.swift/SQLite/Core/Connection.swift:660:45: use of unresolved identifier 'SQLITE_OK'
    private static let successCodes: Set = [SQLITE_OK, SQLITE_ROW, SQLITE_DONE]
    ^~~~~~~~~

❌  /Users/distiller/abema-ios/Pods/SQLite.swift/SQLite/Core/Connection.swift:660:56: use of unresolved identifier 'SQLITE_ROW'
    private static let successCodes: Set = [SQLITE_OK, SQLITE_ROW, SQLITE_DONE]
                                            ^~~~~~~~~

❌  /Users/distiller/abema-ios/Pods/SQLite.swift/SQLite/Core/Connection.swift:660:68: use of unresolved identifier 'SQLITE_DONE'
    private static let successCodes: Set = [SQLITE_OK, SQLITE_ROW, SQLITE_DONE]
                                                       ^~~~~~~~~~

❌  /Users/distiller/abema-ios/Pods/SQLite.swift/SQLite/Core/Statement.swift:41:44: use of unresolved identifier 'sqlite3_column_count'
    public lazy var columnCount: Int = Int(sqlite3_column_count(self.handle))
                                                                   ^~~~~~~~~~~

❌  /Users/distiller/abema-ios/Pods/SQLite.swift/SQLite/Core/Statement.swift:44:28: use of unresolved identifier 'sqlite3_column_name'
        String.fromCString(sqlite3_column_name(self.handle, $0))!
                                           ^~~~~~~~~~~~~~~~~~~~

▸ Compiling Blob.swift
❌  /Users/distiller/abema-ios/Pods/SQLite.swift/SQLite/Core/Connection.swift:660:45: use of unresolved identifier 'SQLITE_OK'
    private static let successCodes: Set = [SQLITE_OK, SQLITE_ROW, SQLITE_DONE]
                           ^~~~~~~~~~~~~~~~~~~

❌  /Users/distiller/abema-ios/Pods/SQLite.swift/SQLite/Core/Connection.swift:660:56: use of unresolved identifier 'SQLITE_ROW'
    private static let successCodes: Set = [SQLITE_OK, SQLITE_ROW, SQLITE_DONE]
                                            ^~~~~~~~~

❌  /Users/distiller/abema-ios/Pods/SQLite.swift/SQLite/Core/Connection.swift:660:68: use of unresolved identifier 'SQLITE_DONE'
    private static let successCodes: Set = [SQLITE_OK, SQLITE_ROW, SQLITE_DONE]
                                                       ^~~~~~~~~~

❌  /Users/distiller/abema-ios/Pods/SQLite.swift/SQLite/Core/Statement.swift:41:44: use of unresolved identifier 'sqlite3_column_count'
    public lazy var columnCount: Int = Int(sqlite3_column_count(self.handle))
                                                                   ^~~~~~~~~~~

❌  /Users/distiller/abema-ios/Pods/SQLite.swift/SQLite/Core/Statement.swift:44:28: use of unresolved identifier 'sqlite3_column_name'
        String.fromCString(sqlite3_column_name(self.handle, $0))!
                                           ^~~~~~~~~~~~~~~~~~~~

Testing failed:
    Use of unresolved identifier 'SQLITE_OK'
    Use of unresolved identifier 'SQLITE_ROW'
    Use of unresolved identifier 'SQLITE_DONE'
    Use of unresolved identifier 'sqlite3_column_count'
    Use of unresolved identifier 'sqlite3_column_name'
** TEST FAILED **

The following build commands failed:
    CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
    CompileSwift normal x86_64 /Users/distiller/abema-ios/Pods/SQLite.swift/SQLite/Typed/AggregateFunctions.swift
    CompileSwift normal x86_64 /Users/distiller/abema-ios/Pods/SQLite.swift/SQLite/Core/Blob.swift
(3 failures)

@brandenr
Copy link
Collaborator

@cjwirth, did you try reinstalling (preferably not from the App Store) Xcode on that machine?

@cjwirth
Copy link
Collaborator

cjwirth commented Mar 25, 2016

@brandenr It's on CircleCI, I don't have access to the machine 😕

On my own machines, yeah, I always download the dmg version.

@brandenr
Copy link
Collaborator

@cjwirth Do you know what Xcode they're running? Those look a lot like the errors you get with Xcode 7.2 or a bad install of Xcode 7.3

@cjwirth
Copy link
Collaborator

cjwirth commented Mar 25, 2016

I don't know how they are installing it, but I know that it is selecting it by doing

sudo xcode-select --switch /Applications/Xcode-7.3.app && xcodebuild -version
Xcode 7.3
Build version 7D175

Which lists the same version I have installed too. But I don's suppose that would change from dmg/AppStore versions

@brandenr
Copy link
Collaborator

Ah. Based on "/Applications/Xcode.app/".. being in the header, I'm not sure that's going to work if they've named it Xcode-7.3.app

@cjwirth
Copy link
Collaborator

cjwirth commented Mar 25, 2016

Yep, it hit me literally 30 seconds ago as well...

@cjwirth
Copy link
Collaborator

cjwirth commented Mar 25, 2016

Well, no, because I just did that locally, and it just tells me "header can't be found." CircleCI still has Xcode 7.0 or something installed at /Applications/Xcode.app/...

@Souf-R
Copy link

Souf-R commented Mar 25, 2016

Hi @stephencelis
I'm still having this issue using Simulator, but when I use the iPhone, there is no bug.
Here is what I did [env: Xcode 7.3] :

  1. Delete the Pods directory and Podfile.lock
  2. In Podfile use: pod 'SQLite.swift', '~> 0.9.2'
  3. Update Cocoapod gem to 1.0.0.beta.6
  4. Run pod install
  5. Open MyProject.xcworkspace and Clean the Build Folder

I hope this is helping :-)

@brandenr
Copy link
Collaborator

@Souf-R, 0.9.2 doesn't support Xcode 7.3. You need to point at this branch or commit (if the branch has been deleted)
pod "SQLite.swift",
git: "https://github.com/stephencelis/SQLite.swift",
branch: "cocoapods-xcode-7-3"

@stephencelis
Copy link
Owner Author

@Souf-R You can point to master (this branch was merged). I'll be cutting a release shortly.

@Souf-R
Copy link

Souf-R commented Mar 25, 2016

Ok @stephencelis, I will wait for the release while I'm testing with my iPhone.
@brandenr, I had this issue yesterday, but after what I did (see my post above). I can use 0.9.2 with Xcode 7.3 and btw I have iOS 9.2.1 I didn't update to 9.3 yet

@brandenr
Copy link
Collaborator

Yes, 0.9.2 works with Xcode 7.3 when building for a device. I meant with a simulator and a device.

@cjwirth
Copy link
Collaborator

cjwirth commented Mar 26, 2016

Deleted my previous comment because it was unhelpful. But I've discovered something useful now.

Currently, the module map for iOS has this inside it:

    module arm {
        header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/sqlite3.h"
        requires arm
    }

    module arm64 {
        header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/sqlite3.h"
        requires arm64
    }

    module x86 {
        header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/sqlite3.h"
        requires x86
    }

And it builds fine for device, but not simulator. However! If we move the module x86 to be above the arm and arm64 modules, then we get just the opposite! We can build for simulator but not device.

I don't know much about module maps, but if it works on dmg Xcode and not AppStore Xcode, then it sounds like it's a bug in one of them. I don't know which is which, but for now I think it would be best to get it working in both.

I'm going to see if I can get a setup where it only uses the module map for the current architecture.

@brandenr
Copy link
Collaborator

The App Store Xcode works for me and another. Just not everyone.

@dzpt
Copy link

dzpt commented Mar 26, 2016

Still noone can solve this error?

@dzpt
Copy link

dzpt commented Mar 26, 2016

This is error after i use:
pod "SQLite.swift", git: "https://github.com/stephencelis/SQLite.swift", branch: "cocoapods-xcode-7-3"

on Xcode 7.3
screen shot 2016-03-26 at 4 21 26 pm

@acrookston
Copy link
Collaborator

@tom29 look at the above PR #386. See if that helps.

@dzpt
Copy link

dzpt commented Mar 27, 2016

@acrookston i don't see the answer there? how to solve my trouble. i've just updated cocoapods to 1.0 beta but the other errors have occurred

@stephencelis
Copy link
Owner Author

@tom29 I believe that may have been merged in afterwards. Can you try pointing your Podfile to branch: master and see if that fixes things? I can cut 0.10.1 if need be.

@jjohnsonvng
Copy link

Follow my manual install method

Sent from my iPhone

On Mar 27, 2016, at 1:15 PM, Tom29 [email protected] wrote:

@acrookston i don't see the answer there? how to solve my trouble. i've just updated cocoapods to 1.0 beta but the other errors have occurred


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

@dzpt
Copy link

dzpt commented Mar 27, 2016

@stephencelis Tks. It works.

@jberkel jberkel deleted the cocoapods-xcode-7-3 branch October 9, 2016 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.