1. use windows path separator in compile_commands.json.
"command": "F:\\ARMGCC\\bin\\arm-none-eabi-gcc.exe ..."
System include extraction: F:/STM32/Blink/build\ARMGCCbinarm-none-eabi-g++.exe does not exist.
2. use linux path separator in compile_commands.json.
"command": "F:/ARMGCC/bin/arm-none-eabi-gcc.exe ..."
E[11:49:05.982] System include extraction: start marker not found: Using built-in specs.
COLLECT_GCC=F:/ARMGCC/bin/arm-none-eabi-g++.exe
Target: arm-none-eabi
Configured with: /tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/src/gcc/configure --build=x86_64-linux-gnu --host=i686-w64-mingw32 --target=arm-none-eabi --prefix=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/install-mingw --libexecdir=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/install-mingw/lib --infodir=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/install-mingw/share/doc/gcc-arm-none-eabi/info --mandir=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/install-mingw/share/doc/gcc-arm-none-eabi/man --htmldir=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/install-mingw/share/doc/gcc-arm-none-eabi/html --pdfdir=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/install-mingw/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --enable-mingw-wildcard --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-headers=yes --with-newlib --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/install-mingw/arm-none-eabi --with-libiconv-prefix=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/build-mingw/host-libs/usr --with-gmp=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/build-mingw/host-libs/usr --with-mpfr=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/build-mingw/host-libs/usr --with-mpc=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/build-mingw/host-libs/usr --with-isl=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/build-mingw/host-libs/usr --with-libelf=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/build-mingw/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for Arm Embedded Processors 7-2018-q2-update' --with-multilib-list=rmprofile
Thread model: single
gcc version 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907] (GNU Tools for Arm Embedded Processors 7-2018-q2-update)
COLLECT_GCC_OPTIONS='-E' '-v'
f:/armgcc/bin/../lib/gcc/arm-none-eabi/7.3.1/cc1plus.exe -E -quiet -v -iprefix f:\armgcc\bin\../lib/gcc/arm-none-eabi/7.3.1/ -isysroot f:\armgcc\bin\../arm-none-eabi -D__USES_INITFINI__ -
ignoring duplicate directory "f:/armgcc/lib/gcc/../../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/include/c++/7.3.1"
ignoring duplicate directory "f:/armgcc/lib/gcc/../../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/include/c++/7.3.1/arm-none-eabi"
ignoring duplicate directory "f:/armgcc/lib/gcc/../../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/include/c++/7.3.1/backward"
ignoring duplicate directory "f:/armgcc/lib/gcc/../../lib/gcc/arm-none-eabi/7.3.1/include"
ignoring nonexistent directory "f:\armgcc\bin\../arm-none-eabi/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/install-mingw/lib/gcc/arm-none-eabi/7.3.1/../../../../include"
ignoring duplicate directory "f:/armgcc/lib/gcc/../../lib/gcc/arm-none-eabi/7.3.1/include-fixed"
ignoring duplicate directory "f:/armgcc/lib/gcc/../../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/include"
ignoring nonexistent directory "f:\armgcc\bin\../arm-none-eabi/usr/include"
#include "..." search starts here:
#include <...> search starts here:
f:\armgcc\bin\../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/include/c++/7.3.1
f:\armgcc\bin\../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/include/c++/7.3.1/arm-none-eabi
f:\armgcc\bin\../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/include/c++/7.3.1/backward
f:\armgcc\bin\../lib/gcc/arm-none-eabi/7.3.1/include
f:\armgcc\bin\../lib/gcc/arm-none-eabi/7.3.1/include-fixed
f:\armgcc\bin\../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/include
End of search list.
COMPILER_PATH=f:/armgcc/bin/../lib/gcc/arm-none-eabi/7.3.1/;f:/armgcc/bin/../lib/gcc/;f:/armgcc/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/
LIBRARY_PATH=f:/armgcc/bin/../lib/gcc/arm-none-eabi/7.3.1/;f:/armgcc/bin/../lib/gcc/;f:/armgcc/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/;f:/armgcc/bin/../arm-none-eabi/lib/
COLLECT_GCC_OPTIONS='-E' '-v'
I[11:49:05.982] System include extractor: succesfully executed F:/ARMGCC/bin/arm-none-eabi-g++.exe, got includes: ""
@ArcsinX Do you also sleep with your windows and doors unlocked/open? 😃
aha! i was just trying to point out the slash mismatch, but you beat me to it. we’ll try to get this handled more graciously on clangd side as well (i.e. look for a file with os executable suffix if we can’t find the driver at first try), but it won’t be available before clangd-13 (which is due in 6 months).
So for a faster solution you might want to contact the tool generating the compile_commands.json to see why they don’t keep the executable suffix. This is the first time we’re facing this issue, so I guess most other generators in windows must be preserving the suffix.
Agreed, we definitely should and I’ll prepare a patch for the
.exe
issue. Thanks for swift action on your side as well!Also if you are shipping your own clangd with the ide (i.e. not just making use of the major llvm releases, but building from close to HEAD), you can just wait for us to land the fix, which should happen in less than a week.
Hi @kadircet, I’m partly responsible for the code that generated @Falven’s
compile_commands.json
files 😃Looking at our code, it seems that the suffix was never there in the first place. The compilation commands are generated from configuration files that specify templates for compilation commands, but these are cross-platform, so they just specify the command to execute (optionally qualified with a path) and we pass that on to the platform as-is (through
go.Cmd
), which apparently accepts the path without .exe or adds it somewhere.This is also the reason we have mixed slashes: The config files just use forward slashes, but some parts are interpolated into the templates by our toolling, so those use native slashes. So far, this has not been a problem, Windows (for the cmd) and gcc (for e.g. include paths) accept the mixed paths just fine. This also means that the mixed slashes are hard for us to fix, since our tooling does not really know which arguments are paths and which are not (there might also be slashes in non-path arguments that should not be touched).
However, looking at the @Falven’s last comment, it seems the mixed slashes are not really a problem, just the .exe, which is something we can probably add, at least for now. It would be good if clangd would indeed be more permissive in this area, though.
Ok. So if I fix all of the non-windows paths, and append the
.exe
extension to both thecompile_commands.json
and--query-driver
command, it works!