Carthage: Can't build Carthage with SPM in Swift 5

Created on 1 Apr 2019  路  3Comments  路  Source: Carthage/Carthage

Carthage 0.32.0 isn't building with Swift 5 via the Swift package manager. This affects Mint installations.

swift build -Xswiftc -target -Xswiftc x86_64-apple-macosx10.14

Doing so leads to the error:

/Users/yonas/Developer/Carthage/Source/carthage/CopyFrameworks.swift:201:6: error: ambiguous use of 'flatMap'
                                .attemptMap { getEnvironmentVariable("SCRIPT_INPUT_FILE_LIST_\($0)") }

Master seems to build ok (just with a lot of warnings), so I guess a new release will fix it. Feel free to close this.

All 3 comments

Hi!

This issue already fixed on this commit.
https://github.com/Carthage/Carthage/commit/52e2cf9c7a4bf04c0f1a0c8f32ffa35f2eed5786#diff-25e106b0a62c856574e29fe6ef5dc460L204

It will be fixed on next version.

0.33.0 is out, so this should be fixed!
https://github.com/Carthage/Carthage/releases/tag/0.33.0

I found an another issue.

Since 0.33.0, SwiftPM was added as dependencies.
https://github.com/Carthage/Carthage/pull/2670/
This dependency prevent building Carthage as dependency from other packages.

It seems to be SwiftPM's bug rather than Carthage's issue.

SwiftPM couldn't treat non semver tag well. (lilke swift-DEVELOPMENT-SNAPSHOT-2019-03-04-a)
It means SwiftPM can't treat itself. 馃槄

You can avoid this problem using .revision instead of another version operators.

I'll make an issue on Swift Jira.

let package = Package(
    name: "CarthageSwiftPM",
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .library(
            name: "CarthageSwiftPM",
            targets: ["CarthageSwiftPM"]),
    ],
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        // It works
         .package(url: "https://github.com/Carthage/Carthage", .revision("c8ac06e106b6b61f907918bfb2b7a5c432de4678")),
        // Don't work
        // .package(url: "https://github.com/Carthage/Carthage", .exact("0.33.0")),
        // .package(url: "https://github.com/Carthage/Carthage", .upToNextMinor(from: "0.33.0")),
    ],
    targets: [
        // Targets are the basic building blocks of a package. A target can define a module or a test suite.
        // Targets can depend on other targets in this package, and on products in packages which this package depends on.
        .target(
            name: "CarthageSwiftPM",
            dependencies: ["Carthage"]),
        .testTarget(
            name: "CarthageSwiftPMTests",
            dependencies: ["CarthageSwiftPM"]),
    ]
)
$ swift build
error: the package carthage[https://github.com/Carthage/Carthage] @ 0.33.0 contains incompatible dependencies:
    swift-package-manager[https://github.com/apple/swift-package-manager.git] @ swift-DEVELOPMENT-SNAPSHOT-2019-03-04-a
Was this page helpful?
0 / 5 - 0 ratings