[ANN] OSSubprocess first milestone
Dear all, I am happy to tell you I have a first prototype of the tool for executing OS processes: https://github.com/marianopeck/OSSubprocess As I said many times, the main idea was to be as much as possible FFI-based, only for executing OS commands and, from my point of view, a better end-user API. Also, as for the first step, I had to focus on Linux/OSX. I would like to thank Pharo Consortium for the sponsor of this development effort. Here is the first milestone! There are many things on my to-do but I think the code is ready for some usage, testing, code review and feedback! All classes and all methods have comments and I have quite some unit tests. All tests are green in my OSX and a CentOS box. *Important: you CANNOT have OSProcess installed in the same image as OSSubprocess. This is because I am reusing his SIGCHLD handler and for the time being both cannot coexist. * Keep in mind that the tool may be unstable and that MAY mean a VM crash. So use with care, mostly the first time. If all tests passes, then there are much less chances of something going bad. Important disclaimer: my tool (OSSubproccess from now onward) is HIGHLY influenced by a subset of the OSProcess project. There are parts which I even simply copied and adapted them (OSSPipe, OSSAttachableStream, OSSUnixProcessExitStatus). Other parts, I took them as inspiration (the idea of ThisOSProcess representing the VM process, the child watcher, and many others). In addition, I AM STILL USING (maybe as a first step?) some of the OSProcess PLUGIN (not OSProcess image side), such as the SIGCHLD handler or the creation of pipes. In github url you have all the documentation of the project, included how to install it and use it. *Finally, if you test it in a OS different than OSX and CentOS please share with me the results (about the tests).* Tomorrow the ConfigurationOf should also appear in the Catalog of Pharo 5.0. Any feedback is appreciated. Best, -- Mariano http://marianopeck.wordpress.com
Thanks Mariano! Stef Le 14/1/16 19:33, Mariano Martinez Peck a écrit :
Dear all,
I am happy to tell you I have a first prototype of the tool for executing OS processes:
https://github.com/marianopeck/OSSubprocess
As I said many times, the main idea was to be as much as possible FFI-based, only for executing OS commands and, from my point of view, a better end-user API. Also, as for the first step, I had to focus on Linux/OSX.
I would like to thank Pharo Consortium for the sponsor of this development effort. Here is the first milestone!
There are many things on my to-do but I think the code is ready for some usage, testing, code review and feedback!
All classes and all methods have comments and I have quite some unit tests. All tests are green in my OSX and a CentOS box.
*Important: you CANNOT have OSProcess installed in the same image as OSSubprocess. This is because I am reusing his SIGCHLD handler and for the time being both cannot coexist. *
Keep in mind that the tool may be unstable and that MAY mean a VM crash. So use with care, mostly the first time. If all tests passes, then there are much less chances of something going bad.
Important disclaimer: my tool (OSSubproccess from now onward) is HIGHLY influenced by a subset of the OSProcess project. There are parts which I even simply copied and adapted them (OSSPipe, OSSAttachableStream, OSSUnixProcessExitStatus). Other parts, I took them as inspiration (the idea of ThisOSProcess representing the VM process, the child watcher, and many others). In addition, I AM STILL USING (maybe as a first step?) some of the OSProcess PLUGIN (not OSProcess image side), such as the SIGCHLD handler or the creation of pipes.
In github url you have all the documentation of the project, included how to install it and use it.
*Finally, if you test it in a OS different than OSX and CentOS please share with me the results (about the tests).* Tomorrow the ConfigurationOf should also appear in the Catalog of Pharo 5.0.
Any feedback is appreciated.
Best,
Awesome work Mariano , I love the documentation. Question : Does your library use the new FFI (Unified FFi) ? On Thu, Jan 14, 2016 at 9:36 PM stepharo <stepharo@free.fr> wrote:
Thanks Mariano!
Stef
Le 14/1/16 19:33, Mariano Martinez Peck a écrit :
Dear all,
I am happy to tell you I have a first prototype of the tool for executing OS processes:
https://github.com/marianopeck/OSSubprocess
As I said many times, the main idea was to be as much as possible FFI-based, only for executing OS commands and, from my point of view, a better end-user API. Also, as for the first step, I had to focus on Linux/OSX.
I would like to thank Pharo Consortium for the sponsor of this development effort. Here is the first milestone!
There are many things on my to-do but I think the code is ready for some usage, testing, code review and feedback!
All classes and all methods have comments and I have quite some unit tests. All tests are green in my OSX and a CentOS box.
*Important: you CANNOT have OSProcess installed in the same image as OSSubprocess. This is because I am reusing his SIGCHLD handler and for the time being both cannot coexist. *
Keep in mind that the tool may be unstable and that MAY mean a VM crash. So use with care, mostly the first time. If all tests passes, then there are much less chances of something going bad.
Important disclaimer: my tool (OSSubproccess from now onward) is HIGHLY influenced by a subset of the OSProcess project. There are parts which I even simply copied and adapted them (OSSPipe, OSSAttachableStream, OSSUnixProcessExitStatus). Other parts, I took them as inspiration (the idea of ThisOSProcess representing the VM process, the child watcher, and many others). In addition, I AM STILL USING (maybe as a first step?) some of the OSProcess PLUGIN (not OSProcess image side), such as the SIGCHLD handler or the creation of pipes.
In github url you have all the documentation of the project, included how to install it and use it.
*Finally, if you test it in a OS different than OSX and CentOS please share with me the results (about the tests).* Tomorrow the ConfigurationOf should also appear in the Catalog of Pharo 5.0.
Any feedback is appreciated.
Best,
On Thu, Jan 14, 2016 at 4:43 PM, Dimitris Chloupis <kilon.alios@gmail.com> wrote:
Awesome work Mariano , I love the documentation.
Question : Does your library use the new FFI (Unified FFi) ?
It does use the new FFI which is in latest Pharo 5.0. The Unified FFI as far as I understand in a simple rename of a couple of things. I will have to update my code for it, yes, but should be trivial. But..as far as I know, it has not been yet integrated into the image the changes, right?
On Thu, Jan 14, 2016 at 9:36 PM stepharo <stepharo@free.fr> wrote:
Thanks Mariano!
Stef
Le 14/1/16 19:33, Mariano Martinez Peck a écrit :
Dear all,
I am happy to tell you I have a first prototype of the tool for executing OS processes:
<https://github.com/marianopeck/OSSubprocess> https://github.com/marianopeck/OSSubprocess
As I said many times, the main idea was to be as much as possible FFI-based, only for executing OS commands and, from my point of view, a better end-user API. Also, as for the first step, I had to focus on Linux/OSX.
I would like to thank Pharo Consortium for the sponsor of this development effort. Here is the first milestone!
There are many things on my to-do but I think the code is ready for some usage, testing, code review and feedback!
All classes and all methods have comments and I have quite some unit tests. All tests are green in my OSX and a CentOS box.
*Important: you CANNOT have OSProcess installed in the same image as OSSubprocess. This is because I am reusing his SIGCHLD handler and for the time being both cannot coexist. *
Keep in mind that the tool may be unstable and that MAY mean a VM crash. So use with care, mostly the first time. If all tests passes, then there are much less chances of something going bad.
Important disclaimer: my tool (OSSubproccess from now onward) is HIGHLY influenced by a subset of the OSProcess project. There are parts which I even simply copied and adapted them (OSSPipe, OSSAttachableStream, OSSUnixProcessExitStatus). Other parts, I took them as inspiration (the idea of ThisOSProcess representing the VM process, the child watcher, and many others). In addition, I AM STILL USING (maybe as a first step?) some of the OSProcess PLUGIN (not OSProcess image side), such as the SIGCHLD handler or the creation of pipes.
In github url you have all the documentation of the project, included how to install it and use it.
*Finally, if you test it in a OS different than OSX and CentOS please share with me the results (about the tests).* Tomorrow the ConfigurationOf should also appear in the Catalog of Pharo 5.0.
Any feedback is appreciated.
Best,
-- Mariano http://marianopeck.wordpress.com
On Thu, Jan 14, 2016 at 03:33:56PM -0300, Mariano Martinez Peck wrote:
Dear all,
I am happy to tell you I have a first prototype of the tool for executing OS processes:
https://github.com/marianopeck/OSSubprocess
As I said many times, the main idea was to be as much as possible FFI-based, only for executing OS commands and, from my point of view, a better end-user API. Also, as for the first step, I had to focus on Linux/OSX.
I would like to thank Pharo Consortium for the sponsor of this development effort. Here is the first milestone!
Bravo Mariano! Dave
On January 14, 2016 7:33:56 PM GMT+01:00, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
Dear all,
I am happy to tell you I have a first prototype of the tool for executing OS processes:
https://github.com/marianopeck/OSSubprocess
As I said many times, the main idea was to be as much as possible FFI-based, only for executing OS commands and, from my point of view, a better end-user API. Also, as for the first step, I had to focus on Linux/OSX.
I would like to thank Pharo Consortium for the sponsor of this development effort. Here is the first milestone!
There are many things on my to-do but I think the code is ready for some usage, testing, code review and feedback!
All classes and all methods have comments and I have quite some unit tests. All tests are green in my OSX and a CentOS box.
*Important: you CANNOT have OSProcess installed in the same image as OSSubprocess. This is because I am reusing his SIGCHLD handler and for the time being both cannot coexist. *
Keep in mind that the tool may be unstable and that MAY mean a VM crash. So use with care, mostly the first time. If all tests passes, then there are much less chances of something going bad.
Important disclaimer: my tool (OSSubproccess from now onward) is HIGHLY influenced by a subset of the OSProcess project. There are parts which I even simply copied and adapted them (OSSPipe, OSSAttachableStream, OSSUnixProcessExitStatus). Other parts, I took them as inspiration (the idea of ThisOSProcess representing the VM process, the child watcher, and many others). In addition, I AM STILL USING (maybe as a first step?) some of the OSProcess PLUGIN (not OSProcess image side), such as the SIGCHLD handler or the creation of pipes.
In github url you have all the documentation of the project, included how to install it and use it.
*Finally, if you test it in a OS different than OSX and CentOS please share with me the results (about the tests).* Tomorrow the ConfigurationOf should also appear in the Catalog of Pharo 5.0.
Any feedback is appreciated.
Best,
Quick feedback: - the API seems great - thank you very much for the documentation - I wonder why you pass strings for stdout and stderr instead of streams - it would be nice to be able to subclass OSSUnixProcessExitStatus for some commands. E.g., GitProcessExitStatus could have a method isMergeConflict - how can I implement something like tail --follow -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
Quick feedback:
- the API seems great - thank you very much for the documentation
Thanks!
- I wonder why you pass strings for stdout and stderr instead of streams
In which part exactly? In the method like #runAndWaitOnExitDo: ? if that was the question, then I simply thought it would be easier for the user to receive strings. In fact, internally I use streams, but just when I evaluate the closure I pass #contents. I think it's more common for users wanting a string than a stream. In either case, if they received a string they can do #readStreamDo:[] or whatever, and if they receive a stream they can do #contents.
- it would be nice to be able to subclass OSSUnixProcessExitStatus for some commands. E.g., GitProcessExitStatus could have a method isMergeConflict
That would be nice.
- how can I implement something like tail --follow
I think it would be nice to how an example of this type of streaming API. Note that this goes very similar to what Luc proposes below. Thanks for the feedback! -- Mariano http://marianopeck.wordpress.com
participants (5)
-
Damien Cassou -
David T. Lewis -
Dimitris Chloupis -
Mariano Martinez Peck -
stepharo