Skip to content
This repository has been archived by the owner on Mar 4, 2022. It is now read-only.

Tracking: Using spawn vs. exec as underlying process mechanism #20

Closed
exogen opened this issue Nov 16, 2015 · 1 comment · Fixed by #122
Closed

Tracking: Using spawn vs. exec as underlying process mechanism #20

exogen opened this issue Nov 16, 2015 · 1 comment · Fixed by #122

Comments

@exogen
Copy link
Contributor

exogen commented Nov 16, 2015

In investigating FormidableLabs/radium#420, I'm beginning to suspect that the users' shell configuration is a contributing factor. For example, you can configure your shell in a strict mode so that if any command fails in a cmd1 || cmd2 chain, the whole command still fails, as if they were joined with &&. It's possible these people have some global setting that's causing the || to fail (yes, even though NPM attempts to run your script with plain old sh).

Anyway, whether or not that is the issue, I dug into how npm runs scripts, and found that they use spawn (they wrap Node's spawn slightly). In order to not have to parse the command, they run sh -c which takes the shell command to run as a string.

While I'm fine with exec, I thought I'd bring this back up because it's a difference in how Builder runs your script vs. NPM – and I anticipate that difference being a source of issues and confusion in a future where Builder is used more widely.

(We can put this off for now, just thought I'd add it as a TODO.)

@ryan-roemer
Copy link
Member

@exogen -- Yep, I'm familiar with the internals of npm run and they do use spawn.

We'll keep this issue open and icebox'ed for tracking. Thanks!

@ryan-roemer ryan-roemer changed the title spawn vs. exec redux Tracking: Using spawn vs. exec as underlying process mechanism Dec 9, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants