-
Notifications
You must be signed in to change notification settings - Fork 13
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
Not supported by windows error #7
Comments
Do you get an error? Or what happens when you try to use it on Windows? I don't have a Windows machine myself, so bit hard to look at it. The quickest way to get it running is to take a look at the code and see if you can fix it. It's not very complex so hopefully shouldn't be too hard. |
hello,did you find a solution? |
No @0xhex, I don't have a Windows machine to test myself, and the OP never got back with an error. What error are you getting? |
|
Thanks! It looks like
Where I'm not sure what a good solution would be; I don't think there is an equivalent "replace current process" system call on Windows, although there probably are ways around it, see e.g. golang/go#30662 as well as the same fix they did for kubectl. Like I said, I don't really have a Windows machine so I can't test this, but happy to accept patches. |
I can provide you a dedicated server windows if you want,this is so important to me |
this code looks like working,i will back you about it
|
Coolio, feel free to open a PR. Not sure why that |
Ah,i forgot to remove it 👍 i use it in my project before reload just waiting 1 second |
@0xhex thanks, the idea got me on the way, but a few things:
|
Hi everyone! Any news on this? I've tried this tool for cross build and it doesn't work on Windows =( |
I still don't have a Windows machine @RedStalker, so still waiting for a patch. In particular, need to be careful it replaces the process correctly and that no zombie processes are left behind. |
any progress about it please? |
@arp242 That code will not replace the process, but rather spawn a new one and wait for it to exit. It's the best you can do for windows, since it doesn't support replacing a process. @0cv The blocking behaviour is crucial, since the it's not meant to continue executing. Although, it should probably forward the exit code from the error: cmd := exec.Command(os.Args[0], "0")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Stdin = os.Stdin
cmd.Env = os.Environ()
err := cmd.Run()
if err == nil {
os.Exit(0)
}
if exitError, isExit := err.(exec.ExitError); isExit {
os.Exit(exitError.ExitCode())
}
os.Exit(1) @0xhex It doesn't seem like you did a PR for this? |
Hello.
Thanks for writing this library, it is very useful. I am using these library for both my mac and linux versions of my cmd app.
Unfortunately it looks like it does not support windows. Do you have any workaround for reloading in windows?
Wish you all the best,
Mario
The text was updated successfully, but these errors were encountered: