Search code examples
delphibuildcompiler-errorsdelphi-10.2-tokyo

Delphi Tokyo 10.2 needs rebuild of whole project after code update from repo


I have a really frustrating behaviour of Delphi Tokyo. I have moved from Delphi Xe7 and the other frustrating error (out of memory) is gone (or it seems till now), but a new one appeared.

When I update my project via the code repo, its often the case that I need to rebuild the whole thing. That wouldnt be that bad if it wasnt for the fact that it takes 2-3 hours for the whole application to rebuild (have it on 2 different machines, so its not a machine specific setting). In Xe7 I never had this problem. Its strage, when I pull the update everything seems normal, and I can resolve all my uses classes (witr Ctrl + left click on the class). But when I try to compile after couple seconds I get the random error message that a class, constant or whatever cannot be resolved (even though I can still click on it and resolve it). Then I need to build the bpl and it works again

Is there anything I can set inside RAD Studio to not make this happen? The problem also is, I didnt even figure out which update (to which of the included .bpls) it is that causes this problem


Solution

  • I also have that problem sporadically, where only rebuilding helps in our 3 million lines codebase. Although I sadly cannot offer you a real solution for needing to rebuild, I can say that after clearing up Unit Dependencies it happened less and built faster. Some big Units still cause problems, but after resolving many circular Unit Dependencies and overall refactoring big Units into smaller ones it got significantly better.

    You can for example use Delphi Unit Dependency Scanner to analyze your Dependencies and easily identify circular references.

    I can also recommend taking a look at IDE Fix Pack which could speed up your build times.

    IDE Fix Pack is a collection of unofficial bug fixes and performance optimizations for the RAD Studio IDE, Win32/Win64/Andoird-ARM compiler and Win32 debugger.

    IDE Fix Pack is an IDE plugin for RAD Studio 2009-10.3 that fixes IDE bugs at runtime. All changes are done in memory. No files on disk are modified. None of your projects are modified or benefit from the IDE Fix Pack other than being compiled faster. Only the IDE gets the fixes and optimizations.

    The performance optimizations let the IDE start faster, open projects faster, optimizes the compiler’s file search algorithm, makes CodeInsight, the actual compilation and the debugger faster. It also fixes some IDE, compiler and debugger memory leaks.

    fastdcc applies the Compiler Speed Pack that is included in IDE Fix Pack on the command line compiler dcc32, dcc64 and dccaarm (XE6 and newer).

    Our 3 million lines of code build in less than 2 minutes.