danger / danger/swift

ERROR: Could not find a libDanger to link against

Open
#541 6 comments 2 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
1.1k
Forks
152
Avg merge
9h 54m
Merged PRs (30d)
2

Description

Hi, I am experiencing an error when trying to run danger-swift built with SPM.

After running
`npm install -g danger`
`swift build`
`swift run danger-swift edit`

I get the following error:

```
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", "/opt/homebrew/lib/danger"]
Or via Homebrew, or Marathon
```

My Package.swift:
```
// swift-tools-version:5.5
import PackageDescription

let package = Package(
name: "DangerDependencies",
products: [
.library(
name: "DangerDeps",
type: .dynamic,
targets: ["DangerDependencies"]),
],
dependencies: [
.package(url: "https://github.com/danger/swift.git", from: "3.14.2"),
],
targets: [
.target(
name: "DangerDependencies",
dependencies: [
.product(name: "Danger", package: "swift"),
]),
])
```

There is a libDangerDeps.dylib in `.build/debug` but of course, no `libDanger.dylib`.
I've tried a plethora of solutions gleaned from searching the issues on the repository to no avail. What have I missed?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the reported Package.swift and reproduce the sequence of npm install -g danger, swift build, and swift run danger-swift edit. Inspect .build/debug, including the reported libDangerDeps.dylib, and compare it with the library name the command searches for. Done means the SPM-built package can run danger-swift edit without the libDanger linking error.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
build-system, cli, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.