-
Notifications
You must be signed in to change notification settings - Fork 209
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
xiki not working under windows because fork is unimplemented. #27
Comments
Yeah, I figured a windows-savvy person would suggest something. The
Cool! Wasn't aware of that gem. Can you use it to talk to processes If it satisfies the requirements, could you paste a simple code --Craig |
Not sure about the daemons gem, but you can still communicate with pipes, so setting permissions on them should work fine. See these specs: https://github.com/jarib/childprocess/blob/master/spec/io_spec.rb#L57 You can also quite easily detach from the parent process: process = ChildProcess.build(*args)
process.detach = true
process.start |
Are you saying this will work with Windows? --Craig On Mon, Sep 17, 2012 at 4:36 AM, Jari Bakken [email protected]:
|
Yeah, though I'm not sure how setting permissions on pipes will work on Windows. If you write a short snippet that demonstrates your use case with pipe, fork and exec, I'm sure @jarmo will help you write and test a childprocess version on Windows :) |
A guy in another thread submitted a patch that may get Xiki working using cygwin! Will look at his pull request soon. |
I'm not using cygwin and there are many windows users who do not use it so that would not solve the problem for me :( |
It's been a while since I used Cygwin, but I remember it being relatively --Craig On Wednesday, September 19, 2012, Jarmo Pertman wrote:
|
I'm very interested in non-cygwin windows support too! Cygwin is easy to install... I used to have it on pretty much all my window machines... but I started running into conflict issues when using any other programs/packages that included their own cygwin. |
@trogdoro it is relatively easy to set up indeed, but does not work well with everything natively on Windows which means that i have to use regular terminal + cygwin terminal. That does not make it really useful and/or user friendly and i have been ending up using unxutils instead - so i get all the nice unix utilities and none of cygwin's problems. That's why i prefer a solution without using cygwin. |
I have the same problem as the OP is there any solution in the works for this? |
What are you trying to do? If you're trying to just use Xiki with --Craig On Wed, Nov 21, 2012 at 4:30 PM, Tylor Reynolds
|
I'm using Sublime Xiki and the only things that I can do are explore file hierarchies and run other command line programs such as git, but I can't do much else. I don't know if this is a problem with Sublime Xiki, but I do know that I can't even run Xiki on the command line without getting an error about fork not being supported. |
Same issue as above comment without the git functionality. Yes, I have git installed and it works from the command line. Mostly I get a "The system cannot find the file specified" error. Trogdoro, please just be straight so I and others can make a decision to remain interested or not. Do you actually care about Windows support without use of Emacs? Most signs indicated that you don't but there are occasional head nods to Windows. I'm not a Windows fan but I do my development in Windows because I develop for Windows. Nothing I can change about that. I think there is some great functionality here that I would love to use. I found xiki by way of Sublime plugins. The combination would be rather comfortable. Thanks for your attention. |
Sorry for not being responsive. I've been busy with another project.
Yeah, there's no reason Xiki shouldn't work on all platforms /projects/xiki/etc/command/
The 1st line creates a socket. The 2nd line is for writing to it. This is how the xiki command talks to the xiki process. The xiki The lines of code dealing with "xikiresponse" are similar - I left So, Windows devs... what's a way to do this that would be really fast, --Craig |
Trogdoro, thanks for answering. I'm not a big ruby dev (nor Windows dev to be honest - which is why I stick to python on Windows) but I'll talk to some folks and see if I can get some assistance with assisting you. I really like the project so I'm interested in being able to use it wherever I may find myself. caoi |
@trogdoro: As for other means of communication, named pipes may be good and pretty cross platform (similar tech, different implementation). They should be secured like above by default, see http://msdn.microsoft.com/en-us/library/windows/desktop/aa365600(v=vs.85).aspx |
Including [email protected] in the thread...
Cool! This seems like it could work interchangeably with how the
Also, what's the latest best practice for testing out Windows stuff If it's cross-platform-ish, maybe I could implement it on the Mac, and --Craig |
A sample could be found on http://stackoverflow.com/questions/9796258/how-do-i-block-on-reading-a-named-pipe-in-ruby As for testing, a VM (VMware or similar) should be fine. If not, I'm sure people can test it, including myself. |
According to that page, Xiki already is using named pipes (search the
There are several samples on that page, which one do you have in mind? There's a lot of code on the
...and...
Is all of that stuff in .setup_pipe really necessary? Perhaps http://rubydoc.info/gems/win32-pipe/0.3.0/file/README is Does the example on the above win32-pipe readme block users from --Craig
|
@trogdoro There are two answer, I had in mind the one with 2 (top) votes. I don't use Cygwin usually, find msys just so much better. However first my issue is with |
Dang, those "________" lines were my way of reminding myself to finish If you have cygwin I think the current xiki implementation might work
His description includes "Note that I'm using mkfifo from cygwin".
Ah, that's happening in the Daemons gem, which Xiki uses to start up a Any of you Windows people know of a Daemons gem alternative that works
If anyone knows this, I'd love to hear the answer. --Craig |
Under Windows you may have services or just a process running in background. Which one are you trying to achieve? I guess the background process. The simplest is just to spawn a new process and not wait for it to terminate. |
@trogdoro Although I used it lately only for the other way around (testing Unix stuff from Windows), Vagrant may be a good and free solution. It's a Ruby wrapper around VirtualBox. The list of available Vagrant boxes also lists Windows Server 2008 R2, so you could have a free Windows for tests. |
It would be very cool if someone would code that up a simple example If you do that, remember the implementation has to not open up --Craig |
Spawn a process and communicate via some pipe read and write, both
|
I found and tested http://devver.wordpress.com/2009/10/12/ruby-subprocesses-part_3/ (see also part 1 and 2 links on that page). 5a and 5b are not working on Windows (that is forking to a pipe). However Method 4: Opening a pipe seems to work fine (described in part 2 and in full source code). Once you have some code, I may check the permissions are respected. I guess you'd want user A (not elevated/admin) not able to read/write to pipe of user B, and not able to read/write to pipe of user A (elevated). |
Thanks for researching this! I think that's likely not a fit though. The xiki process is a The code in your link deals with subprocesses. It starts a new The xiki shell command flow is:
--Craig On Mon, Mar 11, 2013 at 4:07 AM, Werner Beroux [email protected] wrote:
|
Code:
Execution:
|
Cool! Will this deny clients who try to connect and don't have sufficient privileges?
I wonder if a better way to wait was found. Half a second delay is Have you experimented with having smalle sleep times? I'm guessing it Anyone know of a Windows equivalent to the Daemons gem? It lets you --Craig On Wed, Mar 13, 2013 at 4:55 AM, Werner Beroux [email protected] wrote:
|
I saw daemon gem, so on that search didn't find any Windows equivalent. The sleep is only for testing. Could wait for the another mutex. Also sleep The issue I see is that the pipe is opened and closed. It seems to be the Both issues could be fixed at once by waiting until pipe is open:
I feel option (1) is safest but expecting exceptions is ugly if it happens I'll try the access rights. Should be fine but better double check.
|
I'm not really good at reading Ruby's documentation. From what I see there is no wait method. On Windows there is a
I tried the admin test and looks fine. How should it work for multiple users? I guess the mutex and pipe should be unique to that user and the given elevation level. |
pipe code from trogdoro#27 (comment) related to trogdoro#27, trogdoro#53
@tylorr I'm not sure if I'm supposed to say that here, but I'd like to know how you made it work in Sublime Text on Windows. My Xiki buffer keeps saying: |
I'm sorry, I don't believe I ever got it working. But, it looks like there has been a significant amount of work towards this problem since I last tried. |
The problem is that fork is not available on Windows platform. The problem could be solved by using fork-like techniques on Windows. One way to do that cross-platform way would be to use the gem childprocess.
The text was updated successfully, but these errors were encountered: