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

Fix for spawning bufferedNodeProcess #21

Closed
benjaminRomano opened this issue Jul 23, 2015 · 8 comments
Closed

Fix for spawning bufferedNodeProcess #21

benjaminRomano opened this issue Jul 23, 2015 · 8 comments

Comments

@benjaminRomano
Copy link
Contributor

@steelbrain
I fixed the problem in AtomLinter/linter-jshint#151. You need to have an options object and pass it into bufferedNodeProcess :

    options =
      env:
        ATOM_SHELL_INTERNAL_RUN_AS_NODE: '1'

   spawnedProcess = new BufferedNodeProcess({command, args, options, stdout, stderr, exit})

I can create a PR for the atom-linter code if you would like.

@benjaminRomano benjaminRomano changed the title Fix for execNode Fix for spawning bufferedNodeProcess Jul 23, 2015
@steelbrain
Copy link
Owner

Doesn't BufferedNodeProcess do this already? https://github.com/atom/atom/blob/master/src/buffered-node-process.coffee#L49

@benjaminRomano
Copy link
Contributor Author

Yeah you are right. The problem is the default options.env. Using process.env doesn't work and when I set the env myself it doesn't do this line of code. https://github.com/atom/atom/blob/master/src/buffered-node-process.coffee#L48.

I'm currently going through each property on process.env and seeing which one is causing the problem and I'll report back when I figure that out

@steelbrain
Copy link
Owner

Yep, specifying a custom env object makes it work, but then the .jshintrc finding doesn't work, unfortunately.

@benjaminRomano
Copy link
Contributor Author

Why does it break the .jshintrc?

@steelbrain
Copy link
Owner

'cause .jshintrc is searched in HOMEDRIVE, HOMEPATH, HOMEDIR and HOME env vars. and we remove them when we provide an object which has only the ATOM_SHELL_INTERNAL_RUN_AS_NODE value

@benjaminRomano
Copy link
Contributor Author

I just tested adding HOMEDRIVE and HOMEDIR to the options.env from process.env and the code still works on windows.

For a temporary fix, we could have windows specific code that creates an options object with just those properties. However, it would be ideal if we could figure out which exact property is causing things to fail.

@steelbrain
Copy link
Owner

I am like super-stretched up between work and I would highly appreciate it if someone narrows the error down to a single env var.

@steelbrain
Copy link
Owner

Fixed by #22

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

No branches or pull requests

2 participants