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

apollo-ios-xcframework is built twice by Carthage #3308

Closed
CraigSiemens opened this issue Dec 22, 2023 · 2 comments · Fixed by apollographql/apollo-ios-xcframework#9
Closed
Assignees
Labels
bug Generally incorrect behavior

Comments

@CraigSiemens
Copy link
Contributor

CraigSiemens commented Dec 22, 2023

Summary

When apollo-ios-xcframework is added as a dependency using Carthage, it is built two times even though it only produces one framework.

Version

1.7.1

Steps to reproduce the behavior

  • Add apollographql/apollo-ios-xcframework as a Carthage dependency in a project.
  • Run carthage build
  • See that it builds Apollo twice.

Logs

*** Building scheme "Apollo" in Apollo.xcworkspace
*** Building scheme "Apollo" in Apollo.xcworkspace

Anything else?

It appears to be caused by there being two schemes in the workspace with the name Apollo. Running xcodebuild -list in the repo shows the following.

Information about project "Apollo":
    Targets:
        Apollo
        ApolloAPI
        ApolloSQLite
        ApolloWebSocket

    Build Configurations:
        Debug
        Release

    If no build configuration is specified and -scheme is not passed then "Release" is used.

    Schemes:
        Apollo
        Apollo
        Apollo-Dynamic
        ApolloAPI
        ApolloSQLite
        ApolloTestSupport
        ApolloWebSocket
        InstallCLI

One is the shared scheme in the project and the other is autogenerated from the swift package target also called Apollo. Carthage then builds each scheme it finds that has the same name as a shared scheme in the project. Since two have the same name, it builds them twice.

A workaround seems to be renaming the scheme before running Carthage, then there's only one listed scheme that matches the name of a shared scheme.

mv Carthage/Checkouts/apollo-ios-xcframework/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo.xcscheme \
Carthage/Checkouts/apollo-ios-xcframework/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo-Framework.xcscheme

Related issue Carthage/Carthage#3358

@BobaFetters
Copy link
Member

@CraigSiemens Thanks for reporting this, I will take a look at this as soon as I can to see what I can do to resolve it

@BobaFetters
Copy link
Member

@CraigSiemens Turns out this was a pretty simple fix, PR is up here and it will go out when we do our next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Generally incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants