pixelspark / catena

Catena is a distributed database based on a blockchain, accessible using SQL.
MIT License
302 stars 23 forks source link

Not building in Linux other than Debian #130

Closed lf-araujo closed 6 years ago

lf-araujo commented 6 years ago

Building instructions are failing to find KituraTemplateEngine in Manjaro (Arch based) Linux:

image

 $  swift build
'Kitura' /tmp/catena/.build/checkouts/Kitura.git-3663189543328700261: error: product dependency 'KituraTemplateEngine' not found
'Kitura-net' /tmp/catena/.build/checkouts/Kitura-net.git--622939097078554517: error: product dependency 'CCurl' not found
warning: dependency 'Cryptor' is not used by any target

I followed instructions as per project webpage: git clone & swift build

Thank you for this software.

pixelspark commented 6 years ago

@lf-araujo I did encounter this too - it appears there is a version of Kitura that has incorrect dependencies, and for some weird reason this is the version that gets selected by the package manager. Try removing the Package.resolved file and rebuilding - if that does not work, fiddling with the versions in Package.swift might fix it. I will have a look at this later!

pixelspark commented 6 years ago

A clean clone + swift build on Debian appears to work without issue. What version of Swift are you running?

Mine is Swift version 4.0 (swift-4.0-RELEASE).. Will now try a later one...

lf-araujo commented 6 years ago

image It's 4.1.

Will try to debug following your suggestion.

Thank you!

pixelspark commented 6 years ago

I investigated this a bit further and indeed, it builds fine with 4.0 but fails against 4.1 or higher. Note however that it builds fine on Mac inside a recent XCode (running >=4.1) and swift package generate-xcodeproj, which is a bit odd.

lf-araujo commented 6 years ago

Thanks for waiting,

I found the problem, it seems latest SPM allows for calling apt, which obviously does not work in other distros. An example code from SPM is:

import PackageDescription

let package = Package(
    name: "CCurl",
    providers: [
        .Brew("curl"), 
        .Apt("libcurl4-openssl-dev")
    ]
)

From SPM sourcecode:

extension SystemPackageProviderDescription {
    public var installText: String {
        switch self {
        case .brew(let packages):
            return "    brew install \(packages.joined(separator: " "))\n"
        case .apt(let packages):
            return "    apt-get install \(packages.joined(separator: " "))\n"
        }
}

So this problem is upstream and I will close the issue. It is, however, a bit disappointing to see Apple is hardcoding apt into SPM.

Thank you

pixelspark commented 6 years ago

@lf-araujo as far as I know the '.apt' reference only causes the SPM to show a suggestion to obtain the required packages through apt, but does not actually call it. So this is unlikely to be the culprit here..