swift: Danger was created for incompatible target arm64-apple-macosx10.10

Hello,

I’m trying to move the Danger step of our CI to a Mac Mini M1 for efficiency (pulling the docker image takes too much time for a short CI) and it doesn’t work as expected:

$ danger-swift pr https://github.com/danger/swift/pull/146
Starting Danger PR on danger/swift#146
You don't have a DANGER_GITHUB_API_TOKEN set up, this is optional, but TBH, you want to do this
Check out: http://danger.systems/js/guides/the_dangerfile.html#working-on-your-dangerfile
/var/folders/sp/0r2dd4g549s9w7n8mhwlb9q00000gn/T/_tmp_dangerfile.swift:1:8: error: module 'Danger' was created for incompatible target arm64-apple-macosx10.10: /opt/homebrew/lib/danger/Danger.swiftmodule
import Danger
       ^

ERROR: Dangerfile eval failed at Dangerfile.swift
ERROR: Could not get the results JSON file at /var/folders/sp/0r2dd4g549s9w7n8mhwlb9q00000gn/T/danger-response.json

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


sh
/var/folders/sp/0r2dd4g549s9w7n8mhwlb9q00000gn/T/_tmp_dangerfile.swift:1:8: error: module 'Danger' was created for incompatible target arm64-apple-macosx10.10: /opt/homebrew/lib/danger/Danger.swiftmodule
import Danger
       ^
ERROR: Dangerfile eval failed at Dangerfile.swift
ERROR: Could not get the results JSON file at /var/folders/sp/0r2dd4g549s9w7n8mhwlb9q00000gn/T/danger-response.json

I’ve got this issue on the Mac Mini but it’s running without any issue on my Macbook (also M1) and I cannot find why. I already tried to re-install danger-js and danger-swift. I’ve cleaned the homebrew install and rebuild it. still the same.

Any idea? Thanks

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 31 (16 by maintainers)

Most upvoted comments

I don’t know if that helps you at all or not, but what @f-meloni wrote in https://github.com/danger/swift/issues/464#issuecomment-1006019283 is exactly how we use Danger-Swift on both Intel and Apple Silicon Macs and it works absolutely fine. We install Danger-JS (and SwiftLint) via Homebrew using brew install danger/tap/danger-js swiftlint. This installs Intel variants of them even on Apple Silicon but everything works fine in our setup.

A couple more details:

  • I don’t like things on the repository root, so I put everything related to Danger in a subdirectory called Danger/: Bildschirm­foto 2022-10-21 um 08 18 47
  • Danger/Danger/DummyForDanger.swift is just this: Bildschirm­foto 2022-10-21 um 08 20 25
  • Danger/Package.swift is as described above: Bildschirm­foto 2022-10-21 um 08 22 17
  • On CI (buildkite), this is the script that triggers Danger Swift: Bildschirm­foto 2022-10-21 um 08 23 32

[FYI] Installing danger-js via Homebrew has been fully-compatible with arm64 since 11.2.1! ref: https://github.com/danger/danger-js/pull/1342

I updated danger-js to the latest version and tried running danger-swift with some PR. It works!

$ brew upgrade danger-js
$ danger-swift pr https://github.com/danger/swift/pull/565 --danger-js-path /opt/homebrew/bin/danger