nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
106.58k stars 29.06k forks source link

Add riscv64 to the list of supported architectures #49278

Closed ilg-ul closed 1 year ago

ilg-ul commented 1 year ago

Affected URL(s)

https://nodejs.org/dist/latest-v20.x/docs/api/os.html#osarch

Description of the problem

The node.git/doc/api/os.md file currently reads:

Returns the operating system CPU architecture for which the Node.js binary was
compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,
`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`.

I suggest to change it to:

Returns the operating system CPU architecture for which the Node.js binary was
compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,
`'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, and `'x64'`.

The same for node.git/doc/api/process.md.

sxa commented 1 year ago

Well spotted - thanks. PR raised

ilg-ul commented 1 year ago

Any idea when the RISC-V binaries will be promoted from the unofficial section to first class citizens?

sxa commented 1 year ago

I don't think anyone's really been pushing for it but as long as we have someone willing to stand up to fix any issues there isn't too much blocking it.

To be honest the main reason I haven't personally pushed it forward is because we haven't fixed the fact it's building openssl without assembler optimisation. I'm fairly certain it's not a hard fix but I haven't been able to justify spending time on it (yet) :-) We'd also need to check if there are any outstanding issues with the tests (other than any related to the openssl options)

I do run a Node web server at home on a MangoPi D1 though and it seems to have been reliable enough though...

ilg-ul commented 1 year ago

I tried a build via the nvm scripts, and I noticed that the openssl selected the wrong architecture.

I'll try to take a look at this in the near future, but I currently have only a QEMU machine to experiment with.

Can you point me to the scripts used to build the unofficial binaries?

richardlau commented 1 year ago

Can you point me to the scripts used to build the unofficial binaries?

https://github.com/nodejs/unofficial-builds/tree/main/recipes/riscv64