Skip to content

Unable to resolve compiler configuration. #12425

Description

@da151575

Environment

  • OS and Version: Windows 11 Versino 23H2 (OS Build 22631.3737)
  • VS Code Version: 1.90.2
  • C/C++ Extension Version: 1.20.5
  • If using SSH remote, specify OS of remote machine: Ubuntu Linux 20.04

Bug Summary and Steps to Reproduce

Bug Summary: I have configured the C/C++ module to use a cross compiler to build code for an NXP i.MX8 on a remote machine. When I start vscode on the folder containing this project, I get this error:

Unable to resolve configuration with compilerPath "aarch64-poky-linux-g++". Using "/opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++" instead.

But in the configuration the compiler path is already set to /opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++.

To simplify, if I set compilerPath to <full_path>, I get an error saying "can't set compiler to <leaf_name>, using <full_path>", which doesn't make sense.

Steps to reproduce:

  1. Set compiler path to a given full path name
  2. Restart project
  3. See error
  4. Intellisense is unable to find basic C++ header files, e.g. cstdint

Expected behavior:

  1. Set compiler path to a given full path name
  2. Restart project
  3. Not see error
  4. Intellisense is ableto find basic C++ header files, e.g. cstdint

Configuration and Logs

c_cpp_properties.json:
{
    "configurations": [
        {
            "name": "Linux-renishaw-cross-compile",
            "includePath": [
                "${workspaceFolder}/**",
                "/opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/cortexa53-crypto-poky-linux/usr/include/**"
            ],
            "defines": [
                "_FORTIFY_SOURCE=2"
            ],
            "cStandard": "c17",
            "cppStandard": "gnu++20",
            "intelliSenseMode": "linux-gcc-arm64",
            "configurationProvider": "ms-vscode.makefile-tools",
            "compilerArgs": [
                "-mcpu=cortex-a53",
                "-march=armv8-a+crc+crypto",
                "-fstack-protector-strong",
                "-O2",
                "-Wformat",
                "-Wformat-security",
                "-Werror=format-security",
                "--sysroot=/opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/cortexa53-crypto-poky-linux"
            ],
            "compilerPath": "/opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++"
        }
    ],
    "version": 4
}

I don't have the option "C/C++: Log Diagnostics", if I type that I get one option "Developer: OpenLog File...", so here's main.log:
2024-07-01 11:15:19.912 [info] update#setState idle
2024-07-01 11:15:49.922 [info] update#setState checking for updates
2024-07-01 11:15:49.958 [info] update#setState idle
2024-07-01 12:15:49.934 [info] update#setState checking for updates
2024-07-01 12:15:50.093 [info] update#setState idle
2024-07-01 13:09:37.995 [info] Extension host with pid 13816 exited with code: 0, signal: unknown.
2024-07-01 13:09:39.002 [error] Extension host with pid 13816 still exists, forcefully killing it...
2024-07-01 13:15:33.801 [info] Extension host with pid 17484 exited with code: 0, signal: unknown.
2024-07-01 13:15:34.814 [error] Extension host with pid 17484 still exists, forcefully killing it...
2024-07-01 13:15:49.948 [info] update#setState checking for updates
2024-07-01 13:15:50.080 [info] update#setState idle
2024-07-01 13:24:03.718 [info] Extension host with pid 14532 exited with code: 0, signal: unknown.
2024-07-01 14:00:03.452 [warning] No ptyHost heartbeat after 6 seconds
2024-07-01 14:00:11.740 [warning] No ptyHost heartbeat after 6 seconds
2024-07-01 14:15:49.963 [info] update#setState checking for updates
2024-07-01 14:15:49.987 [error] Error: net::ERR_EMPTY_RESPONSE
    at SimpleURLLoaderWrapper.<anonymous> (node:electron/js2c/browser_init:2:109791)
    at SimpleURLLoaderWrapper.emit (node:events:514:28)
2024-07-01 14:15:49.991 [info] update#setState idle
2024-07-01 15:15:37.697 [info] update#setState checking for updates
2024-07-01 15:15:37.808 [info] update#setState idle
2024-07-01 16:15:37.714 [info] update#setState checking for updates
2024-07-01 16:15:37.828 [info] update#setState idle
2024-07-01 16:25:00.625 [info] Extension host with pid 20184 exited with code: 0, signal: unknown.

C/C++ Configuration Warnings:
[01/07/2024, 16:37:14] Unable to resolve configuration with compilerPath "aarch64-poky-linux-g++".  Using "/opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++" instead.

