Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 CMakePresets.json
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

swinefeaster
Tomato Guru

305 Posts

Posted - Jun 17 2021 :  2:10:04 PM  Show Profile  Reply with Quote
The visual studio team has a new feature for cmake that seems to clash with Visual Assist. When I have vax enabled after generating cmake cache, I cannot compile. When I have the extension disabled, I can compile just fine. The old CMakeSettings.json method worked just fine. Seems like this might be either a file lock issue or two things trying to update the ui at the same time.

Are you guys aware of this?

thanks

feline
Whole Tomato Software

United Kingdom
17503 Posts

Posted - Jun 18 2021 :  12:21:03 PM  Show Profile  Reply with Quote
Which version, and build, of Visual Studio are you using? I am guessing VS2019, so the build might matter, if this is a new feature.

I am assuming you have turned On:

IDE Tools menu -> Options -> CMake -> Prefer using CMake Presets for configure, build, and test.

I have a problem on one system, but not on a second machine, using the same very simple CMake project. On the problem machine, when I open the IDE Build menu there are only 2 entries showing, but disabled. They are "Install Project" and "Compile".

Is this the same as what you are seeing?

I am currently trying to find out why only one machine has this problem.

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17503 Posts

Posted - Jun 18 2021 :  2:34:51 PM  Show Profile  Reply with Quote
OK, the problem is being triggered by an IDE setting, but not one of the CMake settings. It's going to take a bit of time to figure out the problem setting, but I am looking for it.

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17503 Posts

Posted - Jun 21 2021 :  10:34:21 AM  Show Profile  Reply with Quote
I have found the trigger here, but it has nothing to do with Visual Assist. If you disable the IDE intellisense parser for C++, via the setting:

IDE tools menu -> Options -> Text Editor -> C/C++ -> Advanced -> Disable Database = True

then you can no longer build a CMake project. This is what I am seeing here.

Can you please check this setting on your system? If the IDE intellisense parser is active and you are still seeing a build problem with CMake projects then this does need looking at, but the trigger isn't as simple as just adding a CMakePresets.json file to the root folder of the CMake "solution".

zen is the art of being at one with the two'ness
Go to Top of Page

VitaminCpp
Starting Member

1 Posts

Posted - Aug 04 2021 :  09:35:29 AM  Show Profile  Reply with Quote
I've the same problem...
Suddenly my "Build"-Menu only displays "Install ..." and "Compile" is disabled. So I'm not able to build my CMake project anymore inside VS.
If I disable VAX and restart VS, everything is working perfectly again.
My database isn't disabled. This happened suddenly after restarting VS! :-(
Please help, this is a Showstopper for us... :-(
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17503 Posts

Posted - Aug 04 2021 :  10:50:23 AM  Show Profile  Reply with Quote
Do you have any idea of what might have triggered this problem? An update to VA? An update to the IDE? A change to your CMake project?

Which IDE and version of VA are you using?

Can you create a simple CMake project that shows the same problem, that you would be able to share with me? I don't know much about CMake, so if you have done anything "unusual" that could be a factor, I would be difficult for me to easily set up a test case here.

If so, could you please send me both the test solution and your exported VA and IDE settings. These can be exported via:

VA Options -> Performance -> Export Settings
IDE tools menu -> Import and Export Settings -> Export selected environment settings

I can then import them here and see if I can reproduce the problem.

Please send me the files via email:

support@wholetomato.com

including this thread ID or URL in the description, so we can match it up.

zen is the art of being at one with the two'ness
Go to Top of Page

goranw
New Member

Sweden
6 Posts

Posted - Nov 16 2021 :  07:57:59 AM  Show Profile  Reply with Quote
Any update on this issue? We're seeing this on multiple computers for different users on different CMake projects.

If we have VAX enabled we get the issue (missing build/compile commands in VS menus) most of the times when opening a CMake folder in VS2019. If we disable VAX and restart, opening a CMake folder works as expected.

My guess is that VAX blocks some background processing that Visual Studio does when opening a CMake folder, or that it causes some kind of "race condition" during load, with the result that Visual Studio fails to populate the "Build All" etc context/menu commands properly...

System info:

Microsoft Visual Studio Professional 2019 Version 16.11.6

VA_X.dll file version 10.9.2435.0 built 2021.10.28
DevEnv.exe version 16.11.31829.152 Professional
msenv.dll version 16.0.31829.152
Comctl32.dll version 6.10.19041.1110
Windows 10 10.0 2009 Build 19042.1348
12 processors (x86-64, WOW64)
Language info: 1252, 0x409
Platform: Win32
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17503 Posts

Posted - Nov 16 2021 :  09:03:39 AM  Show Profile  Reply with Quote
That should not be happening. I have just had an email report of an identical problem, so its not just you, unless you also sent the email

If you have the time, can you please try making a very simple test solution?

If you just take the cmakelists.txt file from your main solution, and one simple "hello world" cpp file, and use this to make a new test solution, do you still get the same problem? It doesn't matter if the build fails, I am just trying to get a very simple test case that you would be able to share, so I can study it here and try to reproduce the problem.

The only VA setting that should effect debugging, not even building, is:

VA Options -> Debug Assistance -> Enable debugger integration required by VA Step Filter for native C/C++

Another possibility is an interaction bug between VA and another extension. To test this

Can you please close all instances of the IDE and then run the command:

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\devenv.exe" /RootSuffix VATest

this will create and load a new, default profile for Visual Studio, so you will be asked which basic settings you want to use, and you should only have the standard, default IDE extensions installed. Visual Assist will not be installed into this profile, so you will need to go into the dialog:

IDE Extensions menu -> Manage Extensions

and install Visual Assist from the online extension store, to install VA for this test profile.

To load your normal, default profile just load the IDE normally. To return to this test profile again, pass the /RootSuffix command line switch when loading the IDE. You can run both profiles at the same time, next to each other. In VS2019 the profile name will be shown just under the close button, in the top right hand corner of the main IDE window. If you export your IDE settings from your main profile you can them import them into the test profile.

If you do this, do you get the same cannot build problem in the test profile? Or is this build problem profile specific? Does importing your IDE settings into the test profile make any difference?

zen is the art of being at one with the two'ness
Go to Top of Page

goranw
New Member

Sweden
6 Posts

Posted - Nov 18 2021 :  06:37:14 AM  Show Profile  Reply with Quote
quote:
Originally posted by feline

That should not be happening. I have just had an email report of an identical problem, so its not just you, unless you also sent the email

If you have the time, can you please try making a very simple test solution?
...



I did not send the email. ;)

I'm now looking at minimizing a sample. It's important to note here that the issue does not appear every time you load the CMake folder. After reducing the content of my CMakelists.txt file, it loaded fine the first time after restarting Visual Studio 2019 (now updated to v16.11.7). But on second restart I got the issue back. So it seems slightly random or somehow accumulating...

Disabling the Debug Assistance does not help.
Go to Top of Page

goranw
New Member

Sweden
6 Posts

Posted - Nov 18 2021 :  07:27:12 AM  Show Profile  Reply with Quote
I tested the [/RootSuffix VATest] command line. Here are my results:

* First start (no VAX installed) -> Folder loads and Build menu is correctly populated.

* Installed VAX and exited -> VAX installer runs.

* Second start (VAX installed) -> Folder loads, but Build menu only shows Install and (Compile).

* Project :: CMake Cache :: Delete Cache -> CMake clean successful.

* Project :: Configure <target> -> CMake configure successful, no change in Build menu.

* Build :: Compile (hello.cpp) -> Output Window switches to Build output, "... Build succeeded."

* CMake targets view :: <main target> (executable) => (right-click) Build -> Output Window switches to Build output, but no text appears! Status bar shows "Building CMake project finished". (Nothing seems to happen behind the scenes here, no output on disk...)

NOTE: The last line should be contrasted with when I start without VAX, where the Build output says either "... Building CXX object <hello.cpp.obj> ... Linking CXX executable <target> ..." or "ninja: no work to do." (while the issue causes the Build output to be entirely blank).

Edited by - goranw on Nov 18 2021 07:31:18 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17503 Posts

Posted - Nov 18 2021 :  07:57:44 AM  Show Profile  Reply with Quote
Another user has found a tiny example, based on their problem, that shows this bug, which allowed me to reproduce it here. What I am seeing here seems identical to what you are seeing:

case=146429

I would still be very interested in any example CMake project you could share that produced the same problem, to compare, and help us make sense of this. Just the build files without any source code may well be enough, if you are able to share these. They would only be used for testing purposes, but I do realise that often sharing any code details is simply not an option. Still worth asking just in case.

You can send files via email if this helps, please use:

support@wholetomato.com

including this thread ID or URL in the description, so we can match it up.

zen is the art of being at one with the two'ness
Go to Top of Page

goranw
New Member

Sweden
6 Posts

Posted - Nov 18 2021 :  11:01:24 AM  Show Profile  Reply with Quote
quote:
Originally posted by feline
...
I would still be very interested in any example CMake project you could share that produced the same problem, to compare, and help us make sense of this.



I'm able to reproduce the issue using the following minimal example of 3 files, under certain conditions (see below).


hello.cpp :

#include <iostream>
int main() {
    std::cout << "Hello World!" << std::endl;
    return 0;
}



CMakeLists.txt :

cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
PROJECT(vax_issue LANGUAGES CXX)
add_executable(hello_world hello.cpp)



CMakePresets.json :

{
  "version": 3,
  "configurePresets": [
    {
      "name": "windows-debug",
      "generator": "Ninja",
      "binaryDir": "${sourceDir}/out/build/${presetName}",
      "architecture": {
        "value": "x64",
        "strategy": "external"
      },
      "cacheVariables": {
        "CMAKE_BUILD_TYPE": "Debug"
      },
      "vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] } }
    }
  ],
  "buildPresets": [
    {
      "name": "windows-debug",
      "configurePreset": "windows-debug"
    }
  ]
}



Conditions for reproduction:

* (Re-)Try a few times, since sometimes the issue does not appear on first start.

* IMPORTANT: I can only reproduce the issue when the above 3 files are residing in a folder where there are lots of subfolders containing source code, so that VAX (and VS) has a lot of initial indexing to perform on "Open Folder". If I put the above 3 files in an otherwise empty folder I seem unable to reproduce the issue.

* NOTE: the issue seems to "persist" during a session in VS, so if I reproduce the issue in a crowded folder and then directly open the otherwise empty folder (without exiting VS in between) then the issue appears there too...

* If I remove the CMakePresets.json (i.e. reverting to default / CMakeSettings.json usage), I seem unable to reproduce the issue - just like the original post described.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17503 Posts

Posted - Nov 19 2021 :  11:57:27 AM  Show Profile  Reply with Quote
Thank you for the files, I am seeing the same results here. Interesting, it clearly shows the bug but needs a different set of conditions to trigger. Very useful to have a second example to study.

I have confirmed that the bug started with an update to VS2019, but so far I don't know which update. I have just confirmed that a very early version of VS2019 doesn't have this problem, even with the current version of VA.

Is this a recent problem for you? If so do you have any sense of how recently this might have broken, to help try and narrow down a working version of VS2019 that you might be able to use?

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2021 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000