-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
Dangerfile cannot be compiled when using Xcode 16 #615
Comments
I could reproduce the problem with Xcode 16 beta 6 (16A5230g). Do we have any updates about this issue or a possible workaround? Thank you! |
I just ran into this issue with Xcode 16.0 RC 1 (16A242). Is there any update on this? |
Same here with RC |
Is it possible that it thinks you are referring to the Danger module and not the Danger function? |
Unfortunately, this doesn’t solve the issue:
|
This might help. Got it working locally.
|
That’s interesting! So if re-building Danger Swift using Xcode 16 fixes the issue, I guess a new release of Danger that was built using Xcode 16 could resolve this? |
Nope, just tested it with 3.19.1, not working for me. So still need to stick to that workaround so far. |
3.19.1 also doesn’t work for me but I also don’t know what version of Xcode was used to build that. |
Danger is built in your machine. When you install it via brew it runs the install script in your machine. |
Ah right, thanks for the clarification! But that just makes it more interesting that what @CreativeSpaghetti posted works for them 🤔 |
Indeed, it that is the fix, then Danger should work if you force a brew install and have Xcode 16 selected 🤔 |
Unfortunately, that does not seem to change anything 😞
|
tried that |
Don't know if this helps, but I'm using Danger in CircleCI. I specify 3.19.1 in the
Anyway, just wanted to give some more details. Hope this helps. |
The same problem with Dangerfile
|
I'm facing the same issue. Did anyone find a solution for this? I'm using SPM.
|
There seems to be a name conflict between the target swift/Sources/Danger/Danger.swift Lines 90 to 93 in a3c659e
I guess that's why the error says cannot call value of non-function type 'module'. Not sure why this is happening now with Xcode 16 / Swift 6 but I got it working renaming the function Renaming the target should work as well |
Thanks for the hint! I forked Danger and renamed all occurrences of the
I tried to pin this dependency to an earlier version to check if it works then, but didn’t succeed in doing that. Regardless, the naming clash really does seem to be an issue. Good find! |
@marcomasser did you try building for release? |
Yes, same result:
Update: It does not make a difference whether the |
Interesting, do you know from where SwiftFormat dependency is coming from? EDIT: nvm, I was able to reproduce adding SwiftFormat to my Package.swift file |
It seems OctoKit is pulling that in. |
Have you tried renaming the product/target to 'DangerSmth'? Looks like that should help. |
Thanks for the suggestion. I tried renaming the I think renaming either the Danger target or the global function both should work and the error about SwiftFormat is just the next issue that is probably not related to this anymore. I just don’t understand why it should be a problem that OctoKit depends on SwiftLint 🤷♂️ Anyway, I looked into this some more and noticed that OctoKit only declares the dependency on SwiftFormat, but doesn’t actually use it. So I forked OctoKit and commented out that line and now this error when running Danger is gone – just for the next one to appear 😩 So now I’m here:
|
After many tries I got it working somehow First, I forked SwiftFormat and OctoKit In SwiftFormat fork I commented out this line Then, in OctoKit fork, I just switch SwiftFormat to point to my fork in the This avoids symbols duplication, I'm not sure why this is a thing now with Swift 6 but I observed that I was getting two different build folders for SwiftFormat Now, with these 2 forks, I was able to override the version used in my Danger setup adding this to my Now, the only way I found to properly link Danger is specifying both Then the usual Danger dynamic lib renaming: And last, run the danger-swift binary: This works for me but I have no clue why specifying both arm and Intel archs seems to do the trick. |
I have tested @abhi-m-simformsolutons's change from #626 and it seemed to fix all the issues. I have released version 3.20.0, let me know if it works! |
Yes! 🥳 |
Good! I will close this issue then, feel free to re open it if needed |
@f-meloni Still experiencing this on the new version:
|
@oronbz this is not using danger-swift from Package.swift, but from brew, I'm working on a fix for that as well, but is not ready yet |
Got it, will wait (: thanks! |
@oronbz you can try now, it should be working |
Same @f-meloni :(
|
Hi 👋
When running danger-swift on a device with Xcode 16 the command fails with this error:
Running locally and on Bitrise - the error is the same.
Using this command:
swift run danger-swift local --cwd ../../
or this on CI
swift run danger-swift ci --no-publish-check -f --cwd ../../
I believe my setup is pretty standard:
Environment
Other Info
My assumption is that
import Danger
doesn't work as expected. Because compiler doesn't see other types and functions. For example,fail
function:Or
DangerDSL
.I tried installing danger-swift from
brew
instead of SMP when running on CI but the result is the same.Full command & result
My Package.swift
My Dangerfile.swift
The text was updated successfully, but these errors were encountered: