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

[SR-9773] Cannot build package that has a dependency with superset platform specification #4732

Closed
mxcl opened this issue Jan 27, 2019 · 3 comments
Labels

Comments

@mxcl
Copy link
Contributor

mxcl commented Jan 27, 2019

Previous ID SR-9773
Radar rdar://problem/47581670
Original Reporter @mxcl
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

macOS 10.14.2

Xcode 10.2-beta1

xcode-select set to the above Xcode.

Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: 5015c1acde5c56e90c879bb00f30428a

Issue Description:

If you try to build https://github.com/mxcl/swift-sh (`swift package update` first) with Swift 5’s `swift build` it errors:

$ swift build
Fetching https://github.com/mxcl/Path.swift
Completed resolution in 0.81s
Cloning https://github.com/mxcl/Path.swift
Resolving https://github.com/mxcl/Path.swift at 0.8.0
error: the product 'Path' requires minimum platform version 3.0 for watchos platform
error: the product 'Path' requires minimum platform version 10.0 for tvos platform

The dependency, Path.swift, has a `Package@swift-5.0.swift` which specifies its platforms:

pkg.platforms = [
   .macOS(.v10_10), .iOS(.v8), .tvOS(.v10), .watchOS(.v3)
]

Whilst `swift-sh` only supports macOS.

I believe it should be possible to build a package that only has a subset of its dependencies platforms.

@ankitspd
Copy link
Member

#1956

@mxcl
Copy link
Contributor Author

mxcl commented Feb 4, 2019

Confirmed fixed in Xcode 10.2 beta2, thanks so much!

@mxcl
Copy link
Contributor Author

mxcl commented Feb 5, 2019

Actually, I was wrong.

This is for a Package.swift with this form:

// swift-tools-version:5.0
import PackageDescription
 
let pkg = Package(name: "Mixer")
pkg.products = [
    .executable(name: "mixer", targets: ["mixerExe", "Mixer", "Base"]),
]
pkg.dependencies = [
    .package(url: "https://github.com/mxcl/Path.swift", from: "0.12.1"),
]
pkg.targets = [
    .target(name: "Mixer", dependencies: ["SwiftPM", "Base", "Path"], path: "Mixer"),
]
pkg.platforms = [
    .macOS(.v10_14)
]
pkg.swiftLanguageVersions = [
    .v5
]

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants