-
Notifications
You must be signed in to change notification settings - Fork 613
Linux: Startup thread that launches node subprocess #278
Conversation
to subprocess stdin.
cc @joelrbrandt to see if he has any thoughts. Assigned to @jasonsanjose. |
I've done more work on this and now:
node restart is yet to be implemented and there are probably more syscall checks required |
I noticed a problem with the node setup script integrating with @timburgess's node setup. Tim's node setup seems to call node from the I think @timburgess will either want to adapt, or the grunt script needs to call a copy instead of rename. |
Good point. When @jasonsanjose's grunt build PR goes into master, I will need to adjust to suit any path and or binary file name changes. At present, the code does run node from |
@timburgess the |
Doing it right now :-) |
Conflicts: appshell/config.h
With @jasonsanjose 's Sprint 29 in master, I have rebased from master and made changes to run I have been working on an extension with node-side code so will do some more testing to confirm that it works on Linux in the same way it does on OS X. |
Tried a couple of extensions with node-side code. All works for me. |
Fantastic! I'll try this first thing tomorrow. |
@timburgess nice! thanks for your hard work. |
@@ -49,6 +49,19 @@ | |||
#define NODE_CORE_PATH @"/Contents/node-core" | |||
|
|||
#endif | |||
#ifdef OS_LINUX | |||
//#define GROUP_NAME @"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stale comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. Nevermind, I see this is a placeholder for OS-specific preferences. I'll add a TODO.
Closing, see #306. |
This is some initial work in getting the node process up & running in Linux.
With this code, brackets-shell kicks off a mutexed launch thread that starts the Node executable in a subprocess.
As per the latest linux setup script, Node is launched from brackets-shell/deps/node/bin/node.
A file descriptor in the startup thread is piped to STDIN in the subprocess.
I have experimented with passing input to the node process to eval(). This works but Node appears to buffer it's output if it detects that STDIN is not a terminal. If I run node in interactive mode i.e. 'node -i' it stops buffering but produces a lot more output than I think is wanted.
I'd appreciate getting some feedback on how to run Node as then I can add code to setup a pipe from the subprocess STDOUT to a thread that reads the output.