Skip to content
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

PactSwift doesn't build on CI with SPM #83

Closed
atkinsa1 opened this issue Nov 4, 2021 · 2 comments
Closed

PactSwift doesn't build on CI with SPM #83

atkinsa1 opened this issue Nov 4, 2021 · 2 comments
Labels
bug Something isn't working enhancement New feature or request tech Something technical that doesn't fit a feature or enhancement

Comments

@atkinsa1
Copy link

atkinsa1 commented Nov 4, 2021

🗣 Context

Hi there,
We're running into a known issue with XCode 13 and PactSwift when installed via SPM on our CI. (Strangely enough this works fine when building locally).

💬 Narrative

When I install PactSwift as a package dependency, when compiling, the build complains that it can't import module PactSwiftMockServer.
I'm guessing that this is the known issue in xcode 13 described in the release notes:
Using Swift packages with binary targets may result in a “no such module” error when attempting to import the module of a binary target. (77465707)

In order to resolve we have temporarily built PactSwift as an xcframework and linked it manually, but obviously this is less than ideal.

Would it be possible to include PactSwiftMockServer so it is not a SPM dependency?

Obviously we have a workaround so this is not urgent, and it may get fixed in an upcoming xcode. I just wanted to make you aware.

Thank you!

@atkinsa1 atkinsa1 added the enhancement New feature or request label Nov 4, 2021
@atkinsa1 atkinsa1 changed the title PactSwift doesn't work on CI with SPM PactSwift doesn't build on CI with SPM Nov 4, 2021
@surpher
Copy link
Owner

surpher commented Nov 5, 2021

There is a known bug in SPM where this can occur like you mentioned. It happens when a dependency pulls in a binary dependency. This is the case here where PactSwift depends on PactSwiftMockServer which is vended as a binary.

As you've left in the description above: https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes and search for 77465707.

Unfortunately it is not possible to pull in a non-binary dependency because it would be 400MB+, and I can't afford to pay for all the bandwidth and GitHub LFS for an open source project.

I'm considering an architecture where one can provide their own PactSwiftMockServer, but haven't come up with something reliable and simple enough. I've got a plan to pull the dependencies into one repo too, maybe that will help?

The approach you are taking would be best for the time being. Another is me making PactSwift to vend a binary (XCFramework) through SPM and not source, and it would/should contain all its dependencies so no down the line dependency issues?

@surpher surpher added bug Something isn't working question Further information is requested tech Something technical that doesn't fit a feature or enhancement and removed question Further information is requested labels Nov 5, 2021
@surpher
Copy link
Owner

surpher commented Nov 22, 2021

Apparently this has been resolved in Xcode 13.2 Beta 2:

Resolved in Xcode 13.2 Beta 2:
Resolved an issue where Swift packages with binary targets sometimes failed with a “no such module” error when attempting to import the module of a binary target. (77465707)

https://developer.apple.com/documentation/xcode-release-notes/xcode-13_2-release-notes

If you could, can you give it a spin and see if it is still failing? I for some reason haven't hit this issue. I pretty much exclusively use GitHub actions and Buildkite with our own Mac Mini agent.

@surpher surpher closed this as completed Jul 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request tech Something technical that doesn't fit a feature or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants