vscode-cmake-tools icon indicating copy to clipboard operation
vscode-cmake-tools copied to clipboard

Cancel reconfigure and restart it

Open JVApen opened this issue 8 months ago • 12 comments

Brief Issue Summary

We have a project where cmake configure takes quite some time to complete (magnitude of minutes) In such a project, the automatic reconfigure when you change a CMakeLists.txt is causing quite a slowdown in the workflow. The flow:

  • Make a change: triggers the reconfigure
  • Fix your type: reconfigure can't start until the previous one is fixed
  • Wait until reconfigure is done
  • Start the configuration again (happens automatically)
  • Wait until configure is done

It would be nice if the previous cmake process (tree) can be canceled whenever a configure is requested. (Either implicitly by changing the CMakeLists.txt or explicitly pressing the "clear cache and configure")

CMake Tools Diagnostics


Debug Log


Additional Information

No response

JVApen avatar Mar 05 '25 15:03 JVApen

@JVApen If I'm understanding your issue correctly, I think the easiest way to fix this is to disable the automatic configure using the cmake.configureOnEdit setting.

gcampbell-msft avatar Mar 05 '25 15:03 gcampbell-msft

I'm aware of that option. Though earlier today I was testing with Visual Studio and that one does that cancel. Hence I felt it was worth logging as this can save quite some unneeded computing power on larger projects.

JVApen avatar Mar 05 '25 19:03 JVApen

Hi @JVApen thanks for reporting here! I tried cmake.configureOnEdit setting in VS Code, when setting it to false, automatic reconfigure is not starting if you change a CMakeLists.txt. We are very happy your issue was resolved. Thanks.

Amy-Li03 avatar Mar 06 '25 07:03 Amy-Li03

@Amy-Li03 I can work around my issue. I don't consider it solved as I have to do manual actions to trigger the configure.

JVApen avatar Mar 06 '25 07:03 JVApen

@JVApen In that case, it sounds like a feature request!

Amy-Li03 avatar Mar 06 '25 09:03 Amy-Li03

I believe that it should be able to be cancelled, often times I have to click the notifications button in the bottom bar of the screen in order to show the ability to cancel, can you try this? @JVApen Thanks

gcampbell-msft avatar Apr 22 '25 17:04 gcampbell-msft

If I press the cancel button, it indeed cancels, after which I have to press the configure button to start it again.

I think you are correct that all blocks are there and are manually triggerable. The thing I'm asking is that this happens automatically.

JVApen avatar Apr 22 '25 17:04 JVApen

@JVApen I'm not sure I understand.

What exactly isn't working for you? I believe there was confirmation that the cmake.configureOnEdit setting makes it so that the automatic configuration doesn't happen, and I think you're saying that the ability to cancel is there as well. What is it that you're saying is missing?

gcampbell-msft avatar Apr 23 '25 12:04 gcampbell-msft

@JVApen OH, are you saying that, in the event that a user has the cmake.configureOnEdit enabled, slightly modify the behavior of the automatic configure to kill the currently running configure and start again?

Currently I believe the most recent configure will fail due to there being an already running configure, but you're saying that it'd be nice, especially in the automatic configure after a saving of the CMakeLists.txt file, to instead kill the current one and start the new one?

gcampbell-msft avatar Apr 23 '25 12:04 gcampbell-msft

Yes, we are aligned. That's exactly what I'm saying

JVApen avatar Apr 23 '25 17:04 JVApen

To be clear, it still works as expected if you manually cancel and then run configure right?

gcampbell-msft avatar Apr 25 '25 15:04 gcampbell-msft

Yes, it does

JVApen avatar Apr 25 '25 15:04 JVApen