tayloraswift / swift-json

high-performance json parsing and encoding for server applications
https://swiftinit.org/docs/swift-json
Apache License 2.0
75 stars 5 forks source link

Conflicting platform requirements between JSON and Grammar #73

Closed t089 closed 7 months ago

t089 commented 7 months ago

After a fresh swift package update, my project fails to build. Not sure if this is a SPM bug or indeed a configuration problem:

error: the library 'JSON' requires macos 10.13, but depends on the product 'Grammar' which requires macos 10.15; consider changing the library 'JSON' to require macos 10.15 or later, or the product 'Grammar' to require macos 10.13 or earlier.
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "swift-example-app",
    platforms: [
        .macOS(.v10_15)
    ],
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        // .package(url: /* package url */, from: "1.0.0"),
        .package(url: "https://github.com/kelvin13/swift-json", from: "0.3.0"),
        .package(url: "https://github.com/apple/swift-system", from: "1.0.0"),
        .package(url: "https://github.com/swift-server/async-http-client.git", from: "1.9.0"),
        .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.6.0"),
        .package(url: "https://github.com/grpc/grpc-swift.git", from: "1.11.0"),

    ],
    targets: [ /* ... */ ]
)
swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Target: arm64-apple-macosx13.0
t089 commented 7 months ago

Adding

platforms: [ .macOS(.v10_15) ],

to Package.swift of swift-json fixes the issue, indeed.