You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First up, thanks for the extension. I use it constantly to generate a compilation database (CDB).
I think that the following Makefile Tools commands behave as I describe below:
"Makefile: Configure" generates a build log by running make with flags including --dry-run that cause it to print the commands needed to build all out-of-date targets. Makefile Tools then parses this to produce compile_commands.json.
"Makefile: Clean Configure" generates a build log by running make with the same flags, plus --always-make so that it prints the commands needed to build all targets.
I also think that whenever I change the "Configuration" on the Makefile Tools section of the Primary Sidebar, the extension automatically runs "Makefile: Configure". Thus, when I switch configuration, the CDB is updated, but only with information about the commands needed to build the out-of-date targets.
(BTW, I learned the above by examining the diagnostics output of Makefile Tools. This wasn't at all obvious to me, and it took a great deal of experimentation to figure this out. I suggest expanding the documentation to talk about these commands and why and when you should use them.)
When I am working on a project, I almost always have all of it already built. So, most of my targets are already up-to-date. This means that when "Makefile: Configure" runs, there are usually zero or very few commands printed by make to the build log, which means that Makefile Tools does not update very much of the CDB.
So, when I change the Configuration in the Makefile Tools section of the Primary Sidebar, I always want to regenerate all of the commands in the CDB. At least for all of my projects, changing the configuration means changing every compile command. Note that I am talking about the Configuration, not the Build target. Note that I do not make clean when I switch configurations. In my projects, different configurations actually generate completely different artefacts to different build output directories, or have other automatic rules that do not require cleaning the workspace. I think this is common even for less complex projects with, for example, release vs. debug configurations.
Thus, every time I change the Configuration:
Makefile Tools runs "Makefile: Configure". It often finds no targets needing rebuilt for the new configuration or some arbitrary small subset and makes no or minimal updates to the CDB.
I wait for that to finish, and then I immediately run "Makefile: Clean Configure" manually in order to regenerate the full CDB for the new configuration.
Therefore, I ask:
Should Makefile Tools have an option to run "Makefile: Clean Configure" whenever you switch targets instead of running "Makefile: Configure"?
Should such an option be enabled by default? (I would think this is the typical case. I can't think of when I'd change configuration and not want to regenerate the whole CDB. Maybe my understanding of how Makefile Tools works is wrong?)
Thanks for considering the questions.
The text was updated successfully, but these errors were encountered:
@b-spencer Thank you for the detailed issue and request! Updating the docs as well as your suggestions for running clean configure upon switching targets is a reasonable thing to consider, I will mark it as a request and put it on our backlog to investigate and consider! Thanks.
First up, thanks for the extension. I use it constantly to generate a compilation database (CDB).
I think that the following Makefile Tools commands behave as I describe below:
make
with flags including--dry-run
that cause it to print the commands needed to build all out-of-date targets. Makefile Tools then parses this to producecompile_commands.json
.make
with the same flags, plus--always-make
so that it prints the commands needed to build all targets.I also think that whenever I change the "Configuration" on the Makefile Tools section of the Primary Sidebar, the extension automatically runs "Makefile: Configure". Thus, when I switch configuration, the CDB is updated, but only with information about the commands needed to build the out-of-date targets.
(BTW, I learned the above by examining the diagnostics output of Makefile Tools. This wasn't at all obvious to me, and it took a great deal of experimentation to figure this out. I suggest expanding the documentation to talk about these commands and why and when you should use them.)
When I am working on a project, I almost always have all of it already built. So, most of my targets are already up-to-date. This means that when "Makefile: Configure" runs, there are usually zero or very few commands printed by
make
to the build log, which means that Makefile Tools does not update very much of the CDB.So, when I change the Configuration in the Makefile Tools section of the Primary Sidebar, I always want to regenerate all of the commands in the CDB. At least for all of my projects, changing the configuration means changing every compile command. Note that I am talking about the Configuration, not the Build target. Note that I do not
make clean
when I switch configurations. In my projects, different configurations actually generate completely different artefacts to different build output directories, or have other automatic rules that do not require cleaning the workspace. I think this is common even for less complex projects with, for example, release vs. debug configurations.Thus, every time I change the Configuration:
Therefore, I ask:
Thanks for considering the questions.
The text was updated successfully, but these errors were encountered: