microsoft / microsoft/vscode-cmake-tools

CMake Tools not forwarding configuration to cpptools

Open
#2,713 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature: cpptools integration
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

Brief Issue Summary

Hi,

as discussed in this thread, I'm reporting an issue when the project folder is stored in a path that contains a symlink.
In my configuration, a separate volume for projects is mounted to /mnt/data/ws. I created a symlink /home/user/Developer/Projects to /mnt/data/ws/ and I normally run the editor with code . from within /home/user/Developer/Projects/MyProject (which contains the symlink).

The issue appeared after some days of regular use, without any specific action on my side (no updates, no changes in vscode configuration. When opening the project, it can't find any reference to the headers included. As pointed out by @bobbrow, cpptools does not get the configuration with all include paths.

In attachment the log diagnostics of CMake Tools and cpptools. The faulty ones are related to the path that contains the symlink, the good logs come from the same project cloned in a standard path without symlink.

Thanks in advance for your help, let me know if any further info is needed.

CMake Tools Diagnostics
-------- Diagnostics - 8/26/2022, 6:51:37 PM
Version: 1.11.5
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "${workspaceFolder}/**"
    ],
    "defines": [],
    "compilerPath": "/usr/bin/gcc",
    "cStandard": "gnu17",
    "cppStandard": "gnu++17",
    "intelliSenseMode": "linux-gcc-x64",
    "configurationProvider": "ms-vscode.cmake-tools",
    "compilerPathIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "intelliSenseModeIsExplicit": true,
    "mergeConfigurations": false,
    "browse": {
        "path": [
            "${workspaceFolder}/**"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Custom browse configuration: 
{
    "browsePath": [
        "/home/user/Developer/Projects/MyProject/public/include",
        "/home/user/Developer/Projects/MyProject/build/submodule/include",
        "/home/user/Developer/Projects/MyProject/build/submodule/test/helper/home/user/Developer/Projects/MyProject/submodule/build/googletest-src/googletest/include"
    ],
    "compilerPath": "/usr/bin/c++",
    "compilerArgs": [],
    "compilerFragments": [
        " -D__FILENAME__='\"$(subst /home/user/Developer/Projects/MyProject/,,$(abspath $<))\"' -g -fvisibility=hidden -fvisibility-inlines-hidden",
        "-g3",
        "-ggdb",
        "-Og",
        "-Wall",
        "-Wextra",
        "-Wshadow",
        "-Wcast-align",
        "-Wunused",
        "-Wpedantic",
        "-Wconversion",
        "-Wsign-conversion",
        "-Wsign-compare",
        "-Wnull-dereference",
        "-Wdouble-promotion",
        "-Wformat=2",
        "-Werror",
        "-Wno-narrowing",
        "-Wno-psabi",
        "-Wno-attributes",
        "-Wmisleading-indentation",
        "-Wduplicated-cond",
        "-Wduplicated-branches",
        "-Wlogical-op",
        "-Wnon-virtual-dtor",
        "-Wold-style-cast",
        "-Woverloaded-virtual",
        "-Wuseless-cast",
        "-Wcast-align=strict",
        "-std=gnu++17"
    ]
}
Translation Unit Mappings:
[ /home/user/Developer/Projects/MyProject/src/file.cpp ]:
    /home/user/Developer/Projects/MyProject/src/file.cpp
Translation Unit Configurations:
[ /home/user/Developer/Projects/MyProject/src/file.cpp ]:
    Process ID: 174984
    Memory Usage: 114 MB
    Compiler Path: /usr/bin/c++
    Includes:
        /usr/include/c++/9
        /usr/include/x86_64-linux-gnu/c++/9
        /usr/include/c++/9/backward
        /usr/lib/gcc/x86_64-linux-gnu/9/include
        /usr/local/include
        /usr/include/x86_64-linux-gnu
        /usr/include
    Standard Version: c++17
    IntelliSense Mode: linux-gcc-x64
    Other Flags:
        --g++
        --gnu_version=90400
Total Memory Usage: 114 MB

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 9547
Number of files parsed: 3496
Debug Log

No response

Additional Information

c_cpp_diagnostics-faulty.log
c_cpp_diagnostics-good.log
cmake_diagnostics-faulty.log
cmake_diagnostics-good.log

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the attached faulty and good CMake Tools and cpptools diagnostic logs, reproducing the project under the symlinked and standard paths. Trace how CMake Tools forwards include paths and compiler configuration to cpptools; done means the symlinked workspace receives the same header references and IntelliSense configuration as the standard path.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.