Jump to content
Dave Novo

Delphi 10.4.2 always recompiling in IDE

Recommended Posts

Did anyone else notice that Delphi 10.4.2 always recompiled and re-generates the EXE even if you dont make changes to your source.

In Delphi Seattle, if you pressed F9 (run) and you had not made changes to your source, the EXE launched right way, without any compile or link. But in Delphi 10.4.2 (at least for me) it is constantly compiling. On our application, it takes about 1 minute. approx 30 seconds for it to go through the compile cycle and do nothing (i.e. 30 seconds to detect that no dcus need to actually be rebuilt) then 10-20 seconds to build the EXE.

Share this post


Link to post

Are you sure it's compiling? For me, it's always linking the same exe over and over again, even if you just change a command line argument in the debugger. But compilation, no.

Share this post


Link to post

For sure its compiling. The compiling dialog is up for at least 30 seconds for us, doing nothing (I presume searching through all the dcus and realizing there is nothing to do) and then the text changes to say its building the EXE, which takes another 30 seconds.

Share this post


Link to post

A simple test doesn't show that behavior here. To eliminate the chance that the application is just too small to make that effect visible, I checked the timestamp of the exe.

 

BTW, the exe is not even recreated when I switch projects inside the project group in between.

 

Can you spot any changed files in the project folder that may be the cause for the effect you are seeing?

Share this post


Link to post

I have made a short video showing this behavior and comparing compiling the same application to Delphi Seattle

https://www.dropbox.com/s/kluroxd9554k5sv/always recompile.mp4?dl=0

 

I did note that even though the EXE is regenerated , the timestamps on the DCU are always the same (i.e. they are not being regenerated)

 

I even see this on a brand new VCL default project. I can record another video to show, but basically, here is the output folder from the first compile

image.thumb.png.08e923f8693097665c6b7a33369ff168.png

 

close the form and press F9 immediately. It very briefly pull up the screen doing a "compile" and link.

Below is the new screenshot.  Note the EXE was regenerated, but the DCU stayed the same

image.thumb.png.298a82f2f9efb8e001700980f165a8bb.png

Share this post


Link to post
14 minutes ago, Dave Novo said:

I even see this on a brand new VCL default project.

As that matches my test scenario pretty close, it may be caused by some differences in our environment. Which plugins do you have installed?

Share this post


Link to post

We have MMX (the latest version), Documentation Inspector and our own set of IDE plugins that just basically remote control SVN

Share this post


Link to post

@Uwe Raabe - seems like the culprit is MMX.  If I deactivate MMX by changing the registry to have a 'dllx' extension (and get a file not found upon loading delphi), it no longer recompiles all the time. Is there a setting in MMX that could be causing this.

In the default delphi project I am testing with above, I dont even have MMX open.

 

image.png

 

I just upgraded to the latest MMX 15.0.38.2440 and still the same problem

Edited by Dave Novo

Share this post


Link to post
1 hour ago, Dave Novo said:

Is there a setting in MMX that could be causing this.

Not something that I am aware of, but there are still areas in MMX which I am not very familiar with.

 

MMX marks the project modified when the MMX settings dialog is closed with OK or Apply is clicked, but nothing of that happened in the video.

 

The weird thing is that I made the test with MMX installed, too - and it did not happen. I do the same test with other projects and not one shows the always compile problem.

 

Can you export the MMX registry key HKEY_CURRENT_USER\SOFTWARE\Raabe Software\MMX\15.0 and send it to me so I may track that down?

Share this post


Link to post

Would it be easier to set up a time that is convenient for you to do a screenshare and you can poke around?

I have attached the .reg file. It should be pretty much a default installation, we are just getting Delphi Sydney going.

raabe software.reg

Edited by Dave Novo

Share this post


Link to post

I'm seeing this issue here and I do not have mmx installed - I did a full build, waited 1 minute and then hit Run - the exe is most definitely re-linked - oddly the exe size changes each time too. 

 

I did have GExperts and your  Stefan's uses helper plugin - disabling them made no difference - the exe is still regenerated every time! So this looks like an IDE issue not MMX or any other plugins. 

Edited by Vincent Parrett

Share this post


Link to post

@Vincent Parrett - even stranger. For me, this problem went away when I removed the 3 plugins I showed in the screenshot above. Only when I added MMX back in did the problem start again. I did add the other ones back as well and as long as MMX was not there, the second F9 launched the EXE immediately.

Share this post


Link to post

When I saw this post it triggered something that has been bugging me for a while, which is how long it takes to run after I have already compiled - so I watched the exe date time and observed the change - I don't use MMX but thought perhaps it was another (or any) plugin - so I removed them (and confirmed they were gone) before testing again - it's 100% reproducible with my main project - I didn't test with a new project though. 

Share this post


Link to post

@Vincent Parrett - It would be curious to see what happens to you with a default VCL application.  So far we have that Uwe never gets it, I get it based on MMX and it always happens for you no matter what.

Share this post


Link to post

IIRC there was (maybe still is?) an issue which causes relinking when error insight is enabled - I think it was among the many things that IDEFixPack patched.

Share this post


Link to post
18 minutes ago, Stefan Glienke said:

IIRC there was (maybe still is?) an issue which causes relinking when error insight is enabled - I think it was among the many things that IDEFixPack patched.

That could be it, I have LSP turned off due to issues, so perhaps it's Classic insight vs LSP that determines whether it occurs?  

Share this post


Link to post
1 minute ago, Vincent Parrett said:

That could be it, I have LSP turned off due to issues, so perhaps it's Classic insight vs LSP that determines whether it occurs?  

Confirmed - this only happens when Classic Code Insight is enabled. 

Share this post


Link to post

Seems it is not Classic Code Insight alone. I cannot reproduce with a fresh VCL application with either setting.

Share this post


Link to post

I was using classic mode as well, since LSP is pretty useless for complex apps in project groups in particular. In a blank VCL project, If I turn off Classic Code Insight and go back to LSP it stops recompiling every time.

 

I am not sure what MMX has to do with it, in my application, when LSP is on.

 

Note: when I did this test in Delphi Seattle, I did not see this behavior either with IDE Fix Pack or without.

I also tried toggling "Save Files when compiling or running" but that did not make a difference.

 

If I turn Classic Code Insight back on and turn off every checkbox on the "Code Insight" page on Editor->Language->Delphi it still re-links every time.

Share this post


Link to post

based on @Stefan Glienke tip above, I had a look at the IDE Fix Pack page. Look what I found

 

Fixes (for Delphi 10.3.2)

  • Prevent the IDE from re-compiling the code if you run the application right after you just compiled it. The ErrorInsight parser asking the compiler to get unit symbols invalidated the unit cache even if no actual in-memory compilation took place.

Sure enough, If I deactivate Error Insight, then classic mode stops recompiling all the time

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×