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

carthage build failed #319

Closed
xaclincoln opened this issue Jan 11, 2016 · 5 comments · May be fixed by stephencelis/SQLiteCipher.swift#1
Closed

carthage build failed #319

xaclincoln opened this issue Jan 11, 2016 · 5 comments · May be fixed by stephencelis/SQLiteCipher.swift#1

Comments

@xaclincoln
Copy link

The carthage build failed on my mac. I'm using carthage 0.10.0, xcode 7.2. Following is the error message:
The following build commands failed:
CompileSwift normal x86_64 /Users/ftit/Documents/lincoln/try5/Carthage/Checkouts/SQLite.swift/SQLite/Typed/CoreFunctions.swift
CompileSwift normal x86_64 /Users/ftit/Documents/lincoln/try5/Carthage/Checkouts/SQLite.swift/SQLite/Extensions/R_Tree.swift
CompileSwift normal x86_64 /Users/ftit/Documents/lincoln/try5/Carthage/Checkouts/SQLite.swift/SQLite/Core/Blob.swift
CompileSwift normal x86_64 /Users/ftit/Documents/lincoln/try5/Carthage/Checkouts/SQLite.swift/SQLite/Foundation.swift
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(5 failures)
/Users/ftit/Documents/lincoln/try5/Carthage/Checkouts/SQLite.swift/SQLite3/module.modulemap:2:12: error: header '/usr/include/sqlite3.h' not found
/Users/ftit/Documents/lincoln/try5/Carthage/Checkouts/SQLite.swift/SQLite/Core/Blob.swift:25:8: error: could not build Objective-C module 'SQLite3'
/Users/ftit/Documents/lincoln/try5/Carthage/Checkouts/SQLite.swift/SQLite3/module.modulemap:2:12: error: header '/usr/include/sqlite3.h' not found
/Users/ftit/Documents/lincoln/try5/Carthage/Checkouts/SQLite.swift/SQLite/Core/Blob.swift:25:8: error: could not build Objective-C module 'SQLite3'
/Users/ftit/Documents/lincoln/try5/Carthage/Checkouts/SQLite.swift/SQLite3/module.modulemap:2:12: error: header '/usr/include/sqlite3.h' not found
/Users/ftit/Documents/lincoln/try5/Carthage/Checkouts/SQLite.swift/SQLite/Core/Blob.swift:25:8: error: could not build Objective-C module 'SQLite3'
/Users/ftit/Documents/lincoln/try5/Carthage/Checkouts/SQLite.swift/SQLite3/module.modulemap:2:12: error: header '/usr/include/sqlite3.h' not found
/Users/ftit/Documents/lincoln/try5/Carthage/Checkouts/SQLite.swift/SQLite/Core/Blob.swift:25:8: error: could not build Objective-C module 'SQLite3'
A shell task failed with exit code 65:
*_ BUILD FAILED **

The following build commands failed:
CompileSwift normal x86_64 /Users/ftit/Documents/lincoln/try5/Carthage/Checkouts/SQLite.swift/SQLite/Typed/CoreFunctions.swift
CompileSwift normal x86_64 /Users/ftit/Documents/lincoln/try5/Carthage/Checkouts/SQLite.swift/SQLite/Extensions/R*Tree.swift
CompileSwift normal x86_64 /Users/ftit/Documents/lincoln/try5/Carthage/Checkouts/SQLite.swift/SQLite/Core/Blob.swift
CompileSwift normal x86_64 /Users/ftit/Documents/lincoln/try5/Carthage/Checkouts/SQLite.swift/SQLite/Foundation.swift
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(5 failures)

@Jeehut
Copy link

Jeehut commented Jan 11, 2016

Hi @xaclincoln, we had the same issue and could fix it by changing the line header "/usr/include/sqlite3.h" in the file SQLite3/module.modulemap in the checkout folder to header "/usr/local/Cellar/sqlite/3.9.2/include/sqlite3.h" and install sqlite3 via Homebrew with brew install sqlite3. Then just running carthage build will correctly install everything for one time. That is not a good solution though as a carthage update will re-download the bug and replace the changes, so I hope this gets fixed soon.

It's a strange bug though as the /usr/include library doesn't seem to be there on some devices running El Capitan – it was there on mine but not on one of my colleagues.

If you don't have Homebrew installed yet you can do so by running this first in terminal:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

@stephencelis
Copy link
Owner

It looks like the /usr/include path only exists if you've installed the command line tools. We'll get a release out that addresses this soon.

stephencelis added a commit that referenced this issue Jan 11, 2016
We've been down this path before. Unfortunately,
`/usr/include/sqlite3.h` isn't reliably available on all Macs. Because
module maps don't yet have dynamic support (something that the Swift
Package Manager intends to have solved soon), we need to hardcode the
SDK path (or use a script to substitute it).

Fixes #319.

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

Please lock to the module-map-path branch and see if this resolves your problem!

github "stephencelis/SQLite.swift" "module-map-path"

And with CocoaPods:

pod 'SQLite.swift',
  git: 'https://github.com/stephencelis/SQLite.swift.git',
  branch: 'module-map-path'

@Jeehut
Copy link

Jeehut commented Jan 11, 2016

Thanks @stephencelis, we will indeed use that branch for the moment, but I just checked and both Macs have the command line tools installed. I typed gcc and make as suggested here and both responded correctly – also both have XCode 7.2 installed with the same command line tools entry in the preferences. I'm guessing it's something else.

My best guess would be that the other Mac without the /usr/include folder only had XCode 7.1+ installed on it whereas mine's older and also served with XCode 6 back then. Something in that direction maybe?

@stephencelis
Copy link
Owner

@Dschee What's odd is I'm on a new computer and have that header path 😕

stephencelis added a commit that referenced this issue Jan 11, 2016
We've been down this path before. Unfortunately,
`/usr/include/sqlite3.h` isn't reliably available on all Macs. Because
module maps don't yet have dynamic support (something that the Swift
Package Manager intends to have solved soon), we need to hardcode the
SDK path (or use a script to substitute it).

Fixes #319.

Signed-off-by: Stephen Celis <[email protected]>
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

Successfully merging a pull request may close this issue.

3 participants