You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
swift --version
Apple Swift version 5.3.1 (swiftlang-1200.0.41 clang-1200.0.32.8)
Target: x86_64-apple-darwin20.1.0
swift package --version
Swift Package Manager - Swift 5.3.0
OS
macOS Big Sur 11.0.1
Additional Detail from JIRA
Votes
0
Component/s
Compiler
Labels
Bug
Assignee
None
Priority
Medium
md5: ff382bc6885dcb70a6929ab9630082ef
Issue Description:
Overview
The following code is compiled successfully with `swiftc FH.swift`.
If, on the other hand, a Swift package contains the same file in Source directory, `swift build` will fail with message "error: protocol 'FH' requires 'write(contentsOf: )' to be available in macOS 10.15.0 and newer".
// swift-tools-version:5.3// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
letpackage=Package(
name:"FH",
platforms:[.macOS(.v10_15),.iOS(.v13),.watchOS(.v6),.tvOS(.v13),],
products:[// Products define the executables and libraries a package produces, and make them visible to other packages..library(
name:"FH",
targets:["FH"]),],
dependencies:[// Dependencies declare other packages that this package depends on.// .package(url: /* package url */, from: "1.0.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 this package depends on..target(
name:"FH",
dependencies:[]),])
Note
`swift build` did succeed on macOS Catalina.
The text was updated successfully, but these errors were encountered:
This is expected behavior. The witness of the protocol requirement is defined in the SDK and has availability of macOS 10.15.4, which is later than the macOS 10.15 availability of the protocol FH. That means that between versions 10.15.0 and 10.15.4 the FileHandle type cannot satisfy the requirement.
The difference in behavior that you see is explained by the deployment target that is specified. When the deployment target is macOS 10.15.4 or higher then the requirement will always available.
Environment
swift --version
Apple Swift version 5.3.1 (swiftlang-1200.0.41 clang-1200.0.32.8)
Target: x86_64-apple-darwin20.1.0
swift package --version
Swift Package Manager - Swift 5.3.0
OS
macOS Big Sur 11.0.1
Additional Detail from JIRA
md5: ff382bc6885dcb70a6929ab9630082ef
Issue Description:
Overview
The following code is compiled successfully with `swiftc FH.swift`.
If, on the other hand, a Swift package contains the same file in Source directory, `swift build` will fail with message "error: protocol 'FH' requires 'write(contentsOf: )' to be available in macOS 10.15.0 and newer".
FH.swift
Package.swift
Note
`swift build` did succeed on macOS Catalina.
The text was updated successfully, but these errors were encountered: