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 Rather long compiler command line.. (Read 209 times)
Peter D. Pruyne
Newbies
*
Offline


Posts: 5
Joined: Nov 22nd, 2024
Rather long compiler command line..
Nov 22nd, 2024 at 10:33am
Print Post  
Looking to adress an issue with compiler flags, I looked at the commandline.  Oh my.  It is 48547 bytes long.

That makes it essentially unreadable, I'm kinda impressed things don't crash under the weight of such an absurdity.

It's got 248  -I directives.

4 things about that.
- it makes ordinary examination of the commandline a nightmare.  
- it makes adding your own additional include directories hard if you don't expand the edit-list-of-entires window.  At it's initial size of 2 entries-displayed, the poor little editor is choking on 50kb of text.
- the issue is made worse on all fronts by using relative path notation to navigate to absolute (in the sense You Absolutely know those locations from the root) locations.
- in my large project work, the msvcc comandlines are order of 300bytes, these 50kb ones to compile blink seem outlandish.

Might I suggest investigating compiler response files?

Might I suggest an envvar or two along the lines of $(SolutionDir)?  The same advantages that provides in general would work well here.  It would sure help out the poor little ist-of-dirs editor, if nothing else.

One could also use a symbolic-link and shortcut 95% of the commandline volume.  If it's in a response file, perhaps it would not be work the trouble.  However, it would sure help if response files are somehow unavailable to you..

In my case the common prefix for those -I includes is:
c:\Usr\Arduino\Sketches\blink\..\..\..\..\Users\pdp\AppData\
Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\
idf-release_v5.1-632e0c2a\esp32\include\

No shock, it is to a point down into the esp32 core.   

Here is my puzzlement..

You folks have clearly got the chops.  The VisualMicro extension is an impressive piece of work.  You clearly know where the cores are, and it's gotta be you telling VS about all those -I's.  

So you know the relevant facts and are in a position code&sequence-wise to do something intelligent about it.

So, why is the compile command line 48kb?

Again, I am very impressed with VisualMicro.  I'm not trying to bust anyone's chops here.  I am just trying to set my expectations in the right zone...
« Last Edit: Nov 22nd, 2024 at 10:57am by Peter D. Pruyne »  

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


Posts: 2499
Joined: Feb 13th, 2019
Re: Rather long compiler command line..
Reply #1 - Nov 22nd, 2024 at 10:46am
Print Post  
Thanks for the report.

Visual Micro is following the Arduino Build Specification, and recipes from the ESP32 board package (which are long themselves), which together create the long command line and the added include directories.

As more libraries are added to a sketch, the command line grows, and once the 32kb windows limit is passed they will automatically snap to relative paths to ensure the compilation still works.

We could look at changing to non-Arduino standard routes for compilation, but this would move us away from the ecosystem we support.

Can you explain what the issue you are having with compiler flags is, as we will be able to point you to where you can edit these settings in vMicro easily.

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


Posts: 2499
Joined: Feb 13th, 2019
Re: Rather long compiler command line..
Reply #2 - Nov 22nd, 2024 at 11:27am
Print Post  
If you want to force the -I paths to be relative, this can be achieved by adding a local board.txt to the project (vMicro > Add Code > Add Local board.txt), and adding the attached entries.

If you then restart Visual Studio and perform a build again the -I paths should be shorter.
  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Peter D. Pruyne
Newbies
*
Offline


Posts: 5
Joined: Nov 22nd, 2024
Re: Rather long compiler command line..
Reply #3 - Nov 23rd, 2024 at 9:48am
Print Post  
Thanks for the quick reply.
(my originating issue has been resolved, my questions and expectation setting remain)

I read the specification you reference.

I find neither a prohibition on response files, nor any other restriction that would prevent their employment.  If you see one there, could you point it out?

The meat of that document is how all those -I's are arrived at and in what order, which is all well and good.  It is not about "how to build the specific command line".   

It speaks to the required result.  Which would be, by definition, unchanged with a response file containing all the generated "-I xxx"'s in the same order.

Examination of the commands issued in an actual build reveal that the response file feature is being used in this and other steps: "# recipe.hooks.core.postbuild.1.pattern" in the overall process.

So, I do not understand what you are trying to say with your response.

Maybe I'm just barking up the wrong tree.

"arduino compatability" is not something I am concerned with.  I want to use VisualStudio to: compile my code, link it with the Expressif libraries, upload and debug.   

You know, the ordinary Visual Studio ride, with some tweaks about selected-board getting driven into a different build configuration for my project (because that is surely what it is in VS-speak, a Release & a Debug for every board I add to the Project).

I didn't expect a 50k cmdline, nor 154 include directives for things I have not called or referenced in MyProject, nor "clean"ing my project to result in the next build taking forever because it's compiling the core, All of it, Again.


  I notice the option: "Arduino 2/Visual Micro (no IDE)/Configure IDE location".

Is "Visual Micro (no IDE)" really what I am looking for?   

I looked thru your docs, this page seems to be about that set of options: https://www.visualmicro.com/page/User-Guide.aspx?doc=Advanced-Config-Manager.htm...

But, it doesn't mention the "Visual Micro (no IDE)" choice at all.
Where can I learn about what that choice does?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2499
Joined: Feb 13th, 2019
Re: Rather long compiler command line..
Reply #4 - Nov 25th, 2024 at 1:51pm
Print Post  
Quote:
"arduino compatability" is not something I am concerned with

Arduino compatibility is one of the main features of Visual Micro, and we adhere to these standards to ensure code created with Visual Micro can be used by Arduino users in other IDE's.  We add additional features over and above this (Shared Projects, Serial/WiFi Debugging etc).

Quote:
I didn't expect a 50k cmdline, nor 154 include directives for things I have not called or referenced in MyProject,

The recipes which determine the command line used, are authored and maintained by the board package creator (in this case Espressif) so it is up to them to use the @file commands as they see fit.  Visual Micro simply merges and runs these recipes following the Arduino standards.

Espressif do reference a large number of internal IDF libraries in their recipes to deliver various features of their ever expanding range of MCUs.

The recipes can be overridden in a local board.txt file if you want to alter how the compilation runs for your specific builds.

Quote:
nor "clean"ing my project to result in the next build taking forever because it's compiling the core, All of it, Again.

If you enable the vMicro > Compiler > Shared Cache for Cores option, this will ensure the core is compiled separately from your project.  When cleaning the project the Shared Core will remain in tact.  If you clean the solution, the cached core will be cleaned as well.  The core is also recompiled if the command line for the core compilation is changed to ensure it is up to date with the current settings.

Quote:
But, it doesn't mention the "Visual Micro (no IDE)" choice at all.
Where can I learn about what that choice does?

The "Visual Micro (No IDE)" option will still use all of the same recipes defined by Espressif's board package.  The No IDE option simply removes the detection of settings (Sketchbook/Library/Package locations) from other IDE's (Arduino/Energia etc).  
https://www.visualmicro.com/page/User-Guide.aspx?doc=First-steps.html
« Last Edit: Nov 25th, 2024 at 5:13pm by Simon@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint