Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Re: Speed: Build is compiling all (okay most) files each time (Read 1277 times)
Acuario
Senior Member
****
Offline


Posts: 256
Location: Spain
Joined: Aug 28th, 2015
Re: Speed: Build is compiling all (okay most) files each time
Jan 20th, 2024 at 5:21pm
Print Post  
I have been fighting this same problem for ages.

One thing I have noticed, if changes are made in a class then usually (but not always) the deep search is very quick as caching seems to work and I get "Using previously compiled file:" messages.

However ANY change to the project .ino file causes a full deep search and rebuild to occur and it´s time to make a coffee while I wait.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Speed: Build is compiling all (okay most) files each time
Reply #1 - Jan 20th, 2024 at 5:37pm
Print Post  
Please provide output your report is lightly different to the one you posted against but we would like to try to see the issue.

Thanks
  
Back to top
IP Logged
 
Acuario
Senior Member
****
Offline


Posts: 256
Location: Spain
Joined: Aug 28th, 2015
Re: Speed: Build is compiling all (okay most) files each time
Reply #2 - Jan 21st, 2024 at 6:49am
Print Post  
I have emailed the outputs.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Speed: Build is compiling all (okay most) files each time
Reply #3 - Jan 22nd, 2024 at 11:21pm
Print Post  
Thanks for the files. 

The ino change isn't causing a rebuild. Everything is from cache except for the .ino code. Even the other project.cpp files are cached because unchanged.

The deep search is configured only to search the .ino code, there are approx 15 #includes in the ino code, the deep search will execute once for each of those. This is because the ino code has changed, it has to redo the entire ino search.

We are working on an alternative deep search solution that will initially be an option you can enable. It's much faster than the arduino way of doing deep search but should have same end result.

The main problem for you is that the esp32 toolchain is probably the slowest of them all. It is painfully slow.

You might be able to work without deep search for now?

 

  
Back to top
IP Logged
 
Acuario
Senior Member
****
Offline


Posts: 256
Location: Spain
Joined: Aug 28th, 2015
Re: Speed: Build is compiling all (okay most) files each time
Reply #4 - Jan 23rd, 2024 at 7:33am
Print Post  
I have tried not using deep search but without success. 
Unless there is a way to manually add include paths then it just fails almost immediately - for example ArduinoOTA.h includes WIFIUdp.h which is not found so build fails.

This is exhibited in the following case even with deep search enabled.
When including a library it automatically gets included in the .ino file.

if I don´t need the library in the .ino code but in a class so I add the header where it´s actually needed (in the cpp) and delete the header from the ino, when I compile I get a file not found error. If the header is in the ino it compiles correctly.

Digging a bit more I have found that if the header is included in the class header then it compiles as long as the class is included in the ino. It also shows up in the deep search output. If it is in the cpp file then it doesn´t.

I´m guessing the first thing that happens is a trawl of all the linked header files to extract the included headers. These are then used in deep search. A header in a cpp file isn´t included. I assume the idea behind deep search is to avoid having to add include paths manually.

I have tested this with the TimeLib library. Adding the full path as an include in my class cpp file (I also have to add the cpp as well) removes the library from deep search and the project compiles.

#include <C:\Arduino\libraries\Time\TimeLib.h>
#include <C:\Arduino\libraries\Time\Time.cpp>


So could one (even short term?) solution to this be a method for manually adding a search path to the compiler includes path in the board.txt for example?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Speed: Build is compiling all (okay most) files each time
Reply #5 - Jan 23rd, 2024 at 3:06pm
Print Post  
I think in your board.txt you switched off the ability for deep search to inspect library sources. That means that libraries included from another library will not be found. I suggest you delete the board.txt if the functionality is not clear to you.

The deep search finds includes that are in other sources but that are NOT in the ino code.

It might be that switching off deep search and manually adding #include <WIFIUdp.h> will resolve. Without deep search, you need an #include for each library your project needs to use.

  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint