microsoft / microsoft/vscode-cpptools

Unable to use problemMatcher with GNU make and relative folder

Open
#7,031 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug investigate: repro Language Service tasks/build/debug
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Type: LanguageService

Describe the bug

  • OS and Version: Linux Opensuse Tumbleweed
  • VS Code Version: 1.53.2
  • C/C++ Extension Version:1.2.2
  • Other extensions you installed (and if the issue persists after disabling them):N/A
  • Does this issue involve using SSH remote to run the extension on a remote machine?:No

In my project, i have :

PROJECT/
    Makefile
    folder1/source.c
    folder2/source.c
    ...
    build/

The Makefile process the compilation steps (ie mainly gcc calls) and stores the results in the build subfolder.

I configured a tasks.json :

    {
      "label": "Relase x64",
      "type": "shell",
      "command": "make -f Makefile config=release_linux64",
      "options": {
        "cwd": "${workspaceFolder}"
      },
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "presentation": {
        "reveal": "always"
      },
      "problemMatcher": [ {
          "base": "$gcc",
          "fileLocation": ["relative", "${workspaceFolder}/build/"]
        }
      ]
    },

The compilation task is working properly, but it cannot parse/open the files in case of errors :
image

Please note that i tried with custom patterns, etc, etc : always the same result, the file is never properly parsed.

Steps to reproduce

1 - Setup a project kile the one above.
2 - Create a makefile with compilation in a subfolder
3 - When source files have reltive path with ../ it does not work

Expected behavior
When clicking in a file with a compilation error, it should jump to it.

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

Reproduce the problem with the described project layout, Makefile, tasks.json, and the $gcc problemMatcher using relative paths from the build folder. Start by tracing how the task output resolves ../ source paths; done means clicking a compilation error opens the correct source file. No implementation file or test is identified in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, vscode
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.