swift icon indicating copy to clipboard operation
swift copied to clipboard

Running danger-swift installed via Mint caught error.

Open 417-72KI opened this issue 4 years ago • 6 comments

It seems to be supported Mint in #274, so I tried using it in Docker image (Dockerfile).

However, when running it following error occurs.

$ danger-swift local
ERROR: Could not find a libDanger to link against at any of: [".build/debug", ".build/x86_64-unknown-linux/debug", ".build/release", "/usr/local/lib/danger"]
Or via Homebrew, or Marathon

Danger: ⅹ Failing the build, there is 1 fail.
## Failures
danger-swift` failed.
## Markdowns
### Log


```sh
ERROR: Could not find a libDanger to link against at any of: [".build/debug", ".build/x86_64-unknown-linux/debug", ".build/release", "/usr/local/lib/danger"]
Or via Homebrew, or Marathon

```

Any solution? or must install manually?

417-72KI avatar Jan 10 '20 02:01 417-72KI

Really interesting, is missing the danger frameworks, I will have a look at it soon, but in the meantime I would suggest you to use brew.

f-meloni avatar Jan 10 '20 13:01 f-meloni

I am having the same trouble using the package manger on Travis.

If I install using brew then I am having an issue with XCodeSummary not working and giving me an error. This was working with 2.0.6 but I have since decided to go ahead and use PM to lock down versions at 2.0.6.

In my before install shell script I run:

npm install -g danger swift build

and I am caching the ./build and the ~/.danger-swift directories.

My package looks like:

// 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: "DangerTarget",
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .library(
            name: "DangerTarget",
            targets: ["DangerTarget"]),
    ],
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        .package(url: "https://github.com/danger/swift.git", from: "2.0.6")
    ],
    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: "DangerTarget",
            dependencies: [],
			path: ".",
			sources: ["dummy.swift"]),
    ]
)

scottandrew avatar Jan 14 '20 23:01 scottandrew

@scottandrew You will need to change a little bit your Packge.swift Will add a note on each changed line to show why needs to be changed.

// 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: "DangerTarget",
    products: [
        .library(
            name: "DangerDeps", // Danger needs to build this library, then its name needs to start with DangerDeps in order to be identified by Danger
            type: .dynamic, // If the type is not dynamic Danger can not link it to the Dangerfile compilation
            targets: ["DangerTarget"]),
    ],
    dependencies: [
        .package(url: "https://github.com/danger/swift.git", from: "2.0.6"),
        .package(url: "https://github.com/f-meloni/danger-swift-xcodesummary", from: "1.0.0"), // You said you wanted to use DangerXCodeSummary, then you need to declare it as dependency
    ],
    targets: [
        .target(
            name: "DangerTarget",
            dependencies: ["Danger", "DangerXCodeSummary"], // You need to put here all the dependencies you want to link to the Dangerfile compilation
	    path: ".",
	    sources: ["dummy.swift"]),
    ]
)

For more details have a look at https://github.com/danger/swift#swift-package-manager-more-performant If you have any additional issue with this, please open a specific issue.

f-meloni avatar Jan 15 '20 22:01 f-meloni

Hello @f-meloni any updates on this thread I am also facing the same issue

ronak1garg avatar Dec 16 '21 09:12 ronak1garg

Hey guys, we've hit a similar problem that becomes apparent on Apple Silicon machines regarding the libDanger target. Attempted to get everything imported via brew, mint, and a vanilla shell project with direct swift runs via:

SDKROOT=macosx 
swift run -c release danger-swift edit

With no luck on any front. If danger-swift is available, then going into project edit mode immediately reveals errors for missing binaries and unsupported targets.

image

It looks like the last release update was in November, so wasn't sure if any progress was being made here.

blevass3-ford avatar Feb 21 '22 17:02 blevass3-ford

The part of the readme specifying Mint support was removed in #503, it seems.

colejd avatar Sep 29 '22 17:09 colejd