microsoft / onnxruntime-swift-package-manager

A light-weight repository for providing Swift Package Manager support for ONNX Runtime.
MIT License
30 stars 10 forks source link

Unable to Install Swift Package, "unsafe build flags" #6

Closed anthonydito closed 11 months ago

anthonydito commented 11 months ago

I have a Package.swift that looks like:

// 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: "MyPackage",
    products: [
        // Products define the executables and libraries a package produces, making them visible to other packages.
        .library(
            name: "MyPackage",
            targets: ["MyPackage"]),
    ],
    dependencies: [
        .package(url: "https://github.com/microsoft/onnxruntime-swift-package-manager", from: "1.15.0"),
    ],
    targets: [
        .target(name: "MyPackage", dependencies: [
            .productItem(name: "onnxruntime", package: "onnxruntime-swift-package-manager", moduleAliases: nil, condition: nil)
        ], resources: [
            .process("Resources")
        ]),
        .testTarget(
            name: "MyPackageTests",
            dependencies: ["MyPackage"]),
    ]
)

Resulting in the following error:

Screenshot 2023-09-14 at 10 02 35 PM

Is there any way around this issue?

anthonydito commented 11 months ago

I solved this using a specific revision. Seems like SPM does not allow some flags in versioned packages.

    dependencies: [
        .package(url: "https://github.com/microsoft/onnxruntime-swift-package-manager", revision: "cdaadfe"),
    ],