
The porting process on a large scale introduces many new problems - and also opportunities for automation and removal of tedium. In this article I discuss the ideas behind a RISC OS "autobuilder".
Introduction
When I started the Unix Porting Project, it was clear that the volume of libraries and programs I would have to deal with would soon grow to be very large, and that manual building of even a small number of them would be time-consuming, tedious and error-prone. This would likely be compounded by the quick development of many of the libraries, meaning that new versions would have to be regularly built.
The solution to this is probably obvious - to automate as much of it as possible - although how to go about this perhaps isn't immediately obvious. Some of the techniques have been covered in previous articles about Porting Tools and later on, about Cross Platform Development. These tools (which have now incidentally, been integrated into GCCSDK), take the drudgery out the actual porting process and ensure a level of consistency.
Clearly that's great, but many packages require extra steps, patches or slightly unusual things to be done so they are built correctly or at all. Once we know what these extra things are, we don't want to have to redo them every time the package is rebuilt. And even when there are no special steps to be done, that still leaves the process of fetching the latest sources, unpacking, applying any internal patches, installing and/or zipping up to make a RISC OS application as well as the usual configure and build commands.
Designing an Autobuilder
When we talk about an "autobuilder", this is just a generic term meaning a system or program that builds some sources automatically with little or no human intervention when set up. There are many types of autobuilder, and they need to be designed for a specific purpose, so don't confuse the one I have developed with others you may have heard of, or tasks you think it might be applicable for.
The autobuilder I developed was designed simply to do one thing well - fetch package sources and apply a standard set of operations to them (as well as instructions specific to that package if need be) in order to produce a RISC OS port. Sources would be obtained from the Debian package repository - not only because I could use the Debian package update mechanisms and obtain source with a single command, but because it also covered over 95% of the programs that the UPP deals with. Also less common now, but at the time that the UPP began, it was common for Debian sources to contain fixes for ARM specific behaviour - these days, developers tend to be more aware of cross platform issues or fixes have long since made their way upstream.
This would exclude sources fetched from CVS or non Debian-packaged programs, but there are mechanisms for adding these later, and the advantage of being able to automate the rest was considerable; and those others wouldn't be any worse off. Naturally, you'd also have to be on Debian system for this to work.
The Autobuilder in Action
I started developing the autobuilder a few years ago, and it has had incremental improvements ever since. Recent changes include the ability to package up libraries so others don't have to build them themselves. This was covered in another drobe article. Any library that the autobuilder builds successfully is packaged up into formats suitable for use on Unix and RISC OS and immediately published on riscos.info.
Most recently of all, I've removed some of the assumptions about locations of files and programs so that it wouldn't be as tied to my system (it used to always build packages in /tmp, for example). This would potentially enable others to make use of this powerful system and contribute to it. It also meant I could contribute it to the GCCSDK, as I did recently, with at least the potential that it would work for others. As it stands, there are still probably a handful of issues that will cause problems if you are using it anywhere else. These, however, are minor and can be fixed with a little effort.
As it stands, the autobuilder contains instructions for building over 120 programs and libraries. Many of these are common libraries that you may well have heard of - zlib, libjpeg, libpng, libxml as well as programs published by the UPP - wget, whois, lincity. Others are obscure - either required by a few programs or have been built just because it was easy to do so.
At any given time, it's very unlikely that everything will build successfully. The presence of a package in the builder means that it probably built correctly at some time in the past. Breakages are often caused by normalisation of a package's build system (such as moving to autoconf) or a RISC OS patch no longer being correct. Usually, fixes are straightforward, but the volume of changes over such a large number of packages has been sufficient for me to not be able to keep up with it in addition to all my other work. I hope that others will now be able to contribute fixes, and improve mechanisms so that upstream changes are less likely to break our autobuilt packages.
Trying it out
If you've got GCCSDK already checked out of CVS and built then you will already have most of what you need to proceed. If you haven't done this, then you may wish to re-read the Cross Platform Development article. You should make sure you have the most recent GCCSDK sources by executing a "cvs update" too.
You will also need to check out the autobuilder module from GCCSDK CVS. e.g.:
cvs -d:pserver:anoncvs@gccsdk.riscos.info:/usr/local/cvsroot co autobuilder
/usr/src/autobuilder/build -v -d cli/bzip2
Related articles
RISC OS Open: One year on
Transport Tycoon Deluxe clone port released
Did someone say "free Iyonix"?
This article has been linked to, or is available in the following formats:
| [Printable] | [Digg this] | [Blog search] |