On the Delphi *.dcp files

A *.dcp file is created when Delphi builds a package. It always bothered me that the default *.dcp file location does not take into account the build configuration. For example, the default location for Win32 platform is $(BDSCOMMONDIR)\DCP; if you build a package in DEBUG configuration and then in RELEASE configuration, the release *.dcp overwrites the debug *.dcp.

But the point is: *.dcp files are needed to develop dependent packages. If you develop a single package, say PackageA, you can forget about the PackageA.dcp file and where it is located; it is simply not needed.

If you develop 2 packages, say PackageA and PackageB, and the PackageB depends on the PackageA (requires PackageA), then you can’t even fully create PackageB without specifying the location of PackageA.dcp file. In this case the solution is: rely on the default *.dcp file location and don’t change it. The build workflow should be as follows:

  • Build PackageA in DEBUG configuration
  • Build PackageB in DEBUG configuration
  • Build PackageA in RELEASE configuration
  • Build PackageB in RELEASE configuration

The release versions of *.dcp files has overwritten the debug versions, but the *.dcp files served their purpose: the compiled debug version of PackageB depends on compiled debug version of PackageA, the compiled release version of PackageB depends on compiled release version of PackageA; the *.dcp files are not needed anymore.

2 thoughts on “On the Delphi *.dcp files

  1. I agree that this has been a frustrating default path ever since XE2 shipped with multiple platform support, It is however now fixed, in 10.2.3 according to this bug report.

    • Well my point is the default path is not frustrating, it just must be used correctly. There is no need to keep the *.dcp’s on disk after all dependent packages are built, *.dcu’s are enough to build applications; and if you need to rebuild dependent packages rebuild them all, including the ones that have not been modified.

      I don’t quite understand the report, what should be fixed and what has been fixed; my point is: use the default paths and don’t change them. At least this is enough for me.

Leave a comment