alunny / node-xcode

tools and utilities for working with xcode/ios projects
Apache License 2.0
226 stars 105 forks source link

io.js + silent prepare issue #61

Closed revolunet closed 8 years ago

revolunet commented 9 years ago

Hello, for information, looks like the webworkers used in some scripts are not compatible with io.js

Here : https://github.com/alunny/node-xcode/blob/master/lib/pbxProject.js#L22-L40

If you use io.js, the worker dies silently and then the cordova prepare task fail silently too, which leads to unexpected results.

While io.js support is luxury, having a way to inform the user if the webworker or prepare phase fails for some reason would save some headaches :)

I tried to add exit/error/close callbacks to the worker with no luck... any idea ?

revolunet commented 9 years ago

link to related issue on cordova tracker : https://issues.apache.org/jira/browse/CB-9297

pmuellr commented 9 years ago

Wondering if it's related to sync/async use of send() from child to parent process - there's a fix going in node 4 that will help - https://github.com/nodejs/node/pull/2620 - I believe the implication is that you'd put the process.exit() calls inside the send() callback. Until then, you could probably put the process.exit() in a setTimeout() of a second or so.

vladimir-kotikov commented 9 years ago

Not sure if we need to forcibly call process.exit(), since the exit code of spawned process is not tracked anywhere. As for me it's just enough to try to parse and send either parsed result or error back and let node take care of spawned process. @pmuellr, your thoughts?

pmuellr commented 9 years ago

Welp, usually adding process.exit() is bit heavy-handled, in most apps.

OTOH, if the usage in this case is within parseJob.js, as indicated in pbxProject.js, then process.exit() doesn't appear to be too heavy-handed, in context. Everyone else is already doing it! :-)

sgrebnov commented 9 years ago

I think we can simply remove process.exit call as process exit status is not used or specify exitCode instead.