this week I'll cover the ADOM build system - something I've started working on shortly after I got more involved with ADOM development.
As you know we provide ADOM for many different operating systems (e.g. Windows, macOS, Linux, NetBSD, OpenBSD, FreeBSD, Raspbian and AmigaOS). It would take (too) much time to manually build an ADOM executable for each operating system, so we decided to fully automate this task.
What were the requirements?
We wanted to be able to build all executables on a single computer. This would make it possible to build a new ADOM release everywhere without having to carry around a lot of hardware. We also wanted it to be fully automated without having to do manual steps.
What is the ADOM build system?
The ADOM build system (that's what we call it) is a combination of virtual machines and shell scripts that automates the creation of all the ADOM executables/packages.
We use 14 virtual machines (one for each operating system) and utilize VirtualBox for virtualization.
How does the build system work?
- everything starts with a single "make" command in the shell
- this make command then calls other shell scripts that each create a single executable
- these shell scripts execute the following steps (4-8)
- start the virtual machine
- get the specified revision of source code from the repository
- execute another makefile that compiles the source code
- download the resulting executable from the virtual machine to the current computer
- stop the virtual machine
We can build all or a single executable depending on the parameters. Since the Git migration we can also specify the revision(s) of source codes for each repository (ADOM source code, NotEye source code and Steam SDK), so we can build every version we once built again without much hassle.
How long does it take?
To speed up the creation process we start 4 virtual machines in parallel. This reduces the time required to build all 28 executables/packages to around 20 minutes.
The executables for AmigaOS and Raspbian are cross compiled to make the compilation faster (it takes around 15 minutes to compile ADOM on a RaspberryPi 1).
What are the benefits?
Automatic building of executables is less error prone than building manually. Since we can build all executables on a single computer we don't need a "server farm" with lots of different computers.
What are the drawbacks?
Keeping all the virtual machines up to date can be a time consuming task.
What about continuous integration?
In theory we could use the build system for continuous integration. But since automated testing of ADOM is not really possible (it's not a technical problem but caused by the randomness of the game) we don't use it that way.
Will you add other operating systems?
If the demand is high enough we might consider adding more operating systems.
Until next time!