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

Request to clear derived data when switch from build for test to build for run #3395

Closed
dvshelley opened this issue Jun 12, 2024 · 8 comments
Labels

Comments

@dvshelley
Copy link

Summary

Since we migrated from Apollo 0.xx to 1.xx, we have regularly been getting an error of this style. Is this a problem with our code or an issue with 1.xx?

image (7)

Doing a build clean gets past the problem. But that is obnoxious as our build times are long.

Version

Apollo 1.12.2

Steps to reproduce the behavior

Build and run to the sim.
Build for test and run unit tests.
Build and run for debugging - get error.

Logs

No response

Anything else?

No response

@dvshelley dvshelley added bug Generally incorrect behavior needs investigation labels Jun 12, 2024
@BobaFetters
Copy link
Member

@dvshelley How is your code generation configured/how are you running it (CLI or SwiftScripting)?

@dvshelley
Copy link
Author

@BobaFetters We use apollo-ios-cli to do our code generation. Does SwiftScripting do slightly different code output?

@BobaFetters
Copy link
Member

@dvshelley The output from cli and scripting would be the same, are you running the cli commands for generating your ocde through a build step/run script in Xcode? I know this was the recommended way to handle code generation pre-1.0 but thats no longer the recommended way to do it, if thats how you have it set up it could cause the issue you are seeing.

@dvshelley
Copy link
Author

@BobaFetters No, we only generate code when we have updated the graphql files. We do that from the command line as needed. We would prefer not to add a new build phase. Our build times are long enough already.

@BobaFetters
Copy link
Member

@dvshelley Ok that's good that is the way we recommend handling the code generation. Would it be possible for you to provide a small sample project that demonstrates the issue? This definitely isn't an expected behavior and a reproduction case would help us in tracking down the issue.

@AnthonyMDev
Copy link
Contributor

We're not really sure if there is anything we can do about this. It seems that it is likely just something to do with Xcode and the way DerivedData and compiled sources are cached (which has always been a bit wonky with Xcode).

It sounds like you are doing everything the way we recommend. If you are able to give us a reproduction case, we can try looking into it more, but I'm not optimistic about us coming up with a solution for this even then. I'm going to close this for now, and if you provide a reproduction case we can consider re-opening.

@AnthonyMDev AnthonyMDev closed this as not planned Won't fix, can't repro, duplicate, stale Aug 9, 2024
Copy link
Contributor

github-actions bot commented Aug 9, 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.

@dvshelley
Copy link
Author

It looks like we were able to fix the issue by changing our project dependencies. Some of our internal frameworks needed a direct reference to Apollo.

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

No branches or pull requests

3 participants