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

Cannot use kail on Windows/Git Bash -- cannot open /dev/stderr #23

Closed
fbiville opened this issue Oct 17, 2018 · 6 comments
Closed

Cannot use kail on Windows/Git Bash -- cannot open /dev/stderr #23

fbiville opened this issue Oct 17, 2018 · 6 comments

Comments

@fbiville
Copy link

Here is what happens:

$ kail --help
kail.exe: error: open /dev/stderr: The system cannot find the path specified., try --help
@fbiville
Copy link
Author

fbiville commented Oct 17, 2018

A few more details on the setup:

IEUser@MSEDGEWIN10 MINGW64 ~/workspace/fats (issue_46)
$ kail --help
kail.exe: error: open /dev/stderr: The system cannot find the path specified., try --help

IEUser@MSEDGEWIN10 MINGW64 ~/workspace/fats (issue_46)
$ ls -lisa /dev/stderr
562949953534840 1 lrwxrwxrwx 1 IEUser 197121 15 Oct 17 08:02 /dev/stderr -> /proc/self/fd/2

IEUser@MSEDGEWIN10 MINGW64 ~/workspace/fats (issue_46)
$ ls -lisa /proc/self/fd/2
15871480675977711661 0 lrwxrwxrwx 1 IEUser 197121 0 Oct 17 09:01 /proc/self/fd/2 -> /dev/pty0

IEUser@MSEDGEWIN10 MINGW64 ~/workspace/fats (issue_46)
$ ls -lisa /dev/pty0
8912896 0 crw------- 1 IEUser 197121 136, 0 Oct 17 09:02 /dev/pty0

@boz
Copy link
Owner

boz commented Oct 17, 2018

Thanks @fbiville. I'm not sure why your workaround doesn't work. Maybe just create a /dev directory?

You can also try specifying a different log file with --log-file <path>.

It's opening /dev/stderr for logging as a convenience, maybe that just won't work on Windows. The relevant code is here.

What is os.Stderr.Name() on your system? I wonder if it's a different path or if the open flags won't work on Windows.

@fbiville
Copy link
Author

@boz actually, this whole setup is a standard Git Bash install (used by Travis CI as well on Windows workers). I'll come back to you ASAP with the value os.Stderr.Name()

@fbiville
Copy link
Author

Just ran it, it returns /dev/stderr in Git Bash, cmd and Powershell.

@scothis
Copy link
Contributor

scothis commented May 29, 2019

I've been able to work around this issue by redirecting stderr to stdout 2>&1. There's something a bit different with git bash on Windows.

@k1ng440
Copy link

k1ng440 commented Aug 2, 2019

does not work on PowerShell either

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

4 participants