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

Script returning non-zero value, breaking build #1285

Closed
lastneutrino opened this issue Jul 2, 2020 · 7 comments
Closed

Script returning non-zero value, breaking build #1285

lastneutrino opened this issue Jul 2, 2020 · 7 comments
Labels
build-issue Issues occurring when attempting to build
Milestone

Comments

@lastneutrino
Copy link

I'm not clear why this is returning one instead of zero, from 29.0.

xcode:
Command PhaseScriptExecution failed with a nonzero exit code

% swift package clean
% swift run
lastneutrino/Test1263/Codegen/.build/checkouts/PathKit/Sources/PathKit.swift:98:14: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'Path' to 'Hashable' by implementing 'hash(into:)' instead
  public var hashValue: Int {
             ^
lastneutrino/Test1263/Codegen/.build/checkouts/Stencil/Sources/Template.swift:11:3: warning: 'internal(set)' modifier is redundant for an internal property
  internal(set) var environment: Environment
  ^~~~~~~~~~~~~~
  
[63/63] Linking Codegen
[DEBUG - ApolloCodegenLib:CLIDownloader.swift:43] - Zip file with the CLI is already downloaded!
[DEBUG - ApolloCodegenLib:CLIExtractor.swift:39] - Apollo folder doesn't exist, extracting CLI from zip file.
SHASUM: 0b11aa7973afed9a6b66fbff8c4a09421068a3fe0f50975f7c5d4ca791236b0c
% echo $?
1


@designatednerd designatednerd added the build-issue Issues occurring when attempting to build label Jul 2, 2020
@designatednerd designatednerd added this to the Next Release milestone Jul 2, 2020
@designatednerd
Copy link
Contributor

This is related to #1284 - working on getting an update together.

@designatednerd
Copy link
Contributor

Fix for this has gone out with 0.29.1. Sorry about that!

@lastneutrino
Copy link
Author

Getting this error, server is running. Looks like config.graph isn't being set?

Loading Apollo Project [failed]
→ Error initializing Apollo GraphQL project "Unnamed Project": Error: Error in "Loading schema for Unnamed Project": Error: FetchError: request to http://localhost:4000/graphql failed, reason: getaddrinfo ENOTFOUND localhost
› Error: Error initializing Apollo GraphQL project "Unnamed Project": Error:
› Error in "Loading schema for Unnamed Project": Error: FetchError: request
› to http://localhost:4000/graphql failed, reason: getaddrinfo ENOTFOUND
› localhost

% find .. | xargs grep -s "Unnamed Project"
../Codegen/ApolloCLI/apollo/node_modules/apollo-language-server/lib/project/client.js: return this.config.graph || "Unnamed Project";
../Codegen/ApolloCLI/apollo/node_modules/apollo-language-server/lib/project/service.js: return this.config.graph || "Unnamed Project";
../Codegen/ApolloCLI/apollo/node_modules/apollo-language-server/src/project/client.ts: return this.config.graph || "Unnamed Project";
../Codegen/ApolloCLI/apollo/node_modules/apollo-language-server/src/project/service.ts: return this.config.graph || "Unnamed Project";

@designatednerd
Copy link
Contributor

Error: FetchError: request to http://localhost:4000/graphql failed, reason: getaddrinfo ENOTFOUND localhost

It looks like you were not able to connect to localhost there to download the schema - there is no config.graph that needs to be set on the iOS end. I would double check the URL you're using (make sure you're using the correct of http or https, depending on your setup, along with the correct port).

You also should be able to run your script from Xcode by opening the Package.swift of your Codegen. That will allow you to set breakpoints and see what errors are being returned there.

@lastneutrino
Copy link
Author

Got it working - no changes made. Second time this has happened. Is there a reference you recommend for xcode operation with details, there has to be some caching mechanism that is happening. Also, I'd like to understand the internals and generally accepted practices so I can assist with the project in more detail. I'm not used to xcode in comparison to other frameworks. You can close this out, thank you.

@designatednerd
Copy link
Contributor

Probably the best docs for running with the swift package manager are in SPM's Usage markdown file.

By default, everything gets cached in a .build folder at the same level as your Package.swift file. If you're having caching issues, I've found deleting that folder to be helpful.

@ruudkalis
Copy link

I ran into the same issue.. try this:

  • open Terminal
  • cd to Project Folder
  • pod reintegrate
  • pod update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-issue Issues occurring when attempting to build
Projects
None yet
Development

No branches or pull requests

3 participants