mxcl/Path.swift

import Path // mxcl/Path.swift ~> 1.0.0 not working with Xcode 11.4

c0diq opened this issue · 6 comments

c0diq commented

I have a script

#!/usr/bin/swift sh

import Commander // @kylef ~> 0.9.1
import Environment // @wlisac ~> 0.11.1
import Foundation
import Path // mxcl/Path.swift ~> 1.0.0
import ShellOut // @JohnSundell ~> 2.0.0

When I run it with Xcode 11.3.1 command-line tools, it compiles fine.
When I runt it with Xcode 11.4 command-line tools, I get the following error:

Resolving https://github.com/mxcl/Path.swift.git at 1.0.1
'lint' /Users/srebaud/Library/Developer/swift-sh.cache/6d4dfe72d3b82da83c126a62c089349f: error: dependency 'Path' in target 'lint' requires explicit declaration; reference the package in the target dependency with '.product(name: "Path", package: "Path.swift")'
error: 1 <(/usr/bin/swift build -Xswiftc -suppress-warnings)

In both cases, the Package.swift is identical:

// swift-tools-version:5.2
import PackageDescription

let pkg = Package(name: "lint")

pkg.products = [
    .executable(name: "lint", targets: ["lint"])
]
pkg.dependencies = [
    .package(url: "https://github.com/kylef/Commander.git", .upToNextMajor(from: "0.9.1")),
    .package(url: "https://github.com/wlisac/Environment.git", .upToNextMajor(from: "0.11.1")),
    .package(url: "https://github.com/mxcl/Path.swift.git", .upToNextMajor(from: "1.0.0")),
    .package(url: "https://github.com/JohnSundell/ShellOut.git", .upToNextMajor(from: "2.0.0"))
]
pkg.targets = [
    .target(name: "lint", dependencies: ["Commander", "Environment", "Path", "ShellOut"], path: ".", sources: ["main.swift"])
]

#if swift(>=5) && os(macOS)
pkg.platforms = [
   .macOS(.v10_15)
]
#endif
mxcl commented

This is a bug with swift-sh, we have tickets open there.

c0diq commented

Was this ever resolved? I have the same error

"This is a bug with swift-sh, we have tickets open there." @mxcl can you link said tickets?

mxcl commented

We believe it is fixed with the latest version 2.0.0