-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
uname
should return something more meaningful
#13356
Comments
A downside to doing this is that then builds on node vs web could behave differently. Maybe that's what you want in this case, but it can make some debugging tasks harder. In general we try to avoid such differences. I've been thinking maybe we want to add a flag to control things like this, "RAW_OS" or such, that would make more OS things like this accessible. |
I think returning different results from uname() seems like a relatively safe point of divergence. Most code expects variable results from this call. Do we have actual users who could benefit from accessing this information? Also, just FYI, the emscripten version itself is already available statically at compile time. |
We already have behavior divergence for NodeJS vs. Browser, and it might be useful to be able to easily ascertain this from In terms of "actual" users, our C++ Unit tests blit out a bunch of system information at the top of the logs, and Browser vs. NodeJS seems to be a notable difference in environment (akin to Linux vs. Darwin) to have at-a-glance. |
Sounds like there is enough of an argument for at least having an option to enable this. How about Perhaps we can come up with some kind of name that implies that user wants (or doesn't want) a kind of hermetic/reproducible build? |
Thinking on this more, the suggestions in the first comment sound reasonable to me. We do have |
Sounds like great use for |
To offer a contrasting view: I'm fairly content with sysname currently containing "Emscripten". This field tends to be a consistent way to identify the operating system for system ABI/platform distinction purposes. Python, for example, uses it to determine the platform string for binary packages, and since Emscripten mostly abstracts away the differences between the browsers (and to a large degree even node.js) and (AFAIK) a dynamically loaded wasm module is interchangeable between them, it makes sense to me to identify the platform consistently as "emscripten". If we were to change this, we would probably need to patch the Python standard library to override this setting. I could be convinced that we need to distinguish between node.js and the browser via this field, given the differences between these environments, but I'd not at all be in favour of putting the user-agent in here. A well-behaved application should not care significantly about whether it's run in Chrome or Firefox since the "system interface" is supposed to be the same either way. In the same way, |
In which field of |
I'm not at all bound to the idea of providing userAgent at all, was just spitballing other possibilities. Being able to distinguish Node vs. Browser is far more valuable, as the environments are different enough to matter (at least a little bit). I like having wasm32 or wasm64 in Per the docs for
So I guess I was thinking of using one or both of those to provide more clarity--as the current values of |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
Access to the userAgent from C++ would be useful for determining whether a meta/super key press is the Windows key and should be ignored or Cmd key on MacOS and should be treated like Ctrl (#6594). In the meantime, this is probably possible via |
uname(2)
is currently delegated tolibrary_syscall.js
.At present, it hard codes the following values:
It might be nice to return something more meaningful here.
Suggestions:
product.versions.node
navigator.userAgent
The text was updated successfully, but these errors were encountered: