envoy / Embassy

Super lightweight async HTTP server library in pure Swift runs in iOS / MacOS / Linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SPM: package 'Embassy' contains no targets

tlk opened this issue · comments

This project cannot be used as a dependency with the current version of Swift Package Manager.

I believe this has been addressed partially in #74 but the latest release 4.1.0 does not include the fix. Consequently, SPM fails when this package is specified as a dependency.

As suggested in #80 bumping the release number of this project (adding a tag) will most likely solve this issue.

Steps to reproduce:

$ swift --version
Apple Swift version 5.1.2 (swiftlang-1100.0.278 clang-1100.0.33.9)
Target: x86_64-apple-darwin19.0.0
$ swift package init
Creating library package: test
Creating Package.swift
Creating README.md
Creating .gitignore
Creating Sources/
Creating Sources/test/test.swift
Creating Tests/
Creating Tests/LinuxMain.swift
Creating Tests/testTests/
Creating Tests/testTests/testTests.swift
Creating Tests/testTests/XCTestManifests.swift
$ 
$ vim Package.swift   # Embassy was added manually as a dependency in Package.swift
$ 
$ cat Package.swift
// swift-tools-version:5.1
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "test",
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .library(
            name: "test",
            targets: ["test"]),
    ],
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        // .package(url: /* package url */, from: "1.0.0"),
        .package(url: "https://github.com/envoy/Embassy.git", from: "4.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: "test",
            dependencies: ["Embassy"]),
        .testTarget(
            name: "testTests",
            dependencies: ["test"]),
    ]
)
$ swift build
'Embassy' /Users/tlk/test/.build/checkouts/Embassy: error: package 'Embassy' contains no targets
warning: dependency 'Embassy' is not used by any target
$

This issue affects all projects that depends on this project, including the Ambassador project: envoy/Ambassador#53

A new release would be most appreciated :-)

Just made a new release with the target fix https://github.com/envoy/Embassy/releases/tag/v4.1.1

Excellent, thank you @gregjlee!