-
Notifications
You must be signed in to change notification settings - Fork 7.3k
os.arch should be the architecture of the OS not of the process #2862
Comments
You raise a valid point, the problem is that there doesn't seem to be a proper "always correct" fix. In these troubled times you can have arbitrary combinations of 32 and 64 bits userlands and kernels. Take a system with a 32 bit kernel and a mostly 64 bit userland. How should it be reported? Is it 32 bits or 64 bits? Both? Neither? Maybe we should scrap |
|
Okay, that's a good enough reason for me. Let's keep it the way it is. |
The answer for os.arch() is an easy one on windows. And yeah, process.arch is fine but os.arch is pretty useless as is. |
os.arch() should either refer to the architecture of the underlying Operating System or the list of what is actually supported by the OS, e.g. isainfo on SunOS. Since the latter isn't always knowable, it should probably just describe what the native arch of the kernel is. |
Either it needs to be correct, or removed. Reopening for now. This can't be changed on a stable branch. |
@isaacs ... have there been any updates on this one? |
Doesn't appear to be a bug. Marking as a feature-request. For backwards compatibility, recommend no changes to the current behavior but it may be worthwhile to add a new |
+1 deprecate |
process.arch is based on the architecture which node.js was compiled for, not necessarily the architecture of the system the node.js process is currently running in. I came across this issue while working on buildbot related stuff. More info: nodejs/node-v0.x-archive#2862 BUG=none Review-Url: https://codereview.chromium.org/2698983004 Cr-Original-Commit-Position: refs/heads/master@{#451511} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 250263fa2e293a555c78479e00b5758c2e56d97e
process.arch is based on the architecture which node.js was compiled for, not necessarily the architecture of the system the node.js process is currently running in. I came across this issue while working on buildbot related stuff. More info: nodejs/node-v0.x-archive#2862 BUG=none Review-Url: https://codereview.chromium.org/2698983004 Cr-Commit-Position: refs/heads/master@{#451511}
process.arch is based on the architecture which node.js was compiled for, not necessarily the architecture of the system the node.js process is currently running in. I came across this issue while working on buildbot related stuff. More info: nodejs/node-v0.x-archive#2862 BUG=none Review-Url: https://codereview.chromium.org/2698983004 Cr-Commit-Position: refs/heads/master@{#451511}
In lib/os.js:
Which means that on a system that's running a 64 bit kernel but a 32 bit node binary you get:
when you would have expected 'x64'.
The text was updated successfully, but these errors were encountered: