-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Danger was created for incompatible target arm64-apple-macosx10.10 #464
Comments
thanks for your answer @rseki-sonix |
Hi @tibo, |
Hi @f-meloni
|
That is the last version released, I've added this change in that release which I thought would fix it, #462 but unfortunately I don't have an M1 Mac, so was just a try :( |
Once again the weird thing is that is working on my Macbook but not on the Mac Mini. the only difference is that I tried to install it on the Mac Mini few weeks ago, and it was a fresh install on the Macbook. I have my hands on those macs until tuesday (then I have to give them back to the company I'm leaving) |
Can you please try to unistall it in the mac mini and reinstall it as a fresh install? |
I just did |
I've got the same issue locally on an M1 13":
Then I realized I had an old version running: avanderlee@Antoines-MBP Diagnostics % danger-swift --version
3.11.0 While I had the latest already locally. So I force linked it instead: avanderlee@Antoines-MBP Diagnostics % brew link --overwrite danger-swift
Linking /opt/homebrew/Cellar/danger-swift/3.12.0... 24 symlinks created. Resulting in the correct version: avanderlee@Antoines-MBP Diagnostics % danger-swift --version
3.12.0 Yet, same result: avanderlee@Antoines-MBP Diagnostics % danger-swift pr https://github.com/WeTransfer/Diagnostics/pull/91
Starting Danger PR on WeTransfer/Diagnostics#91
/var/folders/85/n4sg5zw90975dnnxj09f2ynm0000gn/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/85/n4sg5zw90975dnnxj09f2ynm0000gn/T/danger-response.json
Danger: ⅹ Failing the build, there is 1 fail.
## Failures
`danger-swift` failed.
## Markdowns
### Log
```sh
/var/folders/85/n4sg5zw90975dnnxj09f2ynm0000gn/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/85/n4sg5zw90975dnnxj09f2ynm0000gn/T/danger-response.json
|
Decided to run Danger-swift locally instead: swift run danger-swift pr https://github.com/WeTransfer/Diagnostics/pull/91 --cwd ../../WeTransfer/Diagnostics But same result |
@AvdLee I see you posted a case that uses I wonder if that is the issue, it should specify the arch when requests to swift to build it 🤔 |
Yes, I tried both running through the brew install as well through a manually build SPM package. What can I do to progress in this issue? |
Same here. I'm installing DangerSwift with Package.swift, and tried both Hardware: M1 Max MacBook Pro 14'' Edited: I've found that under my environment |
I also tried to install Danger Swift using SwiftPM, but no luck here.
I’m running this on an MacBook Pro with M1 Pro, macOS 12.1, Xcode 13.2 (Swift 5.5.2). Note that unsurprisingly, |
@marcomasser can I please see your Package.swift? |
Of course! // swift-tools-version:5.5
import PackageDescription
let package = Package(
name: "MyApp",
dependencies: [
.package(url: "https://github.com/danger/swift.git", from: "3.12.3")
],
targets: [
.target(
name: "MyApp",
dependencies: [.product(name: "Danger", package: "swift")],
path: "Danger",
sources: ["DummyForDanger.swift"]
)
]
) |
I have a tiny bit of progress to report: I tried this with a completely fresh Xcode project, added a
Since we know that - .library(name: "Danger", targets: ["Danger"]),
+ .library(name: "Danger", type: .dynamic, targets: ["Danger"]), Then, I did another
🥳 I suspect that this is an issue I already encountered a while back where SPM and Xcode make different decisions on whether to build a dynamic or a static library. Requesting a dynamic library explicitly seems to fix this. I guess this option was added to SPM after Danger Swift was started? But I don’t know. Also, But when I try to actually run Danger Swift against a real PR, I’m stuck at the same error that is shown in Xcode:
The platform triple
… which is just weird and I don’t know what to do now. |
Just for clarification: Between steps, I manually deleted everything in Also: I also tried using Edit: Just for verification, here’s proof that
|
I just realized that when the problem seems to be that So, running Danger Swift using this command works for me:
Alternatively, it also works without the Note that both approaches still require explicitly declaring the library to be dynamic in - .library(name: "Danger", targets: ["Danger"]),
+ .library(name: "Danger", type: .dynamic, targets: ["Danger"]), |
Can you please try to change your Package to this? // swift-tools-version:5.5
import PackageDescription
let package = Package(
name: "MyApp",
products: [
.library(name: "DangerDeps", type: .dynamic, targets: ["MyApp"])
],
dependencies: [
.package(url: "https://github.com/danger/swift.git", from: "3.12.3")
],
targets: [
.target(
name: "MyApp",
dependencies: [.product(name: "Danger", package: "swift")],
path: "Danger",
sources: ["DummyForDanger.swift"]
)
]
) Danger knows that has to build and link This is how Danger is configured in this repo as well |
Nice, this seems to work fine. Thank you very much for your help! |
Thanks for comments. it' works fine too. My solution is
// swift-tools-version:5.5
import PackageDescription
let package = Package(
name: "MyApp",
defaultLocalization: "en",
products: [
.library(name: "DangerDeps", type: .dynamic, targets: ["MyApp"])
],
dependencies: [
.package(url: "https://github.com/danger/swift.git", from: "3.12.3")
],
targets: [
.target(
name: "MyApp",
dependencies: [.product(name: "Danger", package: "swift")],
path: "",
sources: ["DummyForDanger.swift"]
)
]
)
|
It seems to be a bug on Swift(arm64) compiler or linker. |
I'm sorry but #464 (comment) was not correct and there seems to be something wrong in installing or executing _tmp_dangerfile.swift. I tried this.
import Danger
print("Hello, Danger!")
let danger = Danger()
Then output was Hello, Danger!
ERROR: To execute Danger run danger-swift ci, danger-swift pr or danger-swift local on your terminal and it seems to be succedded to build. |
There would be 2 possible solutions.
|
Hey i wanted to follow up on this issue i am using the Latest Version of Danger swift 3.13.0 installed via SPM i have tried both and according to this comment: #464 (comment) this should have been resolved right ? i am still getting this complier error. My Package.swift file
The Danger & Package.swift file is located in a sub directory As you can see i have explicitly mentioned the platforms as macOS 12 + so i am not sure why its still building for mac os 10.10 could someone please help me figure out what i am doing wrong ? |
Any updates on this issue? 😞 |
This is an issue on Danger-JS (danger/danger-js#1282). |
I don’t know if that helps you at all or not, but what @f-meloni wrote in #464 (comment) 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 A couple more details: |
[FYI] 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 |
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:
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
The text was updated successfully, but these errors were encountered: