What is the minimal agent install footprint for Delphi build automation?
Asked Answered
H

2

9

When creating a build server that does clean version control check-outs and full system builds of everything in a given source repository or project, what is the minimum required Delphi install footprint for XE3 Win32/Win64 projects? (Core system - not 3rd party components)

I'd prefer to have a small subset of files that can be included in a repository rather than a full Delphi install.

Hostess answered 17/12, 2012 at 14:35 Comment(4)
What exactly are you looking for? A complete list of files? And what about the registry and all other parts of a Delphi install?Ctn
Whatever is needed (files/registry) to build a HelloWorld type 32|64 bit Delphi project on a clean build server.Hostess
What have you tried so far? Did you do a minimal install and capture the changes to your machine? Personally I would not even begin to contemplate what you are asking. Just create a VM with the necessary install and bootstrap from there.Ctn
The answer -- "Minimal" -- will depend almost entirely on what you are and are not using/doing in your code. I'd recommend just installing Delphi and leaving it at that. BTW, the license allows you to install a copy for the purpose of doing builds.Winter
H
4

Found a source for D2006+D2007:

https://delphi.fandom.com/wiki/Setting_up_a_Delphi_Build_Machine

Hostess answered 6/4, 2013 at 2:55 Comment(0)
T
10

Using the command line compilers, you do not need to install the IDE on the remote agent computer. From a running installation, copy the \Bin and \Lib sub-folder content into your remote agent.

Then run DCC32.exe command line compiler, changing the DCC32.CFG file content to point to all needed source code paths. Do not forget to set a temporary folder for all your .dcu generated files, and specify a .exe destination folder.

See

Update: Yes, I know, MSBuild is the "official way". But for a build agent, I found out how easier it is to work with the command line compiler. And the question here is about the "minimal footprint" to build Delphi apps.

With DCC32, nothing to install, no need to reproduce the same layout than the one in the IDE. Build environment should not be tied to the IDE configuration, and should be "clean" from any developer specificity, from my experiment. It should build from scracth and from source all your application, run the unit tests, and prepare the release. I've seen some .dcu or .bpl polluting the build process, taking hours to find out why a code modification did not be taken in account!

If you need some complex build process, I always prefer to code some lines of Delphi (or python), reading the configuration from text files, regardless of the computer the build agent runs on. It is a PITA to install Delphi on a computer just for a build (especially latest versions), and even if the license allows you to do so, whereas the command-line compiler is safe and fast to install/setup. Just copy the files, and run them. If your build agent is a virtual server (as it should be today), your IT will be pleased not to pollute the registry. If just your company IT would prefer Delphi because of its cleanness in regard to other frameworks, it is always worth it.

Tapetum answered 17/12, 2012 at 17:8 Comment(9)
You are assuming that dcc32 is the desired build mechanism. In modern Delphi it's a bad idea to do that. You should be using msbuild so that you can ensure build consistency between IDE and command line.Ctn
Yes, I'm still last century guy. ;) I just do not like MSBuild, and when it comes to some complex build sequence, a small Delphi tool is perfect: e.g. I've made some month ago a tool able to build a lot of applications involving a lot of input folders, and complex COM/.Net objects registration: some lines in a text file are enough to let an application build, including source code retrieval. I just do not like the MSBuild XML syntax. How do you parse easily customized configuration files? How do create some process including variables and loops? It is easy in Delphi, unreadable in XML.Tapetum
I agree with all of that, but the IDE builds the msbuild input files. Since I build in both IDE and command line, I want consistency.Ctn
@DavidHeffernan See my answer update. For me, consistency with the IDE is a good idea, but could also be a source of confusion. I've worked in some environment (IEC 62304) in which the build process should be from scratch, traceable and documented (including all third parties identified as SOUP). An IDE environment is probably not the same, especially if you use .bpl for your components, or have some "debug" customizable mode (like dev DB or logs).Tapetum
So, out of interest, do you use the IDE at all? What you describe works for you I am sure, but it involves scripting skills that are probably beyond most people.Ctn
Calling external command line programs is pretty basic. And Delphi makes it very easy. Easier than MsBuild if you know a bit of Delphi, which should be the case if you have to compile a Delphi app. ;) The question was about "minimal footprint", and, to my understanding, the command line compiler is this minimum. Pretty much all you need, in fact.Tapetum
Well, I would not choose Delphi for this task. I'd use a scripting language. Msbuild is trivially easy though. It's a one liner to build the project. If you don't use the IDE, then no need for msbuild and dcc32 is simpler. If you use the IDE then msbuild is a good choice.Ctn
Yes, Delphi is not mandatory to automate those building tasks: as I wrote in my answer, Python is a good candidate - but any script tool may help.Tapetum
MSBuild is 3x slower than DCC32 on my projectsAkanke
H
4

Found a source for D2006+D2007:

https://delphi.fandom.com/wiki/Setting_up_a_Delphi_Build_Machine

Hostess answered 6/4, 2013 at 2:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.