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

Add recipe definition for building on riscv64 #54

Merged
merged 1 commit into from Apr 13, 2022
Merged

Conversation

sxa
Copy link
Member

@sxa sxa commented Mar 31, 2022

Configuration to allow building for RISC-V as an unofficial build platform.

Since this is my first contribution to here and I don't have access to the box used for cross-compilation I cannot verify for certain that it will work properly, but the setup seems adequate for building the latest versions for RISC-V.

(If run.sh isn't the right place to add the configure arguments, let me know)

Should e enough to satisfy the requirements to move RISC-V to experimental

Signed-off-by: Stewart X Addison sxa@redhat.com

@sxa sxa self-assigned this Mar 31, 2022
@rvagg
Copy link
Member

rvagg commented Apr 1, 2022

Well, since you've put in the effort and are already in the trust-circle, I'm going to add you to the machine! But you have two keys in GitHub, which key do you want me to put in for you? Then you can have a play to see if you can make it work live, I acknowledge that it's very difficult to actually test these things without the full setup.

@sxa
Copy link
Member Author

sxa commented Apr 1, 2022

Thanks - I use both but the main one that I have on most other machines is the one ending in VOSt - thanks!

@richardlau
Copy link
Member

Well, since you've put in the effort and are already in the trust-circle, I'm going to add you to the machine! But you have two keys in GitHub, which key do you want me to put in for you? Then you can have a play to see if you can make it work live, I acknowledge that it's very difficult to actually test these things without the full setup.

FTR I've added @sxa 's key to the machine (it wasn't there).

@sxa
Copy link
Member Author

sxa commented Apr 8, 2022

Machine is low on disk space so I cannot progress this. Raised at #55

README.md Outdated
@@ -15,6 +15,7 @@ This list of officially supported platforms is available in the Node.js [BUILDIN
* **linux-x64-musl**: Linux x64 binaries compiled against [musl libc](https://www.musl-libc.org/) version 1.1.20. Primarily useful for users of Alpine Linux 3.9 and later. Linux x64 with musl is considered "Experimental" by Node.js but the Node.js test infrastructure includes some Alpine test servers so support is generally good. These Node.js builds require the `libstdc++` package to be installed on Alpine Linux, which is not installed by default. You can add this by running `apk add libstdc++`.
* **linux-x86**: Linux x86 (32-bit) binaries compiled against libc 2.17, similar to the way the official [linux-x64 binaries are produced](https://github.com/nodejs/node/blob/master/BUILDING.md#official-binary-platforms-and-toolchains). 32-bit Linux binaries were dropped for Node.js 10 and 32-bit support is now considered "Experimental".
* **linux-armv6l**: Linux ARMv6 binaries, cross-compiled on Ubuntu 16.04 with a [custom GCC 6 toolchain](https://github.com/rvagg/rpi-newer-crosstools) (for Node.js versions earlier than 16) or Ubuntu 18.04 with a [custom GCC 8 toolchain](https://github.com/rvagg/rpi-newer-crosstools) (for Node.js 16 and later) in a similar manner to the official linux-armv7l binaries. Binaries are optimized for `armv6zk` which is suitable for Raspberry Pi devices (1, 1+ and Zero in particular). ARMv6 binaries were dropped from Node.js 12 and ARMv6 support is now considered "Experimental".
* **riscv64**: Linux riscv64 (RISC-V), cross compiled on Ubuntu 20.04 with the toolchain which the Adoptium project uses (for now...)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe note no intl?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it happens the process that auto-runs configure adds in with-intl=full-icu afterwards so it will build with that. Might be worth calling out openssl-no-asm though so I'll do that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. If you want to force --with-intl=none, try setting BUILD_INTL_FLAGS:
https://github.com/nodejs/node/blob/7533d08b947f612523a0f065c378b7ae2b6e6da3/Makefile#L65

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm I guess that could be added to the make line in the riscv64 recipe's run.sh separate from the CONFIG_FLAGS

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed the option for now and added a comment into run.sh with the info on how to add it back if we decide to change it. I think that's the best option for now.

@sxa
Copy link
Member Author

sxa commented Apr 12, 2022

Other than the fact this is overriding the --with-intl=none this is now working correctly (I suspect I'd need to unset BUILD_INTL_FLAGS in the top level Makefile to work around it. While it builds with full-intl it was causing problems (hangs IIRC) during the test suite, so it's not ideal to have it enabled at the moment, but we can iterate on that as the development moves on :-)

I've adjusted the riscv64 ccache directory on the machine to be limited to 1G for now to avoid it chewing up even more space ref: #55

This should now be good to go although I'll avoid merging until tomorrow as I'd prefer not to deploy to production while it's my evening :-) (I'm assuming that landing this will cause the docker image to be rebuilt as I've cleared off the one I'd created on the machine for testing). I've completed a run of 17.7.1 and 17.9.0.

Signed-off-by: Stewart X Addison <sxa@redhat.com>
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

Successfully merging this pull request may close these issues.

None yet

3 participants