Flight-School / AnyCodable

Type-erased wrappers for Encodable, Decodable, and Codable values

Home Page:https://flight.school/books/codable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error building with Swift 5

d4r1091 opened this issue ยท comments

Hey @mattt ,
great library ๐Ÿบ .
I guess there might be an issue with Xcode 10.2 and Swift5.
I've added within the Package.swift in a super simple way:

// swift-tools-version:5.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "****",
    dependencies: [
        .package(path: "https://github.com/Flight-School/AnyCodable.git")
    ]
)

When I run the swift build command I get:
[1] 67199 illegal hardware instruction swift build

Am I doing something wrong?

Thanks ๐Ÿ‘ ๐Ÿš€

commented

@d4r1091 It looks like your package manifest is declaring a remote dependency using package(path:) (which is for repositories on your local system) instead of package(url:from:).

Here's a minimal working Package.swift file with AnyCodable as a dependency:

// swift-tools-version:5.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "Example",
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        .package(url: "https://github.com/Flight-School/AnyCodable.git", from: "0.1.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: "Example",
            dependencies: []
        ),
        .testTarget(
            name: "ExampleTests",
            dependencies: ["Example"]
        ),
    ]
)