Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad CMake executable "C:\Program Files\CMake\bin\cmake.exe". #685

Closed
jeverton opened this issue May 16, 2019 · 41 comments
Closed

Bad CMake executable "C:\Program Files\CMake\bin\cmake.exe". #685

jeverton opened this issue May 16, 2019 · 41 comments
Labels
Feature: configure help wanted we currently are not planning work on this and would like help from the open source community more info needed More info is needed from the community for us to properly triage and investigate.

Comments

@jeverton
Copy link

Brief Issue Summary

I had been using the extension for several months with little issue. One day, it stopped working. I get this error:
Bad CMake executable "C:\Program Files\CMake\bin\cmake.exe". Is it installed or settings contain the correct path (cmake.cmakePath)?
That path is correct, and I can still run cmake from the command line using that absolute path, as well as by the command line finding it in my PATH.

Expected:

  1. Push Configure button
  2. Project is configured.

Apparent Behavior:

  1. Push Configure button
  2. Error pops up. (text given above).

CMake Tools Log

2019-05-16T00:08:57.844Z [debug] [rollbar] Updated Rollbar payload {"environment":"production","packageJSON":{"name":"cmake-tools","version":"1.1.3"},"client":{"code_version":"1.1.3"},"platform":"win32"}
2019-05-16T00:08:57.957Z [debug] [kit] Reading kits file C:\Users\joee\AppData\Local\CMakeTools\cmake-tools-kits.json
2019-05-16T00:08:57.957Z [debug] [kit] Not reading non-existent kits file: c:\Users\joee\dev\cmaketest\.vscode\cmake-kits.json
2019-05-16T00:08:57.994Z [info] [kit] Successfully loaded 12 kits from C:\Users\joee\AppData\Local\CMakeTools\cmake-tools-kits.json
2019-05-16T00:08:57.996Z [debug] [main] Safe constructing new CMakeTools instance
2019-05-16T00:08:57.996Z [debug] [variant] Constructing VariantManager
2019-05-16T00:08:57.998Z [debug] [main] Constructing new CMakeTools instance
2019-05-16T00:08:57.998Z [debug] [main] Starting CMakeTools second-phase init
2019-05-16T00:08:57.998Z [debug] [rollbar] Checking Rollbar permissions
2019-05-16T00:08:57.998Z [debug] [rollbar] Rollbar enabled?  true
2019-05-16T00:08:58.033Z [info] [variant] Loaded new set of variants
2019-05-16T00:08:58.034Z [debug] [main] CMakeTools instance initialization complete.
2019-05-16T00:08:58.036Z [debug] [kit] Reading kits file C:\Users\joee\AppData\Local\CMakeTools\cmake-tools-kits.json
2019-05-16T00:08:58.051Z [info] [kit] Successfully loaded 12 kits from C:\Users\joee\AppData\Local\CMakeTools\cmake-tools-kits.json
2019-05-16T00:08:58.063Z [debug] [kit] Not reading non-existent kits file: c:\Users\joee\dev\cmaketest\.vscode\cmake-kits.json
2019-05-16T00:08:58.739Z [error] [main] Failed to get version information for CMake during upgarde
2019-05-16T00:09:04.013Z [debug] [extension] [6342] cmake.configure started
2019-05-16T00:09:04.013Z [debug] [extension] Start selection of kits. Found 13 kits.
2019-05-16T00:09:04.013Z [debug] [extension] Opening kit selection QuickPick
2019-05-16T00:09:07.778Z [debug] [extension] User selected kit  {"label":"VisualStudio.14.0 - x86","description":"Using compilers for VisualStudio.14.0 (x86 architecture)","kit":{"name":"VisualStudio.14.0 - x86","visualStudio":"VisualStudio.14.0","visualStudioArchitecture":"x86","preferredGenerator":{"name":"Visual Studio 14 2015"}}}
2019-05-16T00:09:07.779Z [debug] [rollbar] Updated Rollbar payload {"kit":{"name":"VisualStudio.14.0 - x86","visualStudio":"VisualStudio.14.0","visualStudioArchitecture":"x86","preferredGenerator":{"name":"Visual Studio 14 2015"}}}
2019-05-16T00:09:07.779Z [debug] [main] Injecting new Kit into CMake driver
2019-05-16T00:09:07.781Z [debug] [main] Run configure  
2019-05-16T00:09:07.781Z [debug] [main] Saving open files before configure/build
2019-05-16T00:09:08.376Z [debug] [extension] [6342] cmake.configure finished (returned -1)
2019-05-16T00:09:38.911Z [debug] [extension] [9226] cmake.viewLog started
bug] [extension] [5962] cmake.viewLog started
2019-05-16T00:06:42.724Z [debug] [extension] [5962] cmake.viewLog finished (returned undefined)
2019-05-16T00:07:54.282Z [debug] [extension] [5563] cmake.configure started
2019-05-16T00:07:54.282Z [debug] [main] Run configure  
2019-05-16T00:07:54.282Z [debug] [main] Saving open files before configure/build
2019-05-16T00:07:54.894Z [debug] [extension] [5563] cmake.configure finished (returned -1)
2019-05-16T00:08:01.181Z [debug] [extension] [3999] cmake.configure started
2019-05-16T00:08:01.181Z [debug] [main] Run configure  
2019-05-16T00:08:01.182Z [debug] [main] Saving open files before configure/build
2019-05-16T00:08:01.769Z [debug] [extension] [3999] cmake.configure finished (returned -1)
2019-05-16T00:08:05.661Z [debug] [extension] [1908] cmake.configure started
2019-05-16T00:08:05.662Z [debug] [main] Run configure  
2019-05-16T00:08:05.662Z [debug] [main] Saving open files before configure/build
2019-05-16T00:08:06.260Z [debug] [extension] [1908] cmake.configure finished (returned -1)
2019-05-16T00:08:07.230Z [debug] [extension] [8321] cmake.configure started
2019-05-16T00:08:07.233Z [debug] [main] Run configure  
2019-05-16T00:08:07.233Z [debug] [main] Saving open files before configure/build
2019-05-16T00:08:07.790Z [debug] [extension] [8321] cmake.configure finished (returned -1)
2019-05-16T00:08:18.032Z [debug] [extension] [4776] cmake.viewLog started
2019-05-16T00:08:18.110Z [debug] [extension] [4776] cmake.viewLog finished (returned undefined)
2019-05-16T00:08:53.117Z [debug] [extension] [4252] cmake.resetState started
2019-05-16T00:08:53.118Z [debug] [extension] [4252] cmake.resetState finished (returned undefined)
2019-05-16T00:08:53.168Z [debug] [extension] Deactivate CMakeTools
e.setVariant finished (returned false)
2019-05-15T23:15:01.394Z [debug] [extension] [2983] cmake.setVariant started
2019-05-15T23:15:04.686Z [debug] [extension] [2983] cmake.setVariant finished (returned false)
2019-05-15T23:16:33.379Z [debug] [extension] [7517] cmake.setVariant started
2019-05-15T23:16:37.191Z [debug] [main] Active build variant changed
2019-05-15T23:16:37.194Z [debug] [main] Run configure  
2019-05-15T23:16:37.195Z [debug] [main] Saving open files before configure/build
2019-05-15T23:16:38.147Z [debug] [extension] [7517] cmake.setVariant finished (returned true)
2019-05-15T23:19:58.161Z [debug] [extension] [7558] cmake.configure started
2019-05-15T23:19:58.161Z [debug] [main] Run configure  
2019-05-15T23:19:58.162Z [debug] [main] Saving open files before configure/build
2019-05-15T23:19:58.795Z [debug] [extension] [7558] cmake.configure finished (returned -1)
2019-05-15T23:25:26.998Z [debug] [extension] [1615] cmake.configure started
2019-05-15T23:25:27.000Z [debug] [main] Run configure  
2019-05-15T23:25:27.000Z [debug] [main] Saving open files before configure/build
2019-05-15T23:25:27.638Z [debug] [extension] [1615] cmake.configure finished (returned -1)
2019-05-15T23:28:19.000Z [debug] [extension] [1460] cmake.clean started
2019-05-15T23:28:19.001Z [debug] [main] Run build clean
2019-05-15T23:28:19.637Z [fatal] [rollbar] Unhandled exception: Unhandled Promise rejection: clean Error: Impossible: CMake driver died immediately after successful configure {}
2019-05-15T23:29:42.344Z [debug] [extension] [6241] cmake.clean started
2019-05-15T23:29:42.345Z [debug] [main] Run build clean
2019-05-15T23:29:42.997Z [fatal] [rollbar] Unhandled exception: Unhandled Promise rejection: clean Error: Impossible: CMake driver died immediately after successful configure {}
2019-05-15T23:29:46.657Z [debug] [extension] [8631] cmake.build started
2019-05-15T23:29:46.658Z [debug] [main] Run build 
2019-05-15T23:29:47.276Z [fatal] [rollbar] Unhandled exception: Unhandled Promise rejection: build Error: Impossible: CMake driver died immediately after successful configure {}
2019-05-15T23:29:55.438Z [debug] [extension] [2746] cmake.configure started
2019-05-15T23:29:55.439Z [debug] [main] Run configure  

Platform and Versions

  • Operating System: Windows 10
  • CMake Version: 3.14.4
  • VSCode Version: 1.33.1
  • CMake Tools Extension Version: 1.1.3
  • Compiler/Toolchain: multiple.

Other Notes/Information

I uninstalled cmake, reinstalled the latest version.
I uninstalled VS code, reinstalled the latest version.
I may have had other Cmake extensions installed at some point, but they are all removed now.
I already tried resetting the extension just now. No effect.

@KoeMai
Copy link
Contributor

KoeMai commented May 16, 2019

Hey, it looks like a broken cmake path, or wrong cmake executable or missing Flfiles to start cmake.

What happens if you call cmake -version from a terminal inside of vscode?

What does the cmake.cmakePath settings looks like?

@jeverton
Copy link
Author

It does look that way, doesn't it?

cmake -version from the vscode terminal works fine.

C:\Users\joee\dev>cmake --version
cmake version 3.14.4

CMake suite maintained and supported by Kitware (kitware.com/cmake).

cmake.cmakePath is the path to the file. If I use this from the command line or the vs code terminal, it finds cmake, no problem.

I have also tried resetting this settings to the default, which is just "cmake". That doesn't work either. I have done all this for user settings and workspace settings. No luck.

Bear in mind, this was working fine for months, and just started failing with this error one day. I don't recall changing any settings right before it happened.

