conan-io / conan-vs-extension

Conan Extension for Visual Studio
https://marketplace.visualstudio.com/items?itemName=conan-io.conan-vs-extension
MIT License
59 stars 34 forks source link

[Feature] Can you please add a button to force Conan to rebuild all dependencies? #236

Open Jeanmilost opened 3 weeks ago

Jeanmilost commented 3 weeks ago

I'm using the Conan Package Manager in my Visual Studio 2022.

It would be very useful if a button (or a menu item in the context menu when right-clicking the project) would allow to clear the build of the current dependencies, in order to be able to rebuild them completely.

AFAIK this is only (partially) possible by changing something in project configuration, e.g. removing and adding back the dependencies.

Would it be possible to add a such functionality? Or if it already exists, can you please explain me how to achieve that?

memsharded commented 3 weeks ago

Hi @Jeanmilost

What would be the use case? Why would you like to re-build all dependencies from source, if they are already built? The revisions and package_id mechanism mostly guarantees that this shouldn't be necessary.

Jeanmilost commented 3 weeks ago

Hello @memsharded

What would be the use case? Why would you like to re-build all dependencies from source, if they are already built? The revisions and package_id mechanism mostly guarantees that this shouldn't be necessary.

For example when I need to modify the content of the config files generated by Conan in the .conan folder (they are named Debug_Win32/x64 and Release_Win32/x64). In my case I had to add an [options] section, or change the value of compiler.runtime from dynamic to static manually to workaround a bug.

However I noticed that the dependencies were not rebuilt in this case, and I had to find a workaround to force them to rebuild. The only way I found was to remove and restore all my libraries from the Conan Package Manager.

Or perhaps I miss something and there is already an existing manner to achieve that?

memsharded commented 3 weeks ago

For example when I need to modify the content of the config files generated by Conan in the .conan folder (they are named Debug_Win32/x64 and Release_Win32/x64). In my case I had to add an [options] section, or change the value of compiler.runtime from dynamic to static manually to workaround a bug.

Dependencies doesn't need to be rebuilt when different variants of the dependencies are requested. Every different variant of the dependencies has its own unique package_id. If the package_id exists that matches your configuration, you can use it, if not it will be either downloaded from the server if it exists, or if not, the default --build=missing argument in the plugin will manage to build it from source. But force-rebuilding everything from source is unnecessary, Conan already manage that automatically and efficiently.