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
Hot Topic (More than 8 Replies) Rebuilding libraries every time (Read 2771 times)
NF1Z
Junior Member
**
Offline


Posts: 57
Joined: Aug 18th, 2013
Rebuilding libraries every time
May 16th, 2024 at 5:27pm
Print Post  
Hi,
I upgraded to latest VS, then latest VM.  Using VM Explorer, I upgraded ESP32 board from 2.0.14 to 2.0.15.  That was not so smooth: had to remove all the 2.0.14 SDK libraries from the solution, then re-add the 2.0.15 versions, and then change the board selection also to the 2.0.15 version.  Along the way, I had to remove the 2.0.14 package (VM Explorer) to allow it to see 2.0.15.

It all built fine.  However, re-building now causes recompilation of the libraries and the project code every time, even if zero changes are made.   Takes 12 minutes, rather then the expected time of less than one minute. This is a big change from before all the upgrading, but the solution contents are literally unchanged, including the VM options, AFAIK.

I browsed the VM options and could not see anything that was obvious to me. However, I poked about in the .vcxproj file, and I see there are still some 400 references to the 2.0.14 SDK, as well as some 600 to 2.0.15.  There are also many places where there is a newline between 2.0. and 14.  I am guessing this corruption is not unrelated to the recompilation issue, though it recompiles ALL libraries, not just SDK, and makes no complaints of corruption.

Is this so?  Related questions:  How to recover without re-defining the whole project?  What is the "official" procedure for upgrading a board?  I couldn't find anything about the latter, so I messed with it until it seemed to work.  I did manage to change from 2.0.11 to 2.0.14 some time ago, with no recompilation issue, though it wasn't easy.

Thanks for you attention.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2708
Joined: Feb 13th, 2019
Re: Rebuilding libraries every time
Reply #1 - May 16th, 2024 at 5:30pm
Print Post  
Thanks for the report.

Were/Are all of the libraries added to the Solution as Shared Projects in any way? (they will show in Solution Explorer as one shared project per-library)
  
Back to top
IP Logged
 
NF1Z
Junior Member
**
Offline


Posts: 57
Joined: Aug 18th, 2013
Re: Rebuilding libraries every time
Reply #2 - May 16th, 2024 at 6:30pm
Print Post  
Yes, all my libraries are included as shared projects, but not cloned into the project or solution.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2708
Joined: Feb 13th, 2019
Re: Rebuilding libraries every time
Reply #3 - May 17th, 2024 at 8:35am
Print Post  
Thanks for confirming.

If the project still isn't working properly, you can send us the VCXPROJ and we can clean out the bad references so it loads correctly.

When upgrading a Shared Project library, the Shared Project needs to be removed from the Solution before updating the library (in this case the board package).  Then they can be re-added after the update is complete.

It may be better in your scenario to disable the vMicro > Add Libraries > Library Advanced > Create Shared Project When Including Libraries.   

If you wish to view the library sources easily, then the vMicro > Show/Hide Hidden files can be toggled, which will add all core and library files in use into the Solution Explorer.  The advantage of this is they are dynamically updated when the files change, or the board is reselected, so there is no manual maintenance to do.

If you need to capture and use specific versions of libraries in your projects (for version control, or general stability) the Special Folders detailed on the below page offer a simple way to do this, which requires no additional configuration, and they will be found by the Deep Search automatically.
https://www.visualmicro.com/page/Special-Folders-and-Portability.aspx
  
Back to top
IP Logged
 
NF1Z
Junior Member
**
Offline


Posts: 57
Joined: Aug 18th, 2013
Re: Rebuilding libraries every time
Reply #4 - May 17th, 2024 at 2:12pm
Print Post  
Thanks for the rapid response.

With hindsight the need to remove the old shared projects before upgrading the board package makes perfect sense.

I have tried the Show/Hide Hidden Files option, but the libraries folder is empty for some reason.  I like the shared folder approach, even if there is some management.  I use solution folders to group together libraries by type and/or source, which makes it easier.  I will take a look at the link you provided.

Thanks

  
Back to top
 
IP Logged
 
NF1Z
Junior Member
**
Offline


Posts: 57
Joined: Aug 18th, 2013
Re: Rebuilding libraries every time
Reply #5 - May 18th, 2024 at 5:53am
Print Post  
Well, the corrupted VCXPROJ was not the problem.  I created a new project in the same solution, copying some files from the original project, and referenced the same libraries and shared code.  And it still recompiles all the libraries every time - with the exception of one file in the FastLED library, and takes even longer...

I experimented with the Special Folders, and I simply cannot get it to list libraries in the special folders.  I gather that all you need to do is create the folders, paste in a library, and it should appear in the Add library list?  Not working for me, does not get listed.

I also tried a solution with all my own libs moved from the solution folder into the sketchbook libraries folder except for one that has mods, so is a shared project for now.  So the libs are now just added with the Add Library control, no shared project.  I had to turn on Deep Search with the gcc -E option for it to build- it took 27 minutes or twice the time of the previous solution's full recompilation that I was complaining about.  A second build with no code changes took 30 minutes, so is there no caching?  I am new to the deep search, it not being needed with my usual solution structure, but I understood that subsequent builds should be very fast.

I also tried the other (SCons) option.  It did not build, claiming not to be able to find Preferences.h, though it was added in the same way as all the other SDK libs, all of which it did find, and the gcc -E option found it OK.  Interestingly, Intellisense has a red squiggle under the #include.

So any help would be appreciated!
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2708
Joined: Feb 13th, 2019
Re: Rebuilding libraries every time
Reply #6 - May 20th, 2024 at 2:53pm
Print Post  
Thanks for the update and the detail.

Quote:
I experimented with the Special Folders, and I simply cannot get it to list libraries in the special folders.  I gather that all you need to do is create the folders, paste in a library, and it should appear in the Add library list?  Not working for me, does not get listed.


Can you confirm which special folder setup you are using, and an example library which doesn't show as it should?
https://visualmicro.com/page/Special-Folders-and-Portability.aspx

Quote:
I also tried a solution with all my own libs moved from the solution folder into the sketchbook libraries folder except for one that has mods, so is a shared project for now.  So the libs are now just added with the Add Library control, no shared project.  I had to turn on Deep Search with the gcc -E option for it to build- it took 27 minutes or twice the time of the previous solution's full recompilation that I was complaining about.  A second build with no code changes took 30 minutes, so is there no caching?  I am new to the deep search, it not being needed with my usual solution structure, but I understood that subsequent builds should be very fast.


There is only no caching of the SCons search results currently.  Gcc-E should cache and be a lot faster the second time.

Can you attach a build log for the new and old project, for both clean build and rebuild (or email them to us if easier), using the Gcc-E Deep Search Option?

Quote:
I also tried the other (SCons) option.  It did not build, claiming not to be able to find Preferences.h, though it was added in the same way as all the other SDK libs, all of which it did find, and the gcc -E option found it OK.  Interestingly, Intellisense has a red squiggle under the #include.


If you could also send a build log where it fails to find the Preferences.h with the Scons Deep Search option as well we can look at that seperately.
  
Back to top
IP Logged
 
NF1Z
Junior Member
**
Offline


Posts: 57
Joined: Aug 18th, 2013
Re: Rebuilding libraries every time
Reply #7 - May 21st, 2024 at 1:16am
Print Post  
The Special folders feature worked as described, but required a PC reboot.  As far as I remember, restarting VS did not refresh the library list, but the PC reboot did.  Since then, I've experimented with it a little and it seems to have a lot of potential for better organizing a project.

I will email you logs of the things you requested, but I'd like to reiterate that I am still having the issue when I do not use either of the deep search options.

Thanks.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2708
Joined: Feb 13th, 2019
Re: Rebuilding libraries every time
Reply #8 - May 24th, 2024 at 10:09am
Print Post  
Can you try the latest release (24.0510.01) which can be downloaded from the top of the below board:
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

This should resolve:
1) The issue with the caching of Deep Search and Library compilations when using the Deep Search (Gcc-E) Option.
2) The correct libraries being found when using the Deep Search (Scons) Option.
« Last Edit: May 24th, 2024 at 10:10am by Simon@Visual Micro »  
Back to top
IP Logged
 
NF1Z
Junior Member
**
Offline


Posts: 57
Joined: Aug 18th, 2013
Re: Rebuilding libraries every time
Reply #9 - May 24th, 2024 at 2:38pm
Print Post  
Simon,
Thanks for that.   

There seems to be a problem with my standard solution (no deep search required):  the project name is shown as "Sketch" (s/b "Aspects") and there are no references, and no option to build.   I attach screen shot.  The .vcxproj file is much shorter than it should be, which I suppose explains it.  The odd thing is that I compiled it this morning (the .obj folder has the results dated at 6:33AM), just before I loaded the new VM version.  After restarting VS, that's what I got.   However, the file change date of the vcxproj shows May 17, so I have no idea what is happening.

The SCons option took 24 minutes for the first pass, then 8 minutes for a rebuild.

The gcc -E option also took 24 minutes for the clean build, but 28 seconds for a rebuild.

So the deep search stuff is great, but doesn't help the issue I reported.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2708
Joined: Feb 13th, 2019
Re: Rebuilding libraries every time
Reply #10 - May 24th, 2024 at 3:44pm
Print Post  
Thanks for the update, and the detail around the Deep Search part.

It sounds like the Library build caching reported when using the Gcc-E option is also fixed from the timings.

We haven't made any changes which should affect the naming or loading of projects in this latest release, so not sure why your project has a different name, and there are two unloaded projects.

Did you open the SLN by double clicking it/opening from the VS2022 splash screen?

Is it the Sketch.vcxproj which has a changed date of May17th?
  
Back to top
IP Logged
 
NF1Z
Junior Member
**
Offline


Posts: 57
Joined: Aug 18th, 2013
Re: Rebuilding libraries every time
Reply #11 - May 24th, 2024 at 4:24pm
Print Post  
Well, that is the odd thing.  The file is actually called Aspects.vcxproj, and is referred to as that in the .sln file, but it contains the lines:

Quote:
    <RootNamespace>Aspects</RootNamespace>
     <ProjectName>Sketch</ProjectName>


Since the file change date is May 19th (I mistyped May 17), I must assume this was what was active when I recompiled this morning, before the VS upgrade, so it's a mystery to me why it all seemed to work just as before (with the project still listed as 'Aspects').  I can only assume I did something really stupid on May 19th that only took effect when I reloaded it today.

I am currently rebuilding the whole solution as it was, as the deep search time is killing me.  An no-changes rebuild takes 28 seconds, but adding a one-line function to a .cpp file took 8 minutes.  Adding all the libs as projects and referencing them is more work but is much quicker.

Yes, I did open it from the VS splash screen.
  
Back to top
 
IP Logged
 
NF1Z
Junior Member
**
Offline


Posts: 57
Joined: Aug 18th, 2013
Re: Rebuilding libraries every time
Reply #12 - May 24th, 2024 at 11:26pm
Print Post  
Just to let you know, I recreated my solution and the problem seems to be fixed.  A clean build of this solution was about 12 minutes, but a couple of changes to .cpp files took about 37 seconds.

Thanks!

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