@KoeMai
Copy link
Contributor

KoeMai commented May 17, 2019

Sorry, I can not reconstruct your problem. There are no debug information to detect the return code or output of cmake. Maybe you could debug, an give me more detail whats happens in cmake-executable.ts function getCMakeExecutableInformation.

@jeverton
Copy link
Author

Thanks. I'm going to try this soon -- hopefully next week.

KoeMai added a commit to KoeMai/vscode-cmake-tools that referenced this issue Jun 8, 2019
@nackdai
Copy link

nackdai commented Aug 11, 2019

I have also faced on same problem.

My environment is below.

Ubuntu 18.04 TLS
cmake 3.15.0 : /usr/local/cmake
vscode 1.37.0

And, my error log in vscode is below.

Bad CMake executable "". Is it installed or settings contain the correct path (cmake.cmakePath)?

@bobbrow bobbrow added the more info needed More info is needed from the community for us to properly triage and investigate. label Aug 12, 2019
@nackdai
Copy link

nackdai commented Aug 13, 2019

I installed cmake again like below.

$ sudo ./cmake-3.7.2-Linux-x86_64.sh
$ sudo mv cmake-3.7.2-Linux-x86_64 /opt
$ sudo ln -s /opt/cmake-3.7.2-Linux-x86_64/bin/* /usr/bin

After that, it seems that vscode recognize cmake and cmake-tools also recognize cmake.

@nackdai
Copy link

nackdai commented Aug 15, 2019

I installed cmake again like below.

$ sudo ./cmake-3.7.2-Linux-x86_64.sh
$ sudo mv cmake-3.7.2-Linux-x86_64 /opt
$ sudo ln -s /opt/cmake-3.7.2-Linux-x86_64/bin/* /usr/bin

After that, it seems that vscode recognize cmake and cmake-tools also recognize cmake.

It seems that my problem depends on vscode.
It seems that vscode doesn't recognize cmake which is not path to /usr/bin

@bobbrow
Copy link
Member

bobbrow commented Aug 15, 2019

@nackdai your environment says you put cmake in /usr/local not /usr/local/bin, is that correct? Is /usr/local in your $PATH? The extension only auto-detects cmake if it's in your $PATH.

@nackdai
Copy link

nackdai commented Aug 16, 2019

Sorry, I miss-typed in my first comment.
I write my situation again.

  1. I installed cmake as /usr/local/bin/cmake and set /usr/local/bin/ in my $PATH.
    But, in that case, it seemed that cmake was not detected automatically.

  2. I removed cmake from /usr/local/bin/cmake and installed cmake again like below

$ sudo ./cmake-3.7.2-Linux-x86_64.sh
$ sudo mv cmake-3.7.2-Linux-x86_64 /opt
$ sudo ln -s /opt/cmake-3.7.2-Linux-x86_64/bin/* /usr/bin

In that case, it seems that cmake is detected automatically.

What difference are there between 1. and 2.?

@bobbrow
Copy link
Member

bobbrow commented Aug 16, 2019

The extension uses which cmake to find the path to cmake. There should have been no difference between the locations if your $PATH includes /usr/local/bin

@nackdai
Copy link

nackdai commented Aug 21, 2019

I installed cmake as /usr/local/bin/cmake and set /usr/local/bin/ in my $PATH.
But, in that case, it seemed that cmake was not detected automatically.

In above case, cmake tools ran after I set cmake path directly like below.

[Settings]->[Extensions]->[CMake Tools Configuration]->[CMake:Cmake Path]
/usr/local/bin/cmake

@jeverton
Copy link
Author

jeverton commented Oct 26, 2019

I finally got around to playing with this today. I started with a fresh install of windows 10 (I was required to upgrade), cmake, VS code, the plugin -- everything. I still got this error. I wondered if the plugin might not like a cmake path with spaces in it, since my path did. I tried uninstalling / reinstalling cmake in c:\cmake, and the problem went away.
It appears that the plugin is not currently compatible with the default cmake install folder on Windows. It'd be nice if it could support spaces in that path.
I really do wonder how I'm the only one filing a defect about this if that is all it was.
I also wonder how I had it working before, and then it stopped suddenly. I don't recall moving my cmake installation. I would like to think that the plugin used to support spaces in the path, and then a bug was introduced that broke that, and my updating the extension on my PC introduced the problem for me. That does not seem likely, but that's all I've got.

@bobbrow
Copy link
Member

bobbrow commented Oct 28, 2019

The extension does work with a version of CMake that has spaces in the path, so I think there's some other variable causing the problem. Can you share your settings?

@jeverton
Copy link
Author

Sure. It's a fresh VS.code install. I haven't set very much. The difference between working and not was where cmake was installed.

{
    "cmake.sourceDirectory": "${workspaceRoot}/projects/projname",
    "cmake.buildDirectory": "${workspaceRoot}/projects/projname",
    "cmake.configureOnOpen": true
}

@bobbrow
Copy link
Member

bobbrow commented Oct 28, 2019

What do you get when you run cmake --version?

@bobbrow
Copy link
Member

bobbrow commented Oct 28, 2019

(For context, I'm trying to emulate the code path that you're going through. Something seems to have failed around this point where we are detecting your CMake version. Note that this code has changed a little bit in version 1.2.0 which is being released this week, but I am testing on 1.1.3 to try to figure out your issue.)

@jeverton
Copy link
Author

cmake version 3.16.0-rc2

That matches the version on the cmake install packages that I used for both "c:\program files\cmake" and "c:\cmake".

I did just notice that I used their .msi for the program files one, and the zip file for the c:\cmake one, which works. There could be a difference there, but it seems unlikely.

@bobbrow
Copy link
Member

bobbrow commented Oct 28, 2019

If you're using a custom cmake path, I didn't see it in the settings you've shared. How are you specifying cmake.cmakePath? Are you using \\ for slashes in the json? e.g.: C:\\program files\\cmake\\bin\\cmake.exe

@jeverton
Copy link
Author

jeverton commented Oct 28, 2019

You're right. I'm not currently setting cmake.cmakePath. I played around with that quite a bit, using \\ and /. I could not get it to work before -- I generally saw the "Bad CMake executable" error.

Now that it is working, I see it log the following in the output:
[proc] Executing command: C:\\cmake\\cmake-3.16.0-rc2-win64-x64\\bin\\cmake.exe --build ...

On the settings page, I can leave it with the default Cmake Path, "cmake", and it works. I can also enter "c:\cmake\cmake-3.16.0-rc2-win64-x64\bin\cmake.exe", which appears in the json as "c:\\cmake\\cmake-3.16.0-rc2-win64-x64\\bin\\cmake.exe", and it works. If I introduce a typo, I start getting this error again. This seems correct, now.

However, I'm pretty sure I tried all of this before when cmake was in "c:\program files\cmake", and I could not get it to work.

I do have cmake.exe in my path, and at one point I had to set 'CMAKE_ROOT`. But I don't think those help the plugin find the binary.

Are you not able to reproduce the problem with cmake installed under "c:\program files"?

@bobbrow
Copy link
Member

bobbrow commented Oct 28, 2019

Are you not able to reproduce the problem with cmake installed under "c:\program files"?

Correct, I cannot repro the problem with cmake installed under C:\Program Files. And the extension does not check CMAKE_ROOT when looking for the binary.

@jeverton
Copy link
Author

I tried re-installing from the msi to "C:\program files\cmake\bin\cmake.exe". I can type that into the command line with quotes, and the shell finds and runs it fine. The extension does not find it.

If I point the extension at my "c:\cmake\cmake-3.16.0-rc2-win64-x64\bin\cmake.exe", it works. If I rename that folder (It's from the zip, not the msi) to "C:\cmake good\cmake-3.16.0-rc2-win64-x64\bin\cmake.exe" the extension finds it. This rules out my theory of spaces being a problem.

That leaves the possibility of the .msi being "bogus" somehow. If I install the msi into c:\cmake, the extension finds it.

If I copy the .zip contents to "C:\Program Files\cmakeb\cmake-3.16.0-rc2-win64-x64\bin\cmake.exe" and point the extension at it, it finds it.

That seems to rule it down to something very special about "C:\Program Files\cmake\bin\cmake.exe". After a fresh install of windows and cmake, I can't imagine what would be special about it.

It seems to be something very specific about "C:\Program Files\cmake\bin."

I tried moving the zip contents to "C:\Program Files\cmake\cmake-3.16.0-rc2-win64-x64\bin\cmake.exe". It finds it. That's a little different than the "specific" broken path.

I take that same zip contents and put them in "C:\Program Files\cmake\bin\cmake.exe", and the extension cannot find it.

I rename the "bin" folder "bina", as follows: "C:\Program Files\cmake\bina\cmake.exe". The extension can find it.

Every test, I tried running the same path on the command line, and it worked, (just to double check for a typo)

This seems to imply that it doesn't matter if it's from the zip or the msi. All that matters is if it is installed to c:\Program Files\cmake\bin. It won't find it there. Anywhere else, and it will find it. This is pretty absurd.

This is a fresh install of Windows 10. Before, I was seeing this (although I didn't test all these cases) on Windows 7. That is one specific "bug". I don't know what else I can try. That is all I have time for at the moment. At least I have a workaround.

@bobbrow
Copy link
Member

bobbrow commented Oct 29, 2019

What does your %PATH% look like? I wonder if there's a bad path in there messing you up.
Can you run set PATH in a CMD window?

@Zingam
Copy link
Contributor

Zingam commented Oct 31, 2019

@jeverton I have a similar issue in Ubuntu #838

Also at present I can't get the extension to work on Windows 10, VS2019 and the latest CMake 3.16 at all (it cannot find any MSVC/Clang toolkits), so I wait for the new 1.2 release to see if anything has been fixed.

@ghost
Copy link

ghost commented Nov 22, 2019

I'm also experiencing this issue on Ubuntu:

I installed vscode/cmake from snap packages

$ cmake --version
cmake version 3.16.0-rc4

CMake suite maintained and supported by Kitware (kitware.com/cmake).

But I got this error from the vscode extension:

Bad CMake executable "/snap/bin/cmake". Is it installed or settings contain the correct path (cmake.cmakePath)?

I checked my path

echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

I checked my cmake

$ which cmake
/snap/bin/cmake

@Zingam
Copy link
Contributor

Zingam commented Nov 22, 2019

@hdf89shfdfs Regarding snaps, please, check: #838 . I have it on my TODO list but I am not quite sure how to approach it yet.

@xziya
Copy link

xziya commented Jan 2, 2020

I also encountered this problem when using the Remote Development Extension. It does not work with the path set to be ${userHome}/.local/bin/cmake.

@ftrofin
Copy link

ftrofin commented Nov 19, 2020

If it helps, I have the same problem on KDE Neon (Linux). I uninstalled Cmake tools, reinstalled, no luck,
From VS Code terminal:

$ cmake --version
cmake version 3.16.3
$ which cmake
/usr/bin/cmake

The error that pops up is:
Bad CMake executable "/home/foobar/Projects/git/MyProject/.dependencies/cmake-3.15.5/bin/cmake". Is it installed or settings contain the correct path (cmake.cmakePath)?

There is no .dependencies folder under MyProject, I double checked.

This is on a fresh machine, fresh install of VSCode, no customized settings, just installed the extension and tried to open an existing project.
@bobbrow Any updates on this issue? It's been a while since it was opened... Thanks!

CMakeTools extension version: 1.5.3

VS Code Info:

Version: 1.51.1
Commit: e5a624b788d92b8d34d1392e4c4d9789406efe8f
Date: 2020-11-10T23:31:29.624Z
Electron: 9.3.3
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Linux x64 5.4.0-53-generic snap

@andreeis andreeis removed the more info needed More info is needed from the community for us to properly triage and investigate. label Nov 19, 2020
@andreeis andreeis added the more info needed More info is needed from the community for us to properly triage and investigate. label Jan 11, 2021
@bobbrow
Copy link
Member

bobbrow commented Jan 11, 2021

I'm sorry, we haven't been able to reproduce this problem.

@bobbrow bobbrow added the help wanted we currently are not planning work on this and would like help from the open source community label Jan 11, 2021
@pbaret
Copy link

pbaret commented Feb 1, 2021

I faced the same problem on windows. I fixed it by :

  1. removing cmake.cmakePath from the settings.json file
  2. resetting the extension (CTRL+SHIFT+P then "CMake: Reset CMake Tools Extension State (For troubleshooting)"
  3. checking that cmake is in my Path
  4. just putting "cmake" (without the brackets) in the extension settings GUI
    image

@ThinAirSystems
Copy link

I faced the same problem on windows. I fixed it by :

  1. removing cmake.cmakePath from the settings.json file
  2. resetting the extension (CTRL+SHIFT+P then "CMake: Reset CMake Tools Extension State (For troubleshooting)"
  3. checking that cmake is in my Path
  4. just putting "cmake" (without the brackets) in the extension settings GUI
    image

Also on windows. Confirmed that cmake.cmakePath is gone and "cmake" is in the extension settings. Still not working. Was there anything else you had to do for this?

@andreeis
Copy link
Contributor

@Eight9inerEcho, do you have the same problem on a small project that you create from scratch, for example with the command "CMake: Quick Start" in the palette?
Can you increase the logging verbosity with "cmake:loggingLevel": "Debug", reload the project and share us the text in the "CMake/Build" output channel?

@ThinAirSystems
Copy link

I do have the same issue.

Verbosity set to debug. Below is a screenshot of an attempted build

image

@ThinAirSystems
Copy link

I really think this is a problem with VS code having the wrong path for the Cmake executable. How can I find out where the Cmake executable was installed by the toolchain so I can point to in manually?

@andreeis
Copy link
Contributor

About finding the exact cmake executable installed by the toolchain, I don't know how to do that other than searching on your system for all cmake and trying to guess which one. Maybe there is documentation about that particular toolchain or if you run it again may give some path indication.

I am still thinking of what else can happen here.

@edilyxin
Copy link

mark

@Bill0412
Copy link

Bill0412 commented May 6, 2021

sudo ln -s /opt/cmake-3.7.2-Linux-x86_64/bin/* /usr/bin

Thanks, this solves my problem.
I initially used cmake 3.16 with the latest stable version of vscode, the cmake tools does not work.
After uninstalling the cmake with apt remove cmake and installed the latest cmake from official website binary, it still does not work.
It only works after I make a link from the installation directory to /usr/bin.

@andreeis
Copy link
Contributor

andreeis commented May 6, 2021

Glad to hear that you are unblocked @Bill0412. I'll wait to hear from other users on this thread, hopefully they will be able to use the same command and be unblocked. Then I will close his report.

@wAuner
Copy link

wAuner commented May 17, 2021

I'm on a M1 mac and I get the same error. I installed cmake via brew and it is placed under /opt/homebrew/bin/cmake. Linking to /usr/bin is not possible on macOS, but I've tried to link to /usr/local/bin to no avail.

@andreeis
Copy link
Contributor

@wAuner, I understand that (and I have no idea why yet) the link command didn't work for you but did you also define "cmake.cmakePath"? Just double checking.

@wAuner
Copy link

wAuner commented May 25, 2021

Yes I’ve tried that too (to define it with the full path, although cmake already is in my path), but that didn’t help. Sometimes it finds it, sometimes not. Seems very unstable

@sidml
Copy link

sidml commented Oct 31, 2021

I was also getting the same error in ubuntu 20. I was able to find a consistent way to reproduce the issue.
Let us assume that cmake extension is working properly in your pc. Following these steps you can get the Bad cmake executable error:

  • Go to File-> Preferences->Settings and search for Update:Mode
  • Normally it is set to default. You need to change it none.
  • After this, vscode will prompt you to restart it. After restart, CMake shouldn't work and you should get the Bad cmake executable error.

How to fix:

  • Change the Update Mode in vscode back to default & exit.
  • Remove your existing cmake installation sudo snap remove cmake
  • Reinstall cmake sudo snap install cmake --classic
  • Restart vscode. It should now detect cmake.

I don't understand why the update setting screws up cmake. It will be nice if someone can dig into this.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature: configure help wanted we currently are not planning work on this and would like help from the open source community more info needed More info is needed from the community for us to properly triage and investigate.
Projects
None yet
Development

No branches or pull requests