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

Xcode Install CLI fails for versions >=1.8 #3333

Open
pjf-amexgbt opened this issue Feb 9, 2024 · 10 comments
Open

Xcode Install CLI fails for versions >=1.8 #3333

pjf-amexgbt opened this issue Feb 9, 2024 · 10 comments
Labels
bug Generally incorrect behavior needs investigation

Comments

@pjf-amexgbt
Copy link

Summary

Xcode is unable to download/install CLI from Xcode from version 1.8 on.

This is what happened in previous versions (including 1.7):

Screenshot 2024-02-08 at 17 07 06

This is what happens now (including 1.9):

Screenshot 2024-02-08 at 17 05 37

Version

1.9

Steps to reproduce the behavior

Now:

  1. Add Apollo library to iOS App with version 1.9
image 2. Install CLI: image 3. Error received and CLI not created: Screenshot 2024-02-08 at 17 05 37
  1. Add Apollo library to iOS App with version 1.7
image 2. Install CLI: image 3: CLI Created image

Logs

No response

Anything else?

Confirmed with a coworker and it's happening for them as well. It's possible this is being stopped by the corporate VPN, but it's unclear based on the error shown

@pjf-amexgbt pjf-amexgbt added bug Generally incorrect behavior needs investigation labels Feb 9, 2024
@BobaFetters
Copy link
Member

@pjf-amexgbt Hmm the error seems to think its an issue unpacking the .tar.gz, but it could honestly also be a download issue like you mentioned as well. I can look into some and see if I can reproduce, and also maybe improve the error logging some to be more clear, in the meantime can you take a look in your project directory while running the plugin and see if you see a apollo-ios-cli.tar.gz file show up and maybe be deleted? That would help tell us if the download is actually happening or not.

@calvincestari
Copy link
Member

calvincestari commented Feb 9, 2024

@pjf-amexgbt you mentioned that the error is "from version 1.8 on". If you target 1.7.1 exactly is the error resolved or still present? If this is a VPN networking issue the problem should occur with 1.7.1 too.

Not relevant since we only changed the CLI installation to download the binary from 1.8.0 onwards.

@BobaFetters
Copy link
Member

The tar: Error opening archive: Failed to open 'apollo-ios-cli.tar.gz' can definitely be thrown if the .tar.gz file is missing which would give further evidence that the download just isnt happening. @pjf-amexgbt Possible you could try to just manuall run the curl command to do the download in terminal and see what kind of errors/issues it gives you maybe related to your VPN?

curl -L https://www.github.com/apollographql/apollo-ios/releases/download/1.8.0/apollo-ios-cli.tar.gz

@BobaFetters
Copy link
Member

Closing this since there hasn't been any activity, if this is still an issue feel free to reopen.

Copy link

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.

@pjf-amexgbt
Copy link
Author

pjf-amexgbt commented Feb 20, 2024

@BobaFetters Apologies for the slow response, forgot to link accounts so didn't get a notification.

Yeah it does seem to be a download issue. A VPN block was my guess, but I did test with
curl -L "https://www.github.com/apollographql/apollo-ios/releases/download/1.8.0/apollo-ios-cli.tar.gz" -s -o "apollo-ios-cli.tar.gz" and it downloads the file without issue.

I did a bit of additional investigation playing with "download-cli.sh" am getting some odd results.

  • When run from Xcode with curl -v I get an error with: SSL certificate problem: self signed certificate in certificate chain
  • When running the script directly from the terminal: The file downloads/saves, but tar -xvf "$FILE_PATH" unpacks it in the script folder instead of in place. (probably not relevant to the issue)
  • When "apollo-ios-cli.tar.gz" is in the project, the Xcode command still has the SSL issue, but unpacks the tar correctly.

So it seems it may be caused by some combination of running it through Xcode and the wonderful corporate laptop "Security" 🫠

However, wondering if there's a reason to download the file? Especially when it seems to (currently) be included in the repo: https://github.com/apollographql/apollo-ios/tree/main/CLI

@pjf-amexgbt
Copy link
Author

Also, I apparently am unable to re-open. Feel free to do so, I should be more responsive now :)

@BobaFetters
Copy link
Member

@pjf-amexgbt no problem, hmmm yea I guess maybe its an issue with the curl command when run through xcode then. Something I can definitely look into. As far as the need to download the file, originally the file was packed with the library and then unzipped by the plugin, we wanted to reduce the downloaded library size by removing the built in tar.gz and having the plugin download it instead, although we ran into an issue with the Cocoapods support still needing the built-in tar.gz. This is something we will revisit and see if we can either fix the download issue and remove the issue with Cocoapods to have the included tar.gz or we may just revert back to having the plugin work based on the built-in tar.gz

@pjf-amexgbt
Copy link
Author

pjf-amexgbt commented Feb 20, 2024

Thank you for looking into it! It would be nice to have the option of building it from source. It seems that option was removed with the CLI changes (and also the "Build it Yourself" section is now out of date here 🙃 docs/ios/code-generation/codegen-cli/#installation)

@BobaFetters
Copy link
Member

Ah thanks for the callout on the documentation needing updated, will take care of that. As far as being able to build it yourself, that isn't possible with the plugin anymore because of the changes that were made to our git structure to modularize our libraries, more info on that here TLDR; the executable is now part of a separate repo/spm package than the main client library that contains the plugin. So technically you could still download that package and build it yourself you would just need to ensure you pull a matching version.

Also it looks like we should be able to fix the Cocoapods issue we had so the plan currently is to move forward with fixing that and then working on fixing the curl command for the plugin to resolve the issue you are seeing.

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