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

Feature: /etc/windows-release #2299

Closed
mcandre opened this issue Jul 7, 2017 · 8 comments
Closed

Feature: /etc/windows-release #2299

mcandre opened this issue Jul 7, 2017 · 8 comments

Comments

@mcandre
Copy link

mcandre commented Jul 7, 2017

As an aid to scripts attempting to determine the nature of the runtime environment with cat /etc/*release*, could bash on Ubuntu on Windows include a /etc/windows-release or similar file?

@sunilmut
Copy link
Member

sunilmut commented Jul 7, 2017

@mcandre - Thanks for the suggestion. Interesting idea, but can also feels like a dangerous proposition for compatibility. We don't want to encourage any packages taking a dependency on this and introducing WSL specific behavior, that can also hide bugs in WSL.

@therealkenc
Copy link
Collaborator

It was brought up last year that it should be in /proc/version. Linux version 4.4.0-10.0.16237-Microsoft. The version on my Android phone is for example 3.10.61-10942903. Too lazy to dig up the issue#....

Sunil, people are going to take WSL dependencies in their software. Because there are WSL dependencies. Take for example this patch to Meteor here, which works around #1529 (an issue that did not even rate a "that's going to be really hard to fix" response from anyone). So people hide work around the bugs.

Anyway, from a bash script in WSL:

ken@HEADCRASH:~$ systeminfo.exe | sed -n 4p | awk '{print $3}'
10.0.16237

@benhillis
Copy link
Member

I agree with @therealkenc. Running systeminfo.exe or ver.exe via interop is probably the right way to go.

@Herst
Copy link

Herst commented Jul 11, 2017

Another example of a WSL-specific fix: eventlet/eventlet@09e166b

On a side note, maybe they should be collected at some location for future in order to inform those developers when WSL oddities get fixed (e.g. in order to prevent workarounds causing problems once WSL follows the behavior of an original Linux™, we've been there with IE).

@therealkenc
Copy link
Collaborator

therealkenc commented Jul 11, 2017

Even more amusing is glibc-wsl, which works around #1878 by rolling back this commit. That is, if one is willing to put "Cygwin for WSL" on the table, you can fix all kinds of stuff 😏.

@SRGOM
Copy link
Contributor

SRGOM commented Jul 12, 2017

/proc/sys/kernel/osrelease has Microsoft in it (since you only want the "nature" of the runtime env).

@zszszsz
Copy link

zszszsz commented Jul 27, 2017

or otherwise a uname -r will do it.

@benhillis
Copy link
Member

benhillis commented Jan 29, 2018

The Windows version is now part of /proc/version.

cat /proc/version
Linux version 4.4.0-17074-Microsoft ([email protected]) (gcc version 5.4.0 (GCC) ) #1002-Microsoft Thu Jan 01  PST 2016

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

7 participants