C/C++:
loggingLevel: Debug
LSP: (received) cpptools/preinitialize (id: 1)
LSP: (invoked) cpptools/preinitialize (id: 1)
LSP: Sending response (id: 1)
LSP: (received) cpptools/initialize (id: 2)
LSP: (invoked) cpptools/initialize (id: 2)
cpptools version (TypeScript): 1.20.5
cpptools version (native): 1.20.5.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: Sending response (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
LSP: (invoked) cpptools/queryCompilerDefaults (id: 3)
Querying compiler for default C++ language standard using command line: /usr/bin/gcc -x c++ -E -dM /dev/null
Detected language standard version: gnu++14
Querying compiler's default target using command line: "/usr/bin/gcc" -dumpmachine
Compiler returned default target value: x86_64-linux-gnu
Compiler query command line: /usr/bin/gcc -std=c17 -m64 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/gcc'
Compiler query command line: /usr/bin/gcc -std=gnu++14 -m64 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/gcc'
LSP: Sending response (id: 3)
LSP: (received) cpptools/queryCompilerDefaults (id: 4)
LSP: (invoked) cpptools/queryCompilerDefaults (id: 4)
LSP: (received) cpptools/didChangeCppProperties (id: 5)
Querying compiler for default C++ language standard using command line: /opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++ -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "/opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++" -dumpmachine
Compiler returned default target value: aarch64-poky-linux
Compiler query command line: /opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++ -std=c17 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++'
Compiler query command line: /opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++ -std=gnu++17 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++'
LSP: Sending response (id: 4)
LSP: (invoked) cpptools/didChangeCppProperties (id: 5)
enabling full-text triggers
Code browsing service initialized
Compiler query command line: /opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++ -mcpu=cortex-a53 -march=armv8-a+crc+crypto -fstack-protector-strong -O2 --sysroot=/opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/cortexa53-crypto-poky-linux -std=gnu++20 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++'
Compiler query command line: /opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++ -mcpu=cortex-a53 -march=armv8-a+crc+crypto -fstack-protector-strong -O2 --sysroot=/opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/cortexa53-crypto-poky-linux -std=c17 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++'
  Folder: /opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/cortexa53-crypto-poky-linux/usr/include/ will be indexed
  Folder: /opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/cortexa53-crypto-poky-linux/usr/lib64/aarch64-poky-linux/11.3.0/include/ will be indexed
  Folder: /opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/include/ will be indexed
  Folder: /opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/include-fixed/ will be indexed
  Folder: /home/user/repos/dpu-cmd-generator/ will be indexed
LSP: Sending response (id: 5)
Custom browse configuration received: {
  "browsePath": [
    "/home/user/repos/dpu-cmd-generator",
    "/home/user/repos/dpu-cmd-generator/usi-protocol"
  ],
  "compilerPath": "aarch64-poky-linux-g++",
  "standard": "gnu++20",
  "windowsSdkVersion": "",
  "compilerArgsLegacy": []
}
Discovering files...
  Processing folder (recursive): /opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/cortexa53-crypto-poky-linux/usr/include/
LSP: (received) cpptools/queryCompilerDefaults (id: 6)
LSP: (invoked) cpptools/queryCompilerDefaults (id: 6)
LSP: (received) cpptools/didChangeCustomBrowseConfiguration
LSP: (received) cpptools/clearCustomConfigurations
Querying compiler for default C++ language standard using command line: aarch64-poky-linux-g++ -x c++ -E -dM /dev/null
Querying compiler for default C language standard using command line: aarch64-poky-linux-g++ -x c -E -dM /dev/null
LSP: Sending response (id: 6)
LSP: (invoked) cpptools/didChangeCustomBrowseConfiguration
Specified compiler was not found: aarch64-poky-linux-g++
Attempting to get defaults from compiler found on the machine: '/opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++'
Compiler query command line: /opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++ -std=gnu++20 -Wp,-v -E -dM -x c++ /dev/null
  Folder: /opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/include/ will be indexed
  Folder: /opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/include-fixed/ will be indexed
  Folder: /home/user/repos/dpu-cmd-generator/ will be indexed
File discovery was aborted
  Discovering files: 167 file(s) processed
Done discovering files.
LSP: (invoked) cpptools/clearCustomConfigurations
Discovering files...
  Processing folder (recursive): /opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/include/
  Processing folder (recursive): /opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/include-fixed/
  Processing folder (recursive): /home/user/repos/dpu-cmd-generator/
  Discovering files: 101 file(s) processed
  167 file(s) removed from database
Done discovering files.
Populating include completion cache.
Parsing remaining files...
  Parsing: 0 files(s) processed
Done parsing remaining files.
Custom configuration provider 'Makefile Tools' registered
LSP: (received) cpptools/didChangeCppProperties (id: 7)
LSP: (received) cpptools/pauseParsing
LSP: (invoked) cpptools/didChangeCppProperties (id: 7)
LSP: (received) cpptools/clearCustomConfigurations
LSP: Sending response (id: 7)
LSP: (invoked) cpptools/pauseParsing
LSP: (invoked) cpptools/clearCustomConfigurations
LSP: (received) cpptools/clearCustomConfigurations
LSP: (invoked) cpptools/clearCustomConfigurations
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors
LSP: (received) cpptools/didChangeCustomBrowseConfiguration
LSP: (invoked) cpptools/didChangeCustomBrowseConfiguration
LSP: (received) cpptools/resumeParsing
Specified compiler was not found: aarch64-poky-linux-g++
Attempting to get defaults from compiler found on the machine: '/opt/ren-dpu-mtintf/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++'
LSP: (invoked) cpptools/resumeParsing
Database safe to open.
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors

Other Extensions

No response

Additional context

No response

Metadata

Metadata

Labels

Feature: ConfigurationAn issue related to configuring the extension or IntelliSenseFeature: Configuration ProviderRelated to the configurationProvider property, e.g. ms-vscode.cmake-tools, ms-vscode.makefile-tools.Language Servicemore info neededThe issue report is not actionable in its current state

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions