vapor-community / redis-provider

Adds Redis Cache to Vapor
MIT License
17 stars 5 forks source link

vapor build fails with trivial example #6

Closed iljaiwas closed 8 years ago

iljaiwas commented 8 years ago

I added the redis-provider package to the Package.swift of Vapor's auth-example, but cannot get it to work:

import PackageDescription

let package = Package(
    name: "AuthExample",
    dependencies: [
        .Package(url: "https://github.com/vapor/vapor.git", majorVersion: 1),
        .Package(url: "https://github.com/vapor/redis-provider.git", majorVersion: 0)

    ],
    exclude: [
        "Config",
        "Database",
        "Localization",
        "Public",
        "Resources",
        "Tests",
    ]
)

vapor build fails like this:

vapor build
Fetching Dependencies [Failed]
Check your dependencies' Package.swift files to see where the conflict is.
Error: warning: refname '1.1.10' is ambiguous.
warning: refname '1.1.10' is ambiguous.
warning: refname '1.0.1' is ambiguous.
warning: refname '1.0.1' is ambiguous.
warning: refname '1.0.0' is ambiguous.
warning: refname '1.0.0' is ambiguous.
warning: refname '1.0.0' is ambiguous.
warning: refname '1.0.0' is ambiguous.
warning: refname '1.1.0' is ambiguous.
warning: refname '1.1.0' is ambiguous.
warning: refname '1.0.1' is ambiguous.
warning: refname '1.0.1' is ambiguous.
warning: refname '1.0.0' is ambiguous.
warning: refname '1.0.0' is ambiguous.
warning: refname '1.0.0' is ambiguous.
warning: refname '1.0.0' is ambiguous.
warning: refname '1.1.1' is ambiguous.
warning: refname '1.1.1' is ambiguous.
warning: refname '1.1.0' is ambiguous.
warning: refname '1.1.0' is ambiguous.
warning: refname '1.1.0' is ambiguous.
warning: refname '1.1.0' is ambiguous.
warning: refname '1.0.0' is ambiguous.
warning: refname '1.0.0' is ambiguous.
warning: refname '1.0.1' is ambiguous.
warning: refname '1.0.1' is ambiguous.
warning: refname '1.0.0' is ambiguous.
warning: refname '1.0.0' is ambiguous.
warning: refname '1.0.3' is ambiguous.
warning: refname '1.0.3' is ambiguous.
warning: refname '1.0.2' is ambiguous.
warning: refname '1.0.2' is ambiguous.
warning: refname '1.0.1' is ambiguous.
warning: refname '1.0.1' is ambiguous.
warning: refname '0.1.0' is ambiguous.
warning: refname '0.1.0' is ambiguous.
warning: refname '0.11.1' is ambiguous.
warning: refname '0.11.1' is ambiguous.
swift-package: error: The dependency graph could not be satisfied (https://github.com/vapor/socks.git)

Any ideas how to use redis-provider?

tanner0101 commented 8 years ago

You need to use redis with major version 1:

.Package(url: "https://github.com/vapor/redis-provider.git", majorVersion: 1)
iljaiwas commented 8 years ago

Updated to my Packages.swift file to look like this, but still a no-go:

import PackageDescription

let package = Package(
    name: "AuthExample",
    dependencies: [
        .Package(url: "https://github.com/vapor/vapor.git", majorVersion: 1),
        .Package(url: "https://github.com/vapor/redis-provider.git", majorVersion: 1)

    ],
    exclude: [
        "Config",
        "Database",
        "Localization",
        "Public",
        "Resources",
        "Tests",
    ]
)

I get this:

vapor clean && vapor build
Cleaning [Done]
No Packages folder, fetch may take a while...
Fetching Dependencies [Failed]
Check your dependencies' Package.swift files to see where the conflict is.
Error: swift-package: error: The dependency graph could not be satisfied. The package (https://github.com/vapor/redis-provider.git) with version tag in range (1.0.0..<1.9223372036854775807.9223372036854775807) is not found. Found tags ([0.1.0])
loganwright commented 8 years ago

@iljaiwas You're right, there's no 1.0 for Redis yet. There appears to be an issue with SwiftPM resolving the underlying dependencies. Can you try:

        .Package(url: "https://github.com/vapor/vapor.git", majorVersion: 1, minor: 0),
        .Package(url: "https://github.com/vapor/redis-provider.git", majorVersion: 0)

If that builds, then it's definitely something in our dependency tree not being capable of resolving to a lower socks even though it should be able to.

We'll dig into it, but in the meantime if this works, you can get started.

tanner0101 commented 8 years ago

Just released 1.0 of the Redis provider.

https://github.com/vapor/redis-provider/releases/tag/1.0.0

Let me know if this helps.

iljaiwas commented 8 years ago

Thank you! Adding the 1.0 tag seems to have cured the problem.