Allow shell selection for entire CMake Tools infrastructure #3526
Replies: 4 comments 3 replies
-
In an effort to minimize how many places we have to track these issues, I'm going to close this in favor of the various issues you mention. In response to your comments about Kits, we would suggest that you favor using CMakePresets as this is the officially supported path by Kitware (developers of CMake) and we are prioritizing CMakePresets in this extension. Thanks! |
Beta Was this translation helpful? Give feedback.
-
is this done? |
Beta Was this translation helpful? Give feedback.
-
@gcampbell-msft Can you please explain to me how CMakePresets has anything to do with shell selection? It is frustrating when maintainers do not properly read these issues. Please reopen this. |
Beta Was this translation helpful? Give feedback.
-
@benjamin-branchware My response was in 2 parts, first, I closed the discussion in favor of tracking the various issues that you referenced are already open in the repository. However, I'm happy to keep open an overall issue like this, if you could convert this or create a new issue for it. We prioritize using the issues list to prioritize work rather than the discussions pane. The second part of my response, the presets content, was regarding your large paragraph referencing things that are lacking in the kits feature. This is not prioritized as we are focused primarily on Presets. I agree that it sounds like the shell selection could be very beneficial for folks, so I'd be happy to keep an issue open provided you convert this or create a new one. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There are many open MSYS2/MinGW issues in
vscode-cmake-tools
which all stem from the same problem:There is no way to select a shell in which CMake Tools runs.
I (and many other) developers prefer to use MSYS2+MinGW or similar over MSVC and native toolchains because it provides a familiar experience for people coming from the Linux or embedded development space where we can rely on the existence of certain builtins, optimisations and features. There's also WSL of course, but I think the approach there is to treat it as a remote development environment (through the cough proprietary cough extension) - besides it doesn't build native Windows executables.
The kit specification feature is quite underpowered at the moment. One can specify compiler locations for example, but there is so much more to a complete development environment than just the frontend language compilers. There's binutils, linkers, library search paths etc. Many of the problems in open issues around Kits stems from this fact - people are trying to point CMake to their "C compiler of choice" while the rest of their environment is completely out of whack. The kit structure encourages people to fall into this trap and it is a bad design decision IMO. Operating systems typically come in "distributions" for a reason. One easy solution to this for the MSYS2 case would be to just allow us to specify which shell the tools run CMake in. You already let us specify a custom "Terminal" which can interact with MSYS2 bash no problem.
Through the
MSYSTEM
environment variable, you can spin up a MSYS2 shell geared for e.g. MinGW64 development, with the PATH correctly configured to include the prefix at C:\msys64\mingw64\bin and so on.The current development workflow for someone using MSYS2 currently consists of either: running a terminal emulator and calling cmake manually (with IntelliSense kind of getting the idea most of the time); or specifying a complex and fragile array of variables in cmake-kits.json, CMakePresets.json and settings.json to get the whole thing to work.
Beta Was this translation helpful? Give feedback.
All reactions