In my last blog post I wrote about the following stack: Git, TOBi, RPGUnit and Jenkins. At first it looks and feels really good. Small and prototype projects work really well with this stack. Everything works as expected. Incremental builds also look good.
But then you clean the workspace in the Jenkins job and need to do a fresh clone of the Git repository. And TOBi builds the whole projects regardless of any existing object from the project. Argghhhhh!!!!
Git for incremental builds … no thanx
When doing incremental builds the tool needs to check if an object needs to be built again. It needs to know which source files are involved in building the object. Then it needs to check if there was a change in any of the involved source code after the current object has been created. TOBi uses make and make checks the modified timestamp (mtime) to check if it needs to rebuild anything.
And this is where Git does not a very good job: it does not support preserving the mtime. If you do a fresh checkout all the files will get a timestamp of the current time and thus TOBi will do a full build.
There are some ways to get around that. One way is to use a timestamp from the Git log and set it on the corresponding files. But that is not very straight forward and the tool used for this also needs to be supported on the platform.
Any Git Alternative?
Today it seems that there is no other way to do source code versioning other than Git. But there are actually some other tools.
Fossil
Fossil is a very interesting piece of software. It does source code versioning but comes also with an integrated project management and a web interface.
But the one thing that is the most convincing for its usage on IBM i is the development model:
- Personal engagement
- Trust over hierarchy
- No easy drive-by contributions
- No rebasing
- Sync over push
- Branch names sync
- Private branches are rare
- Identical clones
The meaning behind each of these points are best read on the Fossil web site.
When deciding between these two DVCSes, you should ask yourself, “Is my project more like Linux or more like SQLite?”
And that is a very easy to answer question. The Linux kernel has thousand of developers and contributors. SQLite has just a handfull. Also in terms of lines of code those two projects are very different. 32 million lines of code (Linux kernel) vs 0.44 million lines of code (SQLite).
I have yet to see any IBM i development team and project which comes into the range of the Linux kernel. I would assume most are rather in the range of SQLite.
But to come back to our original reason to take a look beyond Git:
Fossil supports preserving the modification timestamp and would enable incremental builds.
Should we switch?
Currently that is not the right question as it is not really possible at the moment. Fossil does not run on IBM i … but perhaps it could. The web site states:
Fossil is largely written in ISO C, almost purely conforming to the original 1989 standard. We make very little use of C99, and we do not knowingly make any use of C11.
That sounds very promising. Perhaps with the some help from Bob and his likes we are able to port it to IBM i … and if not to IBM i directly then perhaps to PASE (AIX)?!
It doesn’t sound impossible to me.
Wrap up
Perhaps we are seeing a couple of projects in the future aiming towards an open source build and development stack for IBM i. That would be a huge thing and perhaps breathes some new life into native open source projects on IBM i.
Happy ++building!
Mihael