This is my first post, so I hope it's a good one.
I have an open source C++20 project called Hajime (no relation to anime) which has cross-platform compatibility as one of its hallmark goals. It's also hosted on GitHub so I get access to their Actions VMs. Because of that, I've set up Actions to compile Hajime for 14 (!) different platforms on every commit. With all of the most common combinations covered, I thought IRIX would be the obvious next step as the SGI workstations are probably powerful enough to run the associated software and are just common enough to be practical.
To give some background, Hajime is "startup script" made for Minecraft Java Edition server software. The Java servers are essentially single-threaded (although there have been about 10 years of optimizations made to improve that) and don't require too much processing power for simple tasks. The memory requirements also fall in what a typical SGI machine could do (2-4GB is enough) so targeting IRIX seems like low-hanging fruit.
The problem is how to get IRIX builds working with GitHub Actions. The VMs they offer are pretty limited: Ubuntu, macOS, and Windows. I know that you can get Clang/LLVM working natively and through cross-compiling. However, the problem with this is that we can't spend too much time using the VMs or accessing the finished build artifacts will be annoyingly slow. I've had to solve a similar problem for compiling to ARM macOS (GitHub only offers x86 VMs), RISC-V/ARM64/ARM32hf/ARM32l/etc Linux, and any kind of FreeBSD. So, for IRIX, here's a braindump of all the possible options:
- Download a premade cross-compiler package. This is easy, but the available options are limited, and the available packages we can use for this generally target Linux. This is what I did for the Hajime Linux builds.
- Use a CMake build option. This is slightly harder and it provides some neat options, but I don't think any premade options can actually be used for IRIX. This is what I used for targeting ARM64 Windows.
- Add a Clang target flag. This only works for Apple Clang without any extra setup.
- Download an installation image, mount it, and use its libraries as a Clang sysroot. This option is extremely clever and it's the easiest way to cross-compile for FreeBSD in a Linux VM.
- Download a VM, run it, and connect to it to run a script. This is the hardest option but it theoretically works for any platform that you can make a VM with. If the architecture is different, then just use emulation. This is the only option that Hajime doesn't use.
With all this considered, I think getting Hajime available for IRIX is possible. Here's some general notes on the whole process:
- There are a few premade MIPS cross-compile packages available for Ubuntu. If I were OK with only targeting Linux on MIPS (but still running on SGI) then this would take only seconds to implement in GHA.
- Hajime doesn't use any special GUI APIs, so we can stick to pure POSIX compat.
- Hajime has a few Windows-specific code additions but those don't matter here.
- Hajime requires C++20 but might be able to work with C++17 with a couple changes.
- If FreeBSD has good ABI compat, then I could easily target Hajime for that.
- I don't have any SGI hardware myself, but I'm open to emulating IRIX or doing some other fancy method to get it working.
- A link to the project:
https://github.com/Slackadays/Hajime
Any ideas for what I can do going forward?