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

Avoid reconfiguration by setting param

Open liflovs opened this issue 6 years ago • 13 comments
trafficstars

Tried to use extension in production reconfiguration might take several minutes (and sometimes attempt to retrigger build after it was stopped results in reconfiguration and following crash of extension). Avoiding reconfiguration before build could deal with it I suppose. We always an do reconfiguration manually so i propose to have a way disable it by some setting or similar.

liflovs avatar Nov 22 '18 14:11 liflovs

Even if such a setting is offered, it is likely that the underlying build tool will try to do the reconfiguration itself, since CMake Tools should use the same logic as the underlying build tool. If CMake Tools is reconfiguring your project when the underlying build tool doesn't, that's a bug.

If the underlying build tool is also eagerly re-configuring your project, you may have some strange configure-dependency-ordering issues.

If you try to run the build from the command line, does a reconfigure happen before the build starts?

vector-of-bool avatar Nov 23 '18 23:11 vector-of-bool

@vector-of-bool As far as i understand there is a flow - run "cmake -PARAMS" and then cmake --build. The thing is first one is not necessary and after calling it in my case it takes lots of time and build afterwards crashes if it wasn`t completed (due to interruption) before

liflovs avatar Nov 26 '18 12:11 liflovs

Try running cmake --build . twice from your command line in your build directory. See if it runs a re-configure on its own both times. If it does this re-configure on the second build, then you have a cyclic dependency ordering issue.

CMake Tools needs to run the configure step itself if it detects there are changes, or you will otherwise have outdated configuration information.

vector-of-bool avatar Nov 26 '18 16:11 vector-of-bool

I have the same problem: if I close and reopen Visual Studio code, the next C++ (MSVC) build after reopening VSCode triggers a reconfiguration with CMake.

I already set "cmake.configureOnOpen": false but it was not enough to avoid retriggering a configuration with CMake on the first build after closing and reopening VSCode.

enricodetoma avatar Feb 10 '19 21:02 enricodetoma

I forgot to add: if I run two consecutive C++ builds without closing and reopening VSCode, the second build doesn't run CMake, so the build tool doesn't request the reconfiguration if it is not needed.

enricodetoma avatar Feb 12 '19 07:02 enricodetoma

@enricodetoma had similar behavior

liflovs avatar Feb 12 '19 07:02 liflovs

I'm also seeing the same behaviour: the extension is running the configure step every time. Running cmake --build . twice doesn't reconfigure cmake.

abmantis avatar Apr 22 '19 17:04 abmantis

I've found that this._cmakeInputFileSet.checkOutOfDate(); on cms-driver.ts is always returning true for me. Removing that fixes the issue.

abmantis avatar Apr 23 '19 11:04 abmantis

Same here, cmake always reconfigures on startup even with "cmake.configureOnOpen": false in .vscode/settings.json

blitz-research avatar Jun 26 '19 20:06 blitz-research

I'm also seeing the same behaviour: the extension is running the configure step every time. Running cmake --build . twice doesn't reconfigure cmake.

Same here in WSL with "cmake.configureOnOpen": false in .vscode/settings.json of workspace and subdirectories.

With a larger project consisting of various subdirectories the reconfigure time at startup adds up to an unpleasant waiting period. trying to sync it with my coffee breaks...

greg814 avatar Jul 18 '22 19:07 greg814

As far as I can tell, this wasn't a problem for a while (during a long period in 2022), but it is back since at least this year.

So "cmake.configureOnOpen": false doesn't seem to work reliably. (I'm not even touching anything related to cmake in the projects I work on, so there isn't even anything to configure all the time).

Is there any way to make someone take a look at this?

TSteiner93 avatar Mar 30 '23 05:03 TSteiner93

@greg814 @TSteiner93 and all: Could you please help us obtaining a repro of this behavior? A good start would be to have:

  • a codebase which is exhibiting this behavior, its Git URL would be good to clone it.
  • version of CMake being used.
  • feel free to add anything else you may think it is relevant to this problem (e.g., settings.json content).

lukka avatar Jan 11 '24 21:01 lukka

People experiencing should check that configure on open is disabled in both User and Workspace scopes. I thought I had disabled it, but was looking at the wrong scope.

HunterZ avatar Feb 19 '24 05:02 HunterZ