Hi,
csources_v2/makefile
indicates that the compiler has been ported to NetBSD only under i386/amd64. I was easily able to build it under arm64:
$ uname -a
NetBSD netbsd 10.99.2 NetBSD 10.99.2 (GENERIC64) #0: Thu Jan 19 05:39:47 GMT 2023 [email protected]:/home/sysbuild/sysbuild/evbarm64/obj/home/sysbuild/src/sys/arch/evbarm/compile/GENERIC64 evbarm
$ uname -p
aarch64
$ uname -m
evbarm
by modifying the above file, copying csources_v3/c_code/6_2 to 6_3 and replacing 'amd64' in the latter with 'arm64', however, it still reports amd64:
$ nim --version
Nim Compiler Version 1.9.1 [NetBSD: amd64]
Compiled at 2023-01-21
Copyright (c) 2006-2023 by Andreas Rumpf
git hash: f5ec4fbde3d8fb5250e2944d397448219e9053bc
active boot switches: -d:release
Large number of tests appear OK:
$ grep PASS: nim-test-netbsd11.99.2.log |wc -l
1095
$ grep FAIL: nim-test-netbsd11.99.2.log |wc -l
86
To be honest, I am not clear how to submit a pull request for this, it seems to me rather low-hanging fruit...
I tried also lang/nim from pkgsrc on the same machine, it is at the moment still at 1.6.8 and does not build, as expected. I tried briefly to look at its build.sh, but gave up - v2 is more interesting after all...
In case someone wants to try it, I'd suggest an Ampere CPU instance on Oracle Cloud - you get 4 core/24gb for free, install e.g. Ubuntu, then grab a recent NetBSD-arm64 live-image and dd it over the disk (it turned NetBSD does not publish yet arm64 live-images, so it is more complicated, but still possible).
You probably need to manually set the cpu / os combo manually.
I don't know how to do that for the bootstrap compiler part. Though, this looks promising: https://github.com/nim-lang/Nim/blob/f04f3e8bf78ab4187a395a024c94cd545c275720/compiler/installer.ini#L13
In case someone wants to try it, I'd suggest an Ampere CPU instance on Oracle Cloud - you get 4 core/24gb for free, install e.g.
That's interesting. I didn't realize Oracle Cloud would give anything for free. ;) Still that's a decentish ARM build server.
I've never tried NetBSD but it's seemed interesting for embedded use cases with the RUMP kernels and all. Have you played with those? It'd be fun to show off a Nim RUMP kernel!
After adding arm64 to the netbsd architectures, I can rebuild it with 'nimble build' and 'nimble install'; it still insists that is on amd64, though...
As far as OCI is concerned, Oracle were somewhat late to the cloud stuff compared to Google, Amazon and Microsoft; I can't compare them, but can see that their offering now is quite on the spot - one can have a decent instances for development, testing and proof of concept for some system, but certainly would not be enough for production, which is fair enough. You can see the details here -
https://www.oracle.com/uk/cloud/free/
The free tier is not eligible for custom images, but in this case overwriting the boot volume works - the NetBSD live-image contains the necessary EFI partition and boot file, the GENERIC64 kernel apparently recognises all the devices.
I haven't yet tried NetBSD in embedded environments, nor have played with rump kernel so far; I mostly follow closely -current and also pkgsrc development. BTW NetBSD can have kernel modules written in a high-level language - lua in this case.