0
votes

Note: I have no experience in Delphi programming.

My problem:

-I would like to put an old Delphi project of a collegue into a git repo.

-I read that DCU files are compiler generated and even found a .gitignore template actually ignoring these files.

-After putting everything together and cloning the repo, the Delphi compiler complains about missing DCU files in the fresh clone.

-When I add the DCU files to git, everything compiles fine.

-The DCU files (at least most of them) get modified during the build process.

-Obviously, the DCU files mess up the git history and make diff's hard to read, but a project that doesn't compile is unacceptable.

What is going wrong here? Are there errors in the code when the DCU files are required for compiling? Is it correct that the compiler is asking for the files during build process? Any help is highly appreciated.

2
The compiler (not interpreter) surely tells you what DCUs are missing. Look if there are corresponding *.pas files, i.e MyTools.pas if the compiler complains about missing MyTools.dcu.Uli Gerhardt
Your problem is not the fact DCU files are missing, but the fact compiler cannot find your appropriate PAS files in order to compile them. You have to fix project search paths.Dalija Prasnikar

2 Answers

1
votes

Delphi programs are made by linking the DCU's you need together. The pas-files will be compiled to dcu files.

If for a program you don't have all the pas-files but you do have the DCU files then it can still compile.

So I would try the following: try compiling your project by removing all the modified DCU files.

This way you can find out which DCU-files you have source code for and which you don't.

0
votes

The issue was indeed that 3rd party libraries were inside the actual source like mentioned by Turrican and Rudy Velthuis. Compiling the project showed us which dcu files came from 3rd party and afterwards we had to decide for each dependency what to do with it (we got rid of some, some had to stay, because there was no way to get the source sadly). The comments by Rudy Velthuis helped a lot here.