"Build Delphi" action generate .cfg file fail build .dpk in parallel build

I am using “Build Delphi” action to build .dpk files (not .dproj files) with Delphi XE8 compiler.  I have four configurations to build:

  • Win32 and Debug
  • Win32 and Release
  • Win64 and Debug
  • Win64 and Release

I wish to use “Async Action Group” to build these four configuration at once.  However, the build process will fail with message eventually:

–> Cannot create file “C:\Users\coder\Development\lib\components\spring4d\Packages\DelphiXE7\Spring.Base.cfg”. The process cannot access the file because it is being used by another process

I realize that each “Build Delphi” action shall create a .cfg file before build for each .dpk file.  Is that possible to avoid creating .cfg file and allow us to enjoy building in parallel by passing parameters to dcc32.exe with command line parameters?

Hi Chau,

At this stage to compile different configurations for packages the cfg file needs to be created each time. The Delphi compiler also expects the cfg file name to be the same as the package\project name.

Currently the only way we have been able to get around this in the past is to use separate directory structures for each build. This would mean copying the libraries to directories specifically for each compilation. Then updating the directories used for the libraries through the Delphi build action.

I use dcc32.exe with my own parameters as workaround.

The reason we write out the .cfg is that there is a limite to how much can be specified on the command line. If your library or search paths are too long strange things happen.

1 Like

My working solution is to copy project source files before build with another unique names - .dpr .dproj and possibly .ridl with some editing of copies then build this project then rename result as you need and cleanup. It solves all conflicts. You don’t need separate library directory structures.