microsoft / microsoft/vscode-cmake-tools

Prompt the user to use the latest CMake

Open
#1,139 6 comments 0 reactions 0 assignees View on GitHub
enhancement Feature: configure Feature: remote
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

### Brief Issue Summary
I have successfully got my project to configure (and build):

```
[main] Configuring folder: odin-data
[main] For the best experience, CMake server or file-api support is required. Please upgrade CMake to 3.7.1 or newer.
[proc] Executing command: /usr/bin/cmake --no-warn-unused-cli -DHDF5_ROOT:STRING=/dls_sw/prod/tools/RHEL7-x86_64/hdf5/1-10-5/prefix -DLOG4CXX_ROOT_DIR:STRING=/dls_sw/prod/tools/RHEL7-x86_64/log4cxx/0-10-0dls2/prefix -DBLOSC_ROOT_DIR:STRING=/dls_sw/prod/tools/RHEL7-x86_64/c-blosc/1-14-2/prefix -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_INSTALL_PREFIX:STRING=vscode_prefix -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/g++ -H/scratch/work/tools/RHEL7-x86_64/odin-data -B/scratch/work/tools/RHEL7-x86_64/odin-data/vscode_build "-GUnix Makefiles"
[cmake] Not searching for unused variables given on the command line.
[cmake] -- Boost version: 1.53.0
[cmake] -- Found the following Boost libraries:
[cmake] -- program_options
[cmake] -- system
[cmake] -- filesystem
[cmake] -- unit_test_framework
[cmake] -- date_time
[cmake] -- thread
[cmake] -- regex
[cmake] -- Root dir: /dls_sw/prod/tools/RHEL7-x86_64/log4cxx/0-10-0dls2/prefix
[cmake]
[cmake] Looking for log4cxx headers and libraries
[cmake] -- Include directories: /dls_sw/prod/tools/RHEL7-x86_64/log4cxx/0-10-0dls2/prefix/include/log4cxx
[cmake] -- Libraries: /dls_sw/prod/tools/RHEL7-x86_64/log4cxx/0-10-0dls2/prefix/lib/liblog4cxx.so
[cmake]
[cmake] Looking for ZeroMQ headers and libraries
[cmake] -- Include directories: /usr/include
[cmake] -- Libraries: /lib64/libzmq.so
[cmake]
[cmake] Looking for pcap headers and libraries
[cmake]
[cmake] Looking for blosc headers and libraries
[cmake]
[cmake] Looking for kafka headers and libraries
[cmake]
[cmake] Searching for HDF5
[cmake] Determining odin-data version
[cmake] -- Searching Blosc Root dir: /dls_sw/prod/tools/RHEL7-x86_64/c-blosc/1-14-2/prefix
[cmake] -- Found Blosc: /dls_sw/prod/tools/RHEL7-x86_64/c-blosc/1-14-2/prefix/lib/libblosc.so
[cmake] -- Found Kafka: /usr/lib64/librdkafka.so
[cmake] -- HDF5_ROOT set: /dls_sw/prod/tools/RHEL7-x86_64/hdf5/1-10-5/prefix
[cmake] -- Git describe version: 1.4.0-59-g18d7a0c-dirty
[cmake] -- major:1 minor:4 patch:0 sha1:g18d7a0c-dirty
[cmake] -- short version: 1.4.0
[cmake] -- HDF5 include files: /dls_sw/prod/tools/RHEL7-x86_64/hdf5/1-10-5/prefix/include
[cmake] -- HDF5 libs: /dls_sw/prod/tools/RHEL7-x86_64/hdf5/1-10-5/prefix/lib/libhdf5.so/dls_sw/prod/tools/RHEL7-x86_64/hdf5/1-10-5/prefix/lib/libhdf5_hl.so
[cmake] -- HDF5 defs:
[cmake] -- HDF5 include files: /dls_sw/prod/tools/RHEL7-x86_64/hdf5/1-10-5/prefix/include
[cmake] -- HDF5 libs: /dls_sw/prod/tools/RHEL7-x86_64/hdf5/1-10-5/prefix/lib/libhdf5.so/dls_sw/prod/tools/RHEL7-x86_64/hdf5/1-10-5/prefix/lib/libhdf5_hl.so
[cmake] -- HDF5 defs:
[cmake] -- Configuring done
[cmake] -- Generating done
[cmake] -- Build files have been written to: /scratch/work/tools/RHEL7-x86_64/odin-data/vscode_build
```

I would like to use a different version of cmake than is installed in /usr/bin/cmake. When I set `cmake.cmakePath`, making my full `settings.json` the following:

```
{
"cmake.cmakePath": "/dls_sw/prod/tools/RHEL7-x86_64/cmake/3-9-6/prefix/bin/cmake",
"cmake.generator": "Unix Makefiles",
"cmake.buildDirectory": "/scratch/work/tools/RHEL7-x86_64/odin-data/vscode_build",
"cmake.installPrefix": "vscode_prefix",
"cmake.sourceDirectory": "/scratch/work/tools/RHEL7-x86_64/odin-data",
"cmake.configureSettings": {
"HDF5_ROOT": "/dls_sw/prod/tools/RHEL7-x86_64/hdf5/1-10-5/prefix",
"LOG4CXX_ROOT_DIR": "/dls_sw/prod/tools/RHEL7-x86_64/log4cxx/0-10-0dls2/prefix",
"BLOSC_ROOT_DIR": "/dls_sw/prod/tools/RHEL7-x86_64/c-blosc/1-14-2/prefix"
}
}
```

I get this output:

```
[variant] Loaded new set of variants
[kit] Successfully loaded 2 kits from /home/mef65357/.local/share/CMakeTools/cmake-tools-kits.json
[main] Configuring folder: odin-data
[rollbar] Unhandled exception: Unhandled Promise rejection: Post-folder-open Error: connect ENOENT /tmp/cmake-server-0.247112383440653 {"folder":{"uri":{"$mid":1,"fsPath":"/scratch/work/tools/RHEL7-x86_64/odin-data","external":"file:///scratch/work/tools/RHEL7-x86_64/odin-data","path":"/scratch/work/tools/RHEL7-x86_64/odin-data","scheme":"file"},"name":"odin-data","index":0}}
```

(If I comment out the `cmake.cmakePath`, it works, as in the first snippet.)

### Expected:
I would expect this to work as it does if I run the full command on the command line:

```
$ cd /scratch/work/tools/RHEL7-x86_64/odin-data/vscode_build
$ /dls_sw/prod/tools/RHEL7-x86_64/cmake/3-9-6/prefix/bin/cmake -DHDF5_ROOT=/dls_sw/prod/tools/RHEL7-x86_64/hdf5/1-10-5/prefix -DLOG4CXX_ROOT_DIR=/dls_sw/prod/tools/RHEL7-x86_64/log4cxx/0-10-0dls2/prefix -DBLOSC_ROOT_DIR=/dls_sw/prod/tools/RHEL7-x86_64/c-blosc/1-14-2/prefix -DCMAKE_INSTALL_PREFIX=../vscode_prefix ..
-- Boost version: 1.53.0
-- Found the following Boost libraries:
-- program_options
-- system
-- filesystem
-- unit_test_framework
-- date_time
-- thread
-- regex
-- chrono
-- atomic

Looking for log4cxx headers and libraries
-- Root dir: /dls_sw/prod/tools/RHEL7-x86_64/log4cxx/0-10-0dls2/prefix
using pkgconfig
-- Checking for module 'log4cxx'
-- No package 'log4cxx' found
-- Include directories: /dls_sw/prod/tools/RHEL7-x86_64/log4cxx/0-10-0dls2/prefix/include/log4cxx
-- Libraries: /dls_sw/prod/tools/RHEL7-x86_64/log4cxx/0-10-0dls2/prefix/lib/liblog4cxx.so

Looking for ZeroMQ headers and libraries
-- Include directories: /usr/include
-- Libraries: /lib64/libzmq.so

Looking for pcap headers and libraries

Looking for blosc headers and libraries
-- Searching Blosc Root dir: /dls_sw/prod/tools/RHEL7-x86_64/c-blosc/1-14-2/prefix
-- Found Blosc: /dls_sw/prod/tools/RHEL7-x86_64/c-blosc/1-14-2/prefix/lib/libblosc.so

Looking for kafka headers and libraries
-- Found Kafka: /usr/lib64/librdkafka.so

Searching for HDF5
-- HDF5_ROOT set: /dls_sw/prod/tools/RHEL7-x86_64/hdf5/1-10-5/prefix
Determining odin-data version
-- Git describe version: 1.4.0-59-g18d7a0c-dirty
-- major:1 minor:4 patch:0 sha1:g18d7a0c-dirty
-- short version: 1.4.0
-- HDF5 include files: /dls_sw/prod/tools/RHEL7-x86_64/hdf5/1-10-5/prefix/include
-- HDF5 libs: /dls_sw/prod/tools/RHEL7-x86_64/hdf5/1-10-5/prefix/lib/libhdf5.so/dls_sw/prod/tools/RHEL7-x86_64/hdf5/1-10-5/prefix/lib/libhdf5_hl.so
-- HDF5 defs:
-- HDF5 include files: /dls_sw/prod/tools/RHEL7-x86_64/hdf5/1-10-5/prefix/include
-- HDF5 libs: /dls_sw/prod/tools/RHEL7-x86_64/hdf5/1-10-5/prefix/lib/libhdf5.so/dls_sw/prod/tools/RHEL7-x86_64/hdf5/1-10-5/prefix/lib/libhdf5_hl.so
-- HDF5 defs:
-- Found Doxygen: /dls_sw/prod/tools/RHEL7-x86_64/defaults/bin/doxygen (found version "1.8.13") found components: doxygen dot
-- Configuring done
-- Generating done
-- Build files have been written to: /scratch/work/tools/RHEL7-x86_64/odin-data/vscode_build
```

### Platform and Versions

- **Operating System**: RedHat Enterprise Linux 7.7
- **CMake Version**: 2.8.12.2 / 3.9.6
- **VSCode Version**: 1.43.1
- **CMake Tools Extension Version**: 1.3.1
- **Compiler/Toolchain**: GCC 4.8.5

### Other Notes/Information

Thanks!

Contributor guide

Open the contributing guide

Research direction

Start with the CMake Tools handling of the `cmake.cmakePath` setting and the post-folder-open flow that reports `ENOENT /tmp/cmake-server-...`. Reproduce with CMake Tools 1.3.1, VS Code 1.43.1, and CMake 2.8.12.2 versus 3.9.6, then compare the extension command with the working command-line invocation. Done means selecting the configured newer CMake works without the CMake server connection error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, typescript
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.