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

Codegen CLI versioning between Swift packages and Xcode project #3311

Closed
swizzlr opened this issue Jan 9, 2024 · 3 comments
Closed

Codegen CLI versioning between Swift packages and Xcode project #3311

swizzlr opened this issue Jan 9, 2024 · 3 comments
Labels
bug Generally incorrect behavior needs investigation

Comments

@swizzlr
Copy link

swizzlr commented Jan 9, 2024

Summary

Users may inadvertently generate Apollo code using a version different to that resolved by Xcode.

Version

n/a

Steps to reproduce the behavior

When using the command line to install the Apollo codegen CLI, the CLI is resolved by SPM to either that specified in the lockfile, or the latest satisfiable.

Xcode projects that use Swift Packages will not use the Package.resolved for these packages since the only sensible pinning is provided by Xcode itself. For example, an overall Xcode project using 1.6.1 may inadvertently have 1.7.1 code generated if the Apollo dependency is specified within a Swift Package.

I encountered this with an automated script we use and don't currently have a good workaround. I wanted to report this "bug" here since it seemed prudent for it to be noted in documentation that when using Apollo from a package within an Xcode project, the CLI MUST be installed via the Xcode right click action, so that it uses the appropriate Apollo version.

Logs

No response

Anything else?

No response

@swizzlr swizzlr added bug Generally incorrect behavior needs investigation labels Jan 9, 2024
@calvincestari
Copy link
Member

Hi @swizzlr 👋🏻 - can you please share more details about your project and the need for two Apollo iOS dependencies. You mentioned an automated script but it's not a typical configuration and could lead to some adverse behaviour besides what you're seeing here.

@AnthonyMDev
Copy link
Contributor

I'm closing this issue due to inactivity. If this is still unresolved, feel free to provide more information and we can re-open this, or create a new issue.

@AnthonyMDev AnthonyMDev closed this as not planned Won't fix, can't repro, duplicate, stale Mar 8, 2024
Copy link

github-actions bot commented Mar 8, 2024

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.

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

No branches or pull requests

3 participants