swift
swift copied to clipboard
Running danger-swift installed via Mint caught error.
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?
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.
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 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.
Hello @f-meloni any updates on this thread I am also facing the same issue
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](https://user-images.githubusercontent.com/97960562/155001518-5e175ed0-74c1-49ff-83f3-7cc7bf20c267.png)
It looks like the last release update was in November, so wasn't sure if any progress was being made here.
The part of the readme specifying Mint support was removed in #503, it seems.