SwiftPackageIndex / SwiftPackageIndex-Server

The Swift Package Index is the place to find Swift packages!
https://swiftpackageindex.com
Apache License 2.0
538 stars 42 forks source link

Build failure due to code signing error #3205

Closed jessesquires closed 2 months ago

jessesquires commented 2 months ago

One of my packages, Foil, is failing to build because of a code signing error, and thus reporting invalid platform compatibility.

It's very possible that "I'm holding it wrong", but I'm not sure.

Explain the steps needed to reproduce the bug

Here's the build failure on the website: https://swiftpackageindex.com/builds/69432FC0-F57D-40A2-B1DB-0BA725D9A39D

error: Signing for "FoilTests" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'FoilTests' from project 'Foil')

I'm not sure why it's complaining about code signing. My unit tests for all supported platforms succeed on GitHub Actions. You can find my successful GH Actions workflow here to see what I'm passing to xcodebuild. I pass CODE_SIGN_IDENTITY="-", which it looks like SPI does not do.

Curiously, the macOS build on SPI does succeed.

What was the expected behaviour?

Builds should succeed for macOS, iOS, tvOS, watchOS, and visionOS on the main branch for at least Swift 5.10 and above.

Additional context

All of my projects and packages are setup in basically the same way.

My other similarly configured package, ReactiveCollectionsKit does not have this problem. It builds successfully: https://swiftpackageindex.com/builds/502B6007-2423-4B8D-AD70-52478B737091

I checked the code signing settings for both projects and they are the same. So I'm not sure why ReactiveCollectionsKit succeeds but Foil fails...

finestructure commented 2 months ago

I'll need to take a closer look in the morning but at first glance I suspect it's due to how the Foil scheme we're building is set up. I noticed it's trying to build FoilTests in the failing build. That's probably not what we want in this case - we're typically just building the actual product since we're not running tests.

It might not be the actual problem but it's something that was problematic in the past and maintainers worked around it by making sure the scheme we're building doesn't include tests.

jessesquires commented 2 months ago

@finestructure ugh, I think you are correct! I just fixed my scheme settings. I had "Run" checked for FoilTests under the Build configurations for the Foil scheme. 🤦🏼 What a derpy mistake. 😅

I'll need to take a closer look in the morning

Hopefully we'll have new build results by this time to confirm the fix. 😄

finestructure commented 2 months ago

Great to hear you may have found a simple solution!

The builds are likely to take a little extra time to come through, because we've just kicked off a new round of Swift 6 builds with Xcode 16b3.

I'll keep an eye on the results!

jessesquires commented 2 months ago

hey @finestructure Looks like something else is wrong now.

I'm no longer seeing builds for the main branch: https://swiftpackageindex.com/jessesquires/Foil/builds

(They failures for the latest tagged release are expected, as that tag doesn't include the fix)

finestructure commented 2 months ago

Hi @jessesquires , this is unfortunately due to the 100k Xcode 16b3 builds we've started processing Tuesday afternoon. Your main branch builds disappeared because we detected the update to the branch but our build system is currently a bit slow in picking up new builds as we churn through the backlog. It should sort itself out soon!

jessesquires commented 2 months ago

Hey @finestructure looks like the builds caught up and everything looks good now!

Thanks for your help! 😄 🙌🏼

finestructure commented 2 months ago

That's great, thanks for keeping an eye on it!