5 ms·
So what OS you're going to get when you run an application under this? So if I run this: node -e 'console.log(require("os").type())' What it's going to pr
by msoad 11y ago
So what OS you're going to get when you run an application under this? So if I run this:
node -e 'console.log(require("os").type())'
What it's going to print?
- jokr004 11y agoWould depend entirely on how you installed node, I would imagine.
- orf 11y agoWhatever it prints on Ubuntu I expect. Obviously it's not going to return "Windows", or "UbuntuInWindows" else anything that makes that call that would break.
- jdub 11y agoAs WinLS is very much like branded Solaris Zones, here's what it looks like when you run `uname -a` in an (old, copypasta from the web) Linux branded zone: Linux centos 2.4.21 BrandZ fake linux i686 i686 i386 GNU/Linux
- pookeh 11y agoDepends if the node is a Windows executable or a Linux binary.
- jensvdh 11y agoSo if I install Node as a Linux binary. Can I access it in Windows "environment" too? Does that mean I can do "apt-get install nginx" from their new "bash" terminal app? Does that then run under port 80 in Windows? Since no VM is involved. I'm still a bit confused.
- anonymfus 11y ago>Does that then run under port 80 in Windows? Yes, they demonstrated that localhost is the same localhost under both environments.
- niutech 11y agoSee this screenshot showing uname -a: https://1.bp.blogspot.com/-PTJrez4z0Jc/Vvr-VH5DQOI/AAAAAAAFHcg/8F_2fBEG3kg-Y0aV2mURdJqk66gsoEWeg/s1600/bash.png https://1.bp.blogspot.com/-PTJrez4z0Jc/Vvr-VH5DQOI/AAAAAAAFH...
- drewg123 11y agoSeems less honest than the Linux env on FreeBSD, which at least puts FreeBSD in there for uname -a. Eg: % uname -srm FreeBSD 10.3-RELEASE amd64 % /compat/linux/bin/bash bash-4.1$ /bin/uname -srm Linux 2.6.32 i686 bash-4.1$ /bin/uname -a Linux viserion 2.6.32 FreeBSD 10.3-RELEASE #0 4b75b72(releng/10.3): Fri Mar 25 19:14:5 i686 i686 i386 GNU/Linux bash-4.1$ cat /proc/cpuinfo | grep 'model name' | head -1 model name : Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz
- zxcvcxz 11y agoI just see this as a headache for developers. I don't want or need a Linux ABI, I just want to run a Linux container on Windows (if I have to use windows, which I would prefer not to do). If node running on windows needs access to a database running on the Linux layer then what happens when things aren't working? They can't possibly make all programs interact in a seamless way. I'm imagining frankenstein programs that are hacked together with code that only works on this frankenstein OS.
- xorblurb 11y agoIf you want a Linux container on Windows (which they do not seem to propose right away, but it seems a logical step), you need a Linux ABI.
- davesque 11y agoLooks like, if a posix system is detected at compile time, it will return whatever it gets from the `uname` system call in `sys/utsname.h`: https://github.com/nodejs/node/blob/master/src/node_os.cc#L59 https://github.com/nodejs/node/blob/master/src/node_os.cc#L5... Microsoft probably hard-codes a response of "Linux" (or whatever would be normal for Ubuntu) for that call to prevent Ubuntu binaries from freaking out.