Build Hell
May 7, 2007
At my place of work, we have a project that compiles for multiple platforms. Unfortunately, multiple platforms means g++ for linux, and a crazy perl script that generates a Visual Studio project out of the files instead of using g++ running under cygwin to generate executables directly. (So you have to run a bat file which runs a perl script which generates MSVS .sln and .vcproj files which you then open in MSVS and then build within the IDE.) To make this mess even further convoluted, the perl script depends on an in-house method of including dependent libraries for the generated files. Some of them use environment variables to set the path to these libs, while others assume that all portions of the project (in-house and third party) were put in the same root directory. Glorious amounts of relative path traversal occur in the form of repeated instances of “../”. This is hard to read and debug, and since dependency providing includes are at multiple levels of the filesystem hierarchy, it takes a lot of searching to find where things are defined initially.
Ideally, this system wouldn’t be so complicated and shitty.
First of all, there is no reason to be going through MSVS. It can be assumed the build system already has cygwin on it because that is how our perl script runs, so using g++ isn’t an issue. Heck, even Microsoft has a command line compiler if they wanted to use it over g++ – bottom line, there is no reason to use the GUI IDE, especially since it is only used to build the binaries.
Second, the paths in the dependency files are ridiculous. If the current system is to be kept, then the root makefile should contain the paths to each of the libs that will be used, and those variables will be passed down to the other project specific makefiles. No relative paths should be used except for when branching from that main lib environment variable.
Third, things should all be done from makefiles. In our case, it is safe to assume the build machine has cygwin on it. There is little reason to intermingle bat files and make scripts for ‘platform independence’ when we already use cygwin for perl.
I can’t believe what professional software engineers get away with.
