attaswift / BTree

Fast sorted collections for Swift using in-memory B-trees

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to build

cliffordh opened this issue · comments

I am attempting to use BTree in a project but I'm receiving build errors. Here is my Package.swift:

import PackageDescription

let package = Package(
name: "swift-spell-checker",
dependencies: [
.Package(url: "https://github.com/lorentey/BTree.git", versions: Version(2,1,0)..<Version(2,2,0)),
]
)

Packages/BTree-2.1.0/Sources/BTreeIndex.swift:166:89: error: expected initial value after '='
internal func expectValid(@autoclosure expression: Void->Bool, file: StaticString = #file, line: UInt = #line) {

Hm, at first glance this looks like you're using Swift 2.1. Is that correct? If so, you should try BTree 2.0.0, which is the last version that does not require Swift 2.2. (The syntax for referencing source filenames & line numbers changed in Swift 2.2.)

Looks like 2.2 and Xcode 7.3

MacBook-Pro-2:~ cliff$ swift --version
Apple Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b, Swift 0ddf238ad7)
Target: x86_64-apple-macosx10.9

Cliff

On Apr 27, 2016, at 10:37 AM, Károly Lőrentey notifications@github.com wrote:

Hm, at first glance this looks like you're using Swift 2.1. Is that correct? If so, you should try BTree 2.0.0, which is the last version that does not require Swift 2.2. (The syntax for referencing source filenames & line numbers changed in Swift 2.2.)


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

MacBook-Pro-2:~ cliff$ swift --version
Apple Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b, Swift 0ddf238ad7)
Target: x86_64-apple-macosx10.9

I believe the Swift Package Manager isn't bundled with Xcode yet, so you must be using a development snapshot. Based on your commit hash for Swift, it looks like you're using an old snapshot from last December:

apple/swift@0ddf238ad7

I suggest you install the latest snapshot or just switch to the toolchain that comes with Xcode 7.3.

(If you can't upgrade for some reason, reverting to an earlier BTree release will make the package compile.)

I'm closing this; please reopen if problem persists after toolchain update.

Using the March 24th Snapshot version (as other versions are missing swift-build):

/Users/cliff/Work/swift-spell-checker/Packages/BTree-2.1.0/Sources/BTreeBuilder.swift:19:20: error: 'SequenceType' has been renamed to 'Sequence'
public init<S: SequenceType where S.Generator.Element == Element>(_ elements: S, dropDuplicates: Bool = false, order: Int = Node.defaultOrder) {
^~~~~~~~~~~~
Sequence

BTree only supports Swift 2.2 at this time. You've gone a bit too far; the latest development snapshot from Swift's master branch contains unfinished work on Swift 3, the next major version. It contains deep changes that make it incompatible with Swift 2.

For stable work, you'll need the Swift 2.2 release snapshot from swift.org. (The toolchain that's included in Xcode 7.3/7.3.1 works too, by the way.)

All this is rather annoying, but there's hope on the horizon: I heard that source code compatibility will be taken much more seriously once Swift 3 is released.

Thanks. It doesn't appear that swift-build is part of 7.3.1, nor the 2.2 snapshots... only swiftc.

Cliff

On Apr 27, 2016, at 6:33 PM, Károly Lőrentey notifications@github.com wrote:

BTree only supports Swift 2.2 at this time. You've gone a bit too far; the latest development snapshot from Swift's master branch contains unfinished work on Swift 3, the next major version. It contains deep changes that make it incompatible with Swift 2.

For stable work, you'll need the Swift 2.2 release snapshot from swift.org. (The toolchain that's included in Xcode 7.3/7.3.1 works too, by the way.)

All this is rather annoying, but there's hope on the horizon: I heard that source code compatibility will be taken much more seriously once Swift 3 is released.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub #12 (comment)

Using cocoa pods seems to work... Getting Swift package manager working is a bit rough right now.

Yeah, the package manager is something of a tech demo right now. :-(