-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Environment
- OS and Version: Windows 10 22H2 (19045.2965)
- VS Code Version: 1.78.2
- C/C++ Extension Version: 1.15.4
- If using SSH remote, specify OS of remote machine: Not using
- WSL: Archlinux
Bug Summary and Steps to Reproduce
Bug Summary:
I'm trying to use the system headers and the compiler in WSL. I've created a few batch scripts to use compilers and other Linux commands in Windows directly (Without launching Linux shell).
The script is something like this:
@echo off
wsl arm-none-eabi-gcc %*
However, the actual program is in the Linux environment. so when the extension tries to find the headers the gcc returns a Linux path. So I override this path using defaultSystemIncludePath. To be able to access the Linux path I assign a drive letter to a network location, the WSL root ( \\wsl.localhost ), but this doesn't work. After a few tries, I've found out that if those headers are in a normal drive ( like C:\ ), which I've copied out from WSL, it works as expected.
I've also tested that mklink /d usr Z:\usr doesn't works as well
Also since the defines aren't have any connection to this bug and they are too long so I'll remove them in configuration and logs.
Steps to reproduce:
- Have a WSL installed
- Assign WSL root a drive letter (Map network drive, in my case its
Z) - Set defaultSystemIncludePath to a WSL path ( Something like:
Z:\usr\arm-none-eabi\include) - The extension can't find the system headers although the path is correct
Expected behavior:
Configuration and Logs
--------------------------------
c_cpp_properties.json
--------------------------------
{
"configurations": [
{
"name": "STM32Helper generated",
"includePath": [
"Core/Inc",
"Drivers/STM32G0xx_HAL_Driver/Inc",
"Drivers/STM32G0xx_HAL_Driver/Inc/Legacy",
"Drivers/CMSIS/Device/ST/STM32G0xx/Include",
"Drivers/CMSIS/Include",
"Z:/usr/lib/gcc/arm-none-eabi/13.1.0/include",
"Z:/usr/lib/gcc/arm-none-eabi/13.1.0/include-fixed",
"Z:/usr/arm-none-eabi/include"
],
"browse": {
"path": [
"Core/Inc",
"Drivers/STM32G0xx_HAL_Driver/Inc",
"Drivers/STM32G0xx_HAL_Driver/Inc/Legacy",
"Drivers/CMSIS/Device/ST/STM32G0xx/Include",
"Drivers/CMSIS/Include",
"Z:/usr/lib/gcc/arm-none-eabi/13.1.0/include",
"Z:/usr/lib/gcc/arm-none-eabi/13.1.0/include-fixed",
"Z:/usr/arm-none-eabi/include"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"compilerPath": "C:/Users/lamadaemon/Desktop/test/arm-none-eabi-gcc.bat",
"defines": ["<Removed due to too long>"],
"intelliSenseMode": "gcc-arm",
"cStandard": "c17",
"cppStandard": "gnu++17"
}
],
"version": 4
}
--------------------------------
C/C++: Log Diagnostics
--------------------------------
-------- Diagnostics - 5/27/2023, 2:29:11 PM
Version: 1.15.4
Current Configuration:
{
"name": "STM32Helper",
"includePath": [
"c:\\Users\\lamadaemon\\Desktop\\dm-pwr-mgr\\Core\\Inc",
"c:\\Users\\lamadaemon\\Desktop\\dm-pwr-mgr\\Drivers\\STM32G0xx_HAL_Driver\\Inc",
"c:\\Users\\lamadaemon\\Desktop\\dm-pwr-mgr\\Drivers\\STM32G0xx_HAL_Driver\\Inc\\Legacy",
"c:\\Users\\lamadaemon\\Desktop\\dm-pwr-mgr\\Drivers\\CMSIS\\Device\\ST\\STM32G0xx\\Include",
"c:\\Users\\lamadaemon\\Desktop\\dm-pwr-mgr\\Drivers\\CMSIS\\Include",
"Z:/usr/lib/gcc/arm-none-eabi/13.1.0/include",
"Z:/usr/lib/gcc/arm-none-eabi/13.1.0/include-fixed",
"Z:/usr/arm-none-eabi/include"
],
"browse": {
"path": [
"Core/Inc",
"Drivers/STM32G0xx_HAL_Driver/Inc",
"Drivers/STM32G0xx_HAL_Driver/Inc/Legacy",
"Drivers/CMSIS/Device/ST/STM32G0xx/Include",
"Drivers/CMSIS/Include",
"Z:/usr/lib/gcc/arm-none-eabi/13.1.0/include",
"Z:/usr/lib/gcc/arm-none-eabi/13.1.0/include-fixed",
"Z:/usr/arm-none-eabi/include"
],
"limitSymbolsToIncludedHeaders": true
},
"compilerPath": "C:/Users/lamadaemon/Desktop/test/arm-none-eabi-gcc.bat",
"defines": [
<Removed due to too long>
],
"intelliSenseMode": "gcc-arm",
"cStandard": "c17",
"cppStandard": "gnu++17",
"compilerPathIsExplicit": true,
"cStandardIsExplicit": true,
"cppStandardIsExplicit": true,
"intelliSenseModeIsExplicit": true,
"compilerPathInCppPropertiesJson": "C:/Users/lamadaemon/Desktop/test/arm-none-eabi-gcc.bat",
"mergeConfigurations": false
}
Translation Unit Mappings:
[ C:\Users\lamadaemon\Desktop\dm-pwr-mgr\Core\Src\main.c ]:
C:\Users\lamadaemon\Desktop\dm-pwr-mgr\Core\Src\main.c
Translation Unit Configurations:
[ C:\Users\lamadaemon\Desktop\dm-pwr-mgr\Core\Src\main.c ]:
Process ID: 13616
Memory Usage: 72 MB
Compiler Path: C:\Users\lamadaemon\Desktop\test\arm-none-eabi-gcc.bat
Includes:
C:\Users\lamadaemon\Desktop\dm-pwr-mgr\Core\Inc
C:\Users\lamadaemon\Desktop\dm-pwr-mgr\Drivers\STM32G0xx_HAL_Driver\Inc
C:\Users\lamadaemon\Desktop\dm-pwr-mgr\Drivers\STM32G0xx_HAL_Driver\Inc\Legacy
C:\Users\lamadaemon\Desktop\dm-pwr-mgr\Drivers\CMSIS\Device\ST\STM32G0xx\Include
C:\Users\lamadaemon\Desktop\dm-pwr-mgr\Drivers\CMSIS\Include
Z:\usr\lib\gcc\arm-none-eabi\13.1.0\include
Z:\usr\lib\gcc\arm-none-eabi\13.1.0\include-fixed
Z:\usr\arm-none-eabi\include
Defines:
<Removed due to too long>
Standard Version: c17
IntelliSense Mode: windows-gcc-arm
Other Flags:
--gcc
--gnu_version=130100
Total Memory Usage: 72 MB
------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 125
--------------------------------
the language server logging
--------------------------------
loggingLevel: Debug
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
File exclude: **/.vscode
File exclude: **/.vs
File exclude: **/CVS
File exclude: **/.git
File exclude: **/.svn
File exclude: **/Thumbs.db
File exclude: **/.hg
File exclude: **/.DS_Store
Search exclude: **/node_modules
Search exclude: **/*.code-search
Search exclude: **/bower_components
LSP: cpptools/didChangeCppProperties (id: 1)
LSP: cpptools/queryCompilerDefaults (id: 2)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: C:/Users/lamadaemon/Desktop/test/arm-none-eabi-gcc.bat -x c++ -E -dM nul
Querying compiler for default C++ language standard using command line: C:/Users/lamadaemon/Desktop/test/arm-none-eabi-gcc.bat -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "C:/Users/lamadaemon/Desktop/test/arm-none-eabi-gcc.bat" -dumpmachine
Compiler returned default target value: arm-none-eabi
Compiler query command line: C:/Users/lamadaemon/Desktop/test/arm-none-eabi-gcc.bat -std=gnu++17 -Wp,-v -E -dM -x c++ nul
Compiler query command line: c:/users/lamadaemon/desktop/test/arm-none-eabi-gcc.bat -std=gnu++17 -Wp,-v -E -dM -x c++ /dev/null
Compiler include path not found: /usr/lib/gcc/arm-none-eabi/13.1.0/../../../../arm-none-eabi/include/c++/13.1.0
Compiler include path not found: /usr/lib/gcc/arm-none-eabi/13.1.0/../../../../arm-none-eabi/include/c++/13.1.0/arm-none-eabi
Compiler include path not found: /usr/lib/gcc/arm-none-eabi/13.1.0/../../../../arm-none-eabi/include/c++/13.1.0/backward
Compiler include path not found: /usr/lib/gcc/arm-none-eabi/13.1.0/include
Compiler include path not found: /usr/lib/gcc/arm-none-eabi/13.1.0/include-fixed
Compiler include path not found: /usr/lib/gcc/arm-none-eabi/13.1.0/../../../../arm-none-eabi/include
Attempting to get defaults from C++ compiler in "compilerPath" property: 'C:/Users/lamadaemon/Desktop/test/arm-none-eabi-gcc.bat'
Compiler query command line: C:/Users/lamadaemon/Desktop/test/arm-none-eabi-gcc.bat -std=c17 -Wp,-v -E -dM -x c nul
Compiler query command line: c:/users/lamadaemon/desktop/test/arm-none-eabi-gcc.bat -std=c17 -Wp,-v -E -dM -x c /dev/null
Compiler include path not found: /usr/lib/gcc/arm-none-eabi/13.1.0/include
Compiler include path not found: /usr/lib/gcc/arm-none-eabi/13.1.0/include-fixed
Compiler include path not found: /usr/lib/gcc/arm-none-eabi/13.1.0/../../../../arm-none-eabi/include
Attempting to get defaults from C compiler in "compilerPath" property: 'C:/Users/lamadaemon/Desktop/test/arm-none-eabi-gcc.bat'
Unable to retrieve file system information for Z:/usr/arm-none-eabi/include. error = -1
Unable to retrieve file system information for Z:/usr/lib/gcc/arm-none-eabi/13.1.0/include. error = -1
Unable to retrieve file system information for Z:/usr/lib/gcc/arm-none-eabi/13.1.0/include-fixed. error = -1
Unable to retrieve file system information for Z:/usr/lib/gcc/arm-none-eabi/13.1.0/include. error = -1
Unable to retrieve file system information for Z:/usr/lib/gcc/arm-none-eabi/13.1.0/include-fixed. error = -1
Unable to retrieve file system information for Z:/usr/arm-none-eabi/include. error = -1
Folder: C:/USERS/LAMADAEMON/DESKTOP/DM-PWR-MGR/CORE/INC/ will be indexed
Folder: C:/USERS/LAMADAEMON/DESKTOP/DM-PWR-MGR/DRIVERS/STM32G0XX_HAL_DRIVER/INC/ will be indexed
Folder: C:/USERS/LAMADAEMON/DESKTOP/DM-PWR-MGR/DRIVERS/CMSIS/DEVICE/ST/STM32G0XX/INCLUDE/ will be indexed
Folder: C:/USERS/LAMADAEMON/DESKTOP/DM-PWR-MGR/DRIVERS/CMSIS/INCLUDE/ will be indexed
Discovering files...
Processing folder (recursive): C:/USERS/LAMADAEMON/DESKTOP/DM-PWR-MGR/CORE/INC/
Processing folder (recursive): C:/USERS/LAMADAEMON/DESKTOP/DM-PWR-MGR/DRIVERS/STM32G0XX_HAL_DRIVER/INC/
Processing folder (recursive): C:/USERS/LAMADAEMON/DESKTOP/DM-PWR-MGR/DRIVERS/CMSIS/DEVICE/ST/STM32G0XX/INCLUDE/
Processing folder (recursive): C:/USERS/LAMADAEMON/DESKTOP/DM-PWR-MGR/DRIVERS/CMSIS/INCLUDE/
Discovering files: 125 file(s) processed
1 file(s) removed from database
Done discovering files.
Populating include completion cache.
Parsing remaining files...
Parsing: 0 files(s) processed
Done parsing remaining files.
LSP: cpptools/didChangeCppProperties (id: 3)
LSP: cpptools/didChangeSettings
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
Enhanced Colorization is enabled.
LSP: cpptools/textEditorSelectionChange
LSP: textDocument/didOpen: file:///c%3A/Users/lamadaemon/Desktop/dm-pwr-mgr/Core/Src/main.c
LSP: cpptools/activeDocumentChange: file:///c%3A/Users/lamadaemon/Desktop/dm-pwr-mgr/Core/Src/main.c
LSP: cpptools/getCodeActions: file:///c%3A/Users/lamadaemon/Desktop/dm-pwr-mgr/Core/Src/main.c (id: 4)
LSP: cpptools/getDocumentSymbols: file:///c%3A/Users/lamadaemon/Desktop/dm-pwr-mgr/Core/Src/main.c (id: 5)
LSP: cpptools/textEditorSelectionChange
tag parsing file: C:\Users\lamadaemon\Desktop\dm-pwr-mgr\Core\Src\main.c
LSP: cpptools/getSemanticTokens: file:///c%3A/Users/lamadaemon/Desktop/dm-pwr-mgr/Core/Src/main.c (id: 6)
sending compilation args for C:\Users\lamadaemon\Desktop\dm-pwr-mgr\Core\Src\main.c
include: C:\USERS\LAMADAEMON\DESKTOP\DM-PWR-MGR\CORE\INC
include: C:\USERS\LAMADAEMON\DESKTOP\DM-PWR-MGR\DRIVERS\STM32G0XX_HAL_DRIVER\INC
include: C:\USERS\LAMADAEMON\DESKTOP\DM-PWR-MGR\DRIVERS\STM32G0XX_HAL_DRIVER\INC\LEGACY
include: C:\USERS\LAMADAEMON\DESKTOP\DM-PWR-MGR\DRIVERS\CMSIS\DEVICE\ST\STM32G0XX\INCLUDE
include: C:\USERS\LAMADAEMON\DESKTOP\DM-PWR-MGR\DRIVERS\CMSIS\INCLUDE
include: Z:\USR\LIB\GCC\ARM-NONE-EABI\13.1.0\INCLUDE
include: Z:\USR\LIB\GCC\ARM-NONE-EABI\13.1.0\INCLUDE-FIXED
include: Z:\USR\ARM-NONE-EABI\INCLUDE
define: <Removed due to too long>
other: --gcc
other: --gnu_version=130100
stdver: c17
intelliSenseMode: windows-gcc-arm
Checking for syntax errors: C:\Users\lamadaemon\Desktop\dm-pwr-mgr\Core\Src\main.c
Queueing IntelliSense update for files in translation unit of: C:\Users\lamadaemon\Desktop\dm-pwr-mgr\Core\Src\main.c
LSP: cpptools/getFoldingRanges: file:///c%3A/Users/lamadaemon/Desktop/dm-pwr-mgr/Core/Src/main.c (id: 7)
LSP: cpptools/getCodeActions: file:///c%3A/Users/lamadaemon/Desktop/dm-pwr-mgr/Core/Src/main.c (id: 8)
Error squiggle count: 15
Error squiggles will be disabled in: file:///C%3A/Users/lamadaemon/Desktop/dm-pwr-mgr/Core/Src/main.c
Update IntelliSense time (sec): 0.404
LSP: cpptools/getInlayHints: file:///c%3A/Users/lamadaemon/Desktop/dm-pwr-mgr/Core/Src/main.c (id: 9)
LSP: cpptools/getFoldingRanges: file:///c%3A/Users/lamadaemon/Desktop/dm-pwr-mgr/Core/Src/main.c (id: 10)
LSP: cpptools/getCodeActions: file:///c%3A/Users/lamadaemon/Desktop/dm-pwr-mgr/Core/Src/main.c (id: 11)
LSP: cpptools/getDiagnostics (id: 12)Other Extensions
No response
Additional context
No response