danger/swift

Compilation fails on Xcode 14.3.1

enlivn opened this issue · 5 comments

enlivn commented

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:

  • We use Bitrise as noted above
  • We're using Apple Silicon machines with the following configuration:
    image
  • The way we invoke Danger is dead simple:
    brew install danger/tap/danger-swift
    danger-swift ci --failOnErrors
    

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

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

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.

@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

@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.

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