danger / swift

⚠️ Stop saying "you forgot to …" in code review
https://danger.systems/swift/
MIT License
1.05k stars 140 forks source link

Compilation fails on Xcode 14.3.1 #587

Closed enlivn closed 1 year ago

enlivn commented 1 year ago

Hello, On our CI (Bitrise) machines, we've noticed this morning (2023/06/02) that Danger has started to fail with this error message:

error: compiled module was created by a different version of the compiler; rebuild 'Danger' and try again

This coincides with the release of Xcode 14.3.1 that has changed the Swift version used. I'm guessing this is the issue but not totally sure. Compare the last column:

Xcode 14.3.1 Release 14E300c 1 Jun 2023 macOS 13.0+ Swift 5.8.1 (5.8.0.124.5)
Xcode 14.3 Release 14E222b 30 Mar 2023 macOS 13.0+ Swift 5.8 (5.8.0.124.2)  

More info on our CI stacks:

Any thoughts or suggestions on workarounds? Is there a plan to address this with a new release?

f-meloni commented 1 year ago

Brew install should compile danger with the current selected Xcode so it should work. Is Xcode 14.3.1 selected as current Xcode when you run brew install? Is possible that Danger swift is already installed in the machine by default, so brew doesn't re compile it, and the installed version was compiled with an older Xcode?

enlivn commented 1 year ago

Yes, that was exactly it @f-meloni! Glad I came back to close this ticket haha. Bitrise had the old version of it cached. 🤦🏾

Thanks for your quick response.

GianniCarlo commented 1 year ago

@enlivn I'm running into a similar issue with a Bitrise setup as well, my builds were passing earlier today, and suddenly started failing with this error, and the only difference is Xcode 14.3 and 14.3.1 being used, what solution did you go with? just force the brew install? or is there another option?

enlivn commented 1 year ago

@enlivn I'm running into a similar issue with a Bitrise setup as well, my builds were passing earlier today, and suddenly started failing with this error, and the only difference is Xcode 14.3 and 14.3.1 being used, what solution did you go with? just force the brew install? or is there another option?

@GianniCarlo sorry, just seeing your message. I just force the installation.

brew reinstall danger/tap/danger-swift

Not ideal since it adds a bit of runtime to every build but I haven't been able to bust the cache that Bitrise maintains and I didn't have much time to look into it.

GianniCarlo commented 1 year ago

@enlivn no worries, thanks for the follow up, we also had to do the reinstall :/