Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPM: package 'Embassy' contains no targets #86

Closed
tlk opened this issue Dec 8, 2019 · 4 comments
Closed

SPM: package 'Embassy' contains no targets #86

tlk opened this issue Dec 8, 2019 · 4 comments

Comments

@tlk
Copy link

tlk commented Dec 8, 2019

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
$
@tlk
Copy link
Author

tlk commented Dec 8, 2019

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

@tlk
Copy link
Author

tlk commented Dec 8, 2019

A new release would be most appreciated :-)

@gregjlee
Copy link
Contributor

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

@tlk
Copy link
Author

tlk commented Dec 20, 2019

Excellent, thank you @gregjlee!

tlk added a commit to tlk/beoplay-macos-remote-cli that referenced this issue Dec 20, 2019
SPM issue has been resolved, see envoy/Embassy#86
@tlk tlk closed this as completed Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants