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) Rebuild / Clean Solution: provide shortcut via Micro Menu (Read 7582 times)
dok
Junior Member
**
Offline


Posts: 47
Joined: Apr 11th, 2019
Rebuild / Clean Solution: provide shortcut via Micro Menu
Jul 25th, 2019 at 1:55pm
Print Post  
I find myself rather frequently using "Rescan toolchains and libraries" from the Micro Menu/General popup menu.
Then, I HAVE to click "Clean Solution" from the Visual Studio top-level "Build" menu. Next, I have to click the Build & Upload menu item or toolbar button.
Rather uncomfortable - the most time in this whole operation is on the poor user, the computer completes the intermediate steps rather instantly Smiley
Could you please provide some integral shortcut functions for this?
Btw, I'm am not paranoid, but at least on the ESP8266 developing a library requires REBUILDs all the time, or the changes don't get picked up by the linker properly Sad

Additional information: The ESP8266 intrinsic libraries, and there's quite a few of them, use in their library.properties:

dot_a_linkage=true

Maybe there's a bug in the dependency tree?
« Last Edit: Jul 25th, 2019 at 3:53pm by dok »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #1 - Jul 25th, 2019 at 4:06pm
Print Post  
First of all the Build and Upload is for newer users. The standard Visual Studio Build or Debug menus provide same capability. There is nothing special about the Visual Micro Build and Upload buttons or menu items.

Your library should not need a rescan or rebuild if you have used the system that provides your library as a shared project in the solution explorer. How are you editing your library?

Dot-a-linkage is supported.
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #2 - Jul 28th, 2019 at 2:47pm
Print Post  
Pls read prev note but just a thought that maybe the cache is playing up with dot_a_linkage

Q:
Can you pls give small zip with simple example that fails in a solution with 1) shared library and 1) arduino project.

Q:
+ Assuming you do have a "references>shared project reference" from the arduino project to the lib?

Thanks
  
Back to top
WWW  
IP Logged
 
dok
Junior Member
**
Offline


Posts: 47
Joined: Apr 11th, 2019
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #3 - Jul 31st, 2019 at 10:21am
Print Post  
I think I have quite different expectations.
In Arduino IDE style, I assume that either the dependencies are managed invisibly, or at least, that those project references you are referring to are automagically detected and set up during "Rescan toolchain and libraries". Neither is the case, it seems, as there are zero entries under "references->shared project references".
I am working on changes to the ESP8266 or ESP32 core, the libraries that are integral to those BSPs, or libraries installed in <sketchbook>/libraries. All default locations, all correctly picked up by Visual Micro IDE (invisibly). With the notable exception, that the ESP8266 integral libs (<sketchbook dir>\hardware\esp8266com\esp8266\libraries) are "dot_a_linkage=true", and for those I notice that source code changes don't get picked up by the make dependency system, unless I "force rebuild".

About the "Build and Upload" button. Relinking for each upload is a minor nuisance on a fast workstation already, but if I follow your suggestion of using the standard VS menus, I still have to locate either the menu item "upload last build" deep inside the menu structure, or click "Build and Upload", right? So there's no point in using the standard menus.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #4 - Jul 31st, 2019 at 10:36am
Print Post  
It sounds like just an issue with dot_a_linkage libs not releasing cache when you make manual changes to library code. WQe can look into that. Otherwise you are saying that it is identical.

However if you are adding new files to libraries, sounds like you are not then in visual micro you will need to use the create shared libtrary option so the new files are detected. It doesn't sound like you are creating new files in libraries so maybe you can ignore.

You are wrong about the usage of menus. The short cut keys on the Build and the Debug menu can all be used. As I said it's the same. Debug>Start F5 is compile and upload , same as Debug>Start without debugging. You will see that "Build" is CTRL+SHIFT+B

File>Open Project and File>Open Solution or File>New>Project also work, again you do not need to use the vMicro menu.

All vMicro menus and buttons can be placed anywhere in the IDE menus and bars, using the standard Customization option in Visual Studio.

Adding a shared library has other advantages. It gives intellisense specific to the currently selected board of the Arduino project. It also allows you to build your own list of libraries (even multiple versions of same library) in a location outside of the standard arduino library locations. This is important if you edit the libraries you do not want your modifications to be lost when you allow arduino or visual micro update/install new library version.

As I said, I will look at the issue if it is just the dot-a-linkage but I think you could review my answer in more depth and learn some things. The arduino ide is quite slow when you click build, this is because it has to re-read everything. The functionality in visual micro gives best speed, most flexibility and better protection of your changes.

The latest release of visual micro also supports auto creation of cloned library versions for Solution or Project but you can use the same system to create your own master list of shared libraries in any folder or folders that you want. Then you can share libraries in a single solution or for multiple solutions without our code breaking in the future after arduino update.

It's worth looking into shared libraries, especially for library coders.
  
Back to top
WWW  
IP Logged
 
dok
Junior Member
**
Offline


Posts: 47
Joined: Apr 11th, 2019
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #5 - Jul 31st, 2019 at 7:08pm
Print Post  
Thanks for clarifying the actually satisfying integration with the standard build and run functionality - it wasn't obvious, so I naturally stuck to the toolbar and vMicro menu.

To make sure I wasn't sending you off bugtracking where it's just a misunderstanding on my part, I can confirm the following malfunction:

As an example, clone https://github.com/dok-net/Arduino.git master branch for the ESP8266 Arduino BSP into your sketchbook/hardware directory the usual way, …/Arduino/hardware/esp8266com/esp8266.

Assuming that you have an ESP8266 you can deploy to, use some simple sketch, Functional\ScheduledFunctional.ino for instance.

Rescan toolchains and libraries. Clean solution. Build solution -> fine.

Open ...\hardware\esp8266com\esp8266\libraries\FastScheduler\src\FastScheduler.cpp, introduce any syntax error, Build solution -> compiler error -> fine.

Undo syntax error, build solution -> SEEMS fine. Deploy, press button, serial log message appears, fine.

BUT:

Change

    void esp_loop()
    {
        loop();
        run_scheduled_functions(SCHEDULE_FUNCTION_FROM_LOOP);
    }

to

    void esp_loop()
    {
    }

thereby taking down the loop() function completely. Maybe throw in a Serial.println("loop is gone"); or whatever.

build solution -> SEEMS fine. Deploy, press button, oh, WTF! The just COMPILED changes are not in the deployed binary, but what was first compiled after the clean is there!

To verify, clean, build, deploy, only NOW the change is in the binary.

So, in short, the library archive is not refreshed from the recompiled compilation units, or it's not copied into the link directory.

This is the stuff that many wasted hours of development time are made of Wink

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #6 - Aug 4th, 2019 at 4:01pm
Print Post  
I am not seeing an issue, we might need to look to see if you have changed the cache settings in F4 project properties or global options? or maybe I haven't set the test up very well.

If you see the yellow box above it shows how to switch on verbose compile. This shows us more clearly when a library is recompiled.

For my test I select any old library (AccelStepper) and switched on dot-a-linkage for the library.

I did not use the option to add as a shared library so the #include in my .ino file was the only reference to the library.

I also opened a .cpp file from the library so that I could make a change. Then when I clicked build I could see the change had been detected and the .a archive recreated like this.

Code (C++)
Select All
Using library AccelStepper version 1.58 in folder "file:///C:/Users/tl/Documents/Arduino/libraries/AccelStepper"
  Using previously compiled file: AccelStepper.cpp.o
\2.5.0-3-20ed2b9/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ ools/sdk/include" ools/sdk/lwip2/include" ools/sdk/libc/xtensa-lx106-elf/include" "-ID:\System\WinTemp\VMBuilds\Dot_a_link_test\esp8266_generic\Release/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -fno-exceptions -DNONOSDK221=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10809 -DARDUINO_ESP8266_GENERIC -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD=\"ESP8266_GENERIC\" -DLED_BUILTIN=2 -DFLASHMODE_DOUT -DESP8266 ores\esp8266" ariants\generic" -I"C:\Users\tl\Documents\Arduino\libraries\AccelStepper\src" "C:\Users\tl\Documents\Arduino\libraries\AccelStepper\src\MultiStepper.cpp" -o \MultiStepper.cpp.o"

  Using previously compiled library archive: AccelStepper.a 



Please make a new simple test project using "File>New>Arduino Project" with empty setup() and loop() but with your library #included in the .ino code. Select your board and click build. Then make an error in your lib code and click build again. Then post the output as .txt file

Your report is a little confusing in the fact that your sketch code is acting differently but the error/change to the lib code hasn't been detected. It's possible you have two cachng issues because the .ino code shouldn't have sent any serial when you made an empty loop() and that would be unrelated to the library not being recompiled. So it is possible you options are wrong.

Let's look at the lib rebuild first and have that clear output as requested to show what is happening.

Thanks
  
Back to top
WWW  
IP Logged
 
dok
Junior Member
**
Offline


Posts: 47
Joined: Apr 11th, 2019
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #7 - Aug 8th, 2019 at 1:32pm
Print Post  
Hi - I'm not sure if your proposed demonstration leads me to what I need to show. Please let's do it my way:

- Open a copy of the Blinker example (see screenshot)
- Rebuild
- Open hardware\esp8266com\esp8266\libraries\Ticker\src\Ticker.cpp
- Just build, locate in the verbose log, just to be sure:

Code
Select All
Using library Ticker version 1.0 in folder cker"
  Using previously compiled file: er\Ticker.cpp.o

  Using previously compiled library archive: er\Ticker.a
 



- Introduce any syntax error into Ticker.cpp, build, log file contains now:

Code
Select All
Using library Ticker version 1.0 in folder cker"
lf/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__  clude" nsa-lx106-elf/include" ore" -c -Wall -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -MMD -ffunction-sections -fdata-sections -fno-exceptions -DNONOSDK22y=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10807 -DARDUINO_ESP8266_WEMOS_D1MINI -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD=\"ESP8266_WEMOS_D1MINI\" -DFLASHMODE_DIO -DESP8266 -I"D:\Users\dok\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266" -I"D:\Users\dok\Documents\Arduino\hardware\esp8266com\esp8266\variants\d1_mini" rc" duler\src" \Ticker.cpp" -o ker\Ticker.cpp.o"

Ticker.cpp: 35:2: error: found ':' in nested-name-specifier, expected

   _timer(nullptr)

Ticker.cpp: 35:10: error: expected constructor, destructor, or type conversion before '(' token
   _timer(nullptr)
  Using previously compiled library archive: er\Ticker.a 



- note file date of the Ticker.a archive file (15:08). That's from the original, successful compile... but there's more...

- Revert the previously introduced syntax error, if you feel like it, put in some change that will compile (something that triggers a compiler warning, maybe?). Build. Observe log, verify file date of the Ticker.a file (15:08):

Code
Select All
Using library Ticker version 1.0 in folder cker"
lf/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__  clude" nsa-lx106-elf/include" ore" -c -Wall -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -MMD -ffunction-sections -fdata-sections -fno-exceptions -DNONOSDK22y=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10807 -DARDUINO_ESP8266_WEMOS_D1MINI -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD=\"ESP8266_WEMOS_D1MINI\" -DFLASHMODE_DIO -DESP8266 -I"D:\Users\dok\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266" -I"D:\Users\dok\Documents\Arduino\hardware\esp8266com\esp8266\variants\d1_mini" rc" duler\src" \Ticker.cpp" -o ker\Ticker.cpp.o"
Ticker.cpp: In constructor Ticker::Ticker()
Ticker.cpp: 38:8: warning: unused variable 'f' [-Wunused-variable]
   float f = x \ 3.14

  Using previously compiled library archive: er\Ticker.a 



Attachment 2 is a screenshot that shows how the build code obviously didn't recreate the archive file.

Yes, I'm hacking intrinsic libraries, does this make all the difference? No, using
Code
Select All
dot_a_linkage 

in my own library in <sketchbook>/libraries, the same behavior, once there is an .a archive, it's never updated again.
« Last Edit: Aug 8th, 2019 at 1:35pm by dok »  

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #8 - Aug 8th, 2019 at 1:36pm
Print Post  
Ah okay thanks, we will zap the .a if the lib needs rebuild.
  
Back to top
WWW  
IP Logged
 
dok
Junior Member
**
Offline


Posts: 47
Joined: Apr 11th, 2019
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #9 - Aug 8th, 2019 at 1:54pm
Print Post  
I can't update to the latest extension gallery release.
  

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #10 - Aug 8th, 2019 at 2:01pm
Print Post  
I didn't say it was fixed I just said we now know what to fix. That message means there is no new version Smiley

However, it is now fixed in the 1908.7.2.
« Last Edit: Aug 10th, 2019 at 10:34am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #11 - Aug 8th, 2019 at 2:03pm
Print Post  
If you have other question about compile please create a new thread. This thread can then be assigned more clearly to dot-a-linkage rebuild.

If you post any questions about compile issues, please post an output showing the build with the issue or with the additional compiled files being recompiled. (in the new thread)
« Last Edit: Aug 8th, 2019 at 2:04pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
dok
Junior Member
**
Offline


Posts: 47
Joined: Apr 11th, 2019
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #12 - Aug 8th, 2019 at 2:27pm
Print Post  
I am sorry, I just wanted to let you know that I might not be using the latest version - I think I remember reading something relating to rebuilds in a recent changelog.
Also, I'm not stupid, the messagebox DOES show in error, because the Visual Studio extension updates tree keeps telling me that there is a new version - perhaps you didn't update all the version tags correctly?

Current version: 1908.5.0
New version: 1908.7.0



Rebuilding .o files like crazy COULD be related to not updating .a archives, that why I mentioned it here.
Next issues entry is coming right away.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #13 - Aug 8th, 2019 at 2:30pm
Print Post  
There was a new gallery version a few hours ago but the version that fixes the archive issue is not in the gallery yet. 

As I said, the version you need is 1908.7.2 it is not in the gallery it is here in the "work in progress" thread https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES
  
Back to top
WWW  
IP Logged
 
dok
Junior Member
**
Offline


Posts: 47
Joined: Apr 11th, 2019
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #14 - Aug 8th, 2019 at 2:42pm
Print Post  
Except, that the VSIX installer refuses to install that either, same message box... Or wait, the box appeared, but it's updating now anyway after doing VS 2017 first (I'm actively using 2019).
« Last Edit: Aug 8th, 2019 at 2:43pm by dok »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #15 - Aug 8th, 2019 at 2:53pm
Print Post  
I have refreshed the onedrive link for 1908.7.2 in the work in progress thread which might resolve the issue. This is it

https://1drv.ms/u/s!AsT00oFsGAmRnuUYREMWvnd8hdt0bA?e=GWEDKg
  
Back to top
WWW  
IP Logged
 
dok
Junior Member
**
Offline


Posts: 47
Joined: Apr 11th, 2019
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #16 - Aug 8th, 2019 at 2:55pm
Print Post  
I'm clearly doing QA here Wink
Besides the oscillating build times (now another issue here as you asked for), the static archive is not rebuilt, but the .o file and the .d file are deleted, then recompiled - every other time... so sorry, I don't agree that these are different issues from my perspective...

(using the 1908.7.2 version)
« Last Edit: Aug 8th, 2019 at 2:57pm by dok »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #17 - Aug 8th, 2019 at 3:00pm
Print Post  
The archive issue was clearly an issue that is resolved. It is possible this is related to using the arduino sketchbook\hardware folder for your custom tool chain and core. I used board manager to install esp8266 for my tests. 

We will try to reproduce over the next few days

  
Back to top
WWW  
IP Logged
 
dok
Junior Member
**
Offline


Posts: 47
Joined: Apr 11th, 2019
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #18 - Aug 8th, 2019 at 3:07pm
Print Post  
OK, one step back, the archive is rebuilt EVERY time the source changes - it's just not removed on compile failure, that confused me at first. Running the compiler every time is still an issue - but for the other report, not this one, I agree.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Rebuild / Clean Solution: provide shortcut via Micro Menu
Reply #19 - Aug 10th, 2019 at 12:20pm
Print Post  
Looks like this is correct behaiour and is caused because you generate a new version.h for every build using a custom core build event hook.

https://www.visualmicro.com/forums/YaBB.pl?num=1565275024/0#14
« Last Edit: Aug 10th, 2019 at 12:40pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint