I’ve been thinking a lot more about build scripts this morning now that I’ve successfully integrated NSIS with NAnt. Today is the CppUnit / NUnit integration day.
As I started generalizing my *daily* build script to handle both debug and release builds, several issues immediately popped to the forefront (thankfully mostly due to directory naming issues!) Here they are, in no particular order:
-
In my daily build, do I generate both debug and release builds?
-
Do I run unit tests on both my debug and release builds?
-
Should I check in the .EXE’s and .DLL’s generated for each build?
-
Do I bother generating distribution media (my NSIS .EXE) for both debug and release builds?
Right now, these are the solutions that I’m leaning towards (and have coded the script to):
-
Generate both debug and release builds.
-
Run unit tests against both builds - question to answer: same unit tests or subtly different ones - for example, release unit tests could have performance constraint criteria built into the tests (e.g. take less than n seconds to complete a test).
-
Check in the .EXE’s and .DLL’s generated by each build - I was tempted to leave these out since I label each daily build anyways, but these capture some configuration informatoin such as the version of the compiler used to generate them.
-
Don’t generate distribution media - make this a separate target called build-deploy
Comments are always welcome. Yes, yes, I know, I need to add a comment server … ;)
2 archived reader comments
Mort Weizen (2003-03-04)
Hi John, I was doing a search this morning on the words NSIS.EXE, because I have a problem — and I found your web-site IUNKNOWN.COM. I read it and looked into your historic links about your life — and I found it fascinating. What a remarkable range of talents you have. I would be grateful to you if you would guide me in a direction where I could solve my problem. Here is what my problem is — in a nutshell. I have been a mainframe Cobol software consultant for 26 years. 12 years ago I began to specialize in Micro Focus Cobol. For the past 8 years I have been developing a PC software package in my (in-between contracts) time. It is now completed and I am thrilled with its potential. I needed a Visual Basic script which would enable my to e-mail my (double-zipped) self-extracting module to a customer. The VB script would enable that customer to double-click on my attachment — and activate my self-extracting module, which would install my software module into the customer’s computer. I found a programmer in England when I used the software service, 2rent-a-codercoder.com. He agreed to write the VB script for $70. This he did, using a free-ware package called NSIS.EXE. It works perfectly when installing my software into WINDOWS 98, WINDOWS 2000, and WINDOWS NT operating systems. But when I tried to test it on a WINDOWS XP system the installation results in a “squinched”, compressed half-screen instead of a full-screen display. So this bug prevents me from selling my software to owners of WINDOWS XP operating systems. Nice, Huh!! Since I already paid the guy, he doesn’t respond when I ask him to repair this final bug. I am so close to victory — and yet I can’t market my software without the installation yielding a full-screen edit. Where should I go and what can I do without having to have the whole job done again by someone else. I have been out of work for almost a year and need to market my sofware to make a living. Any suggestions, John? Sincerely, Mort Weizen
Brian St. Pierre (2004-02-29)
Hi John -
Regarding: “Check in the .EXE’s and .DLL’s generated by each build - I was tempted to leave these out since I label each daily build anyways, but these capture some configuration informatoin such as the version of the compiler used to generate them.”
I know this has been up here a while, but I just happened across. In my experience, the best practice would be to check in the entire toolchain used to create the build. Then when I run a build, I check out not only the source, but the entire toolchain. You have to be careful to set your search path to only pick up the checked-out toolchain. In a lot of situations this is overkill, but when you need absolute reproducility it’s a must…
Advantages:
* Reproducibility * Backup copy of toolchain (for the case where you’ve had a product out for an extended period of time and then have to fix some weird edge condition and can’t locate the tools!) * Build environment is much more portable (i.e. when adding new developers to a team)
Drawbacks:
* Space consumption on VC server * Extra time to create a new build tree * Build trees take up more space
There’s also the possibility of a compromise between the two extremes: keep a single version controlled copy of the toolchain on your workstation and point all the copies of your build tree at it. This saves space, at the risk of letting your toolchain tree get out of date (e.g. if another developer on your team checks in a patch to the compiler).
-Brian