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

Can't build Carthage with SPM in Swift 5 #2752

Closed
yonaskolb opened this issue Apr 1, 2019 · 3 comments
Closed

Can't build Carthage with SPM in Swift 5 #2752

yonaskolb opened this issue Apr 1, 2019 · 3 comments

Comments

@yonaskolb
Copy link

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.

@giginet
Copy link
Member

giginet commented Apr 3, 2019

Hi!

This issue already fixed on this commit.
52e2cf9#diff-25e106b0a62c856574e29fe6ef5dc460L204

It will be fixed on next version.

@mdiep
Copy link
Member

mdiep commented Apr 3, 2019

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

@mdiep mdiep closed this as completed Apr 3, 2019
@giginet
Copy link
Member

giginet commented Apr 4, 2019

I found an another issue.

Since 0.33.0, SwiftPM was added as dependencies.
#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

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

No branches or pull requests

3 participants