-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compiledb for clang and/or MinGW GCC generates empty compile_commands.json #96
Comments
I have the same error, but in my case, the file is completely empty. EDIT: I fixed it by running a fake build, ie with the |
Unfortunately,
Seems that quote symbol before |
Can't clang generate compile_commands.json files natively? |
I have the same issue, my compile_commands.json just show: |
Same with me. I am getting compile_commands.json with only [] in Windows |
I encountered the same error on MacOS 10.15. I fix this through using |
Same issue with me too. I am working on a huge project that generally uses a couple of different compilers to compile for different embedded platforms, all on a remote ubuntu machine. All I wanted to do is have a compilation db to get proper autocompletion, code jumping/navigation etc. I exported the make -Bnwk output to a build.log, copied it to my local machine and used compiledb.exe --parse build.log and it didn't work. Also tried cat build.log | compiledb.exe for each of the following cases. I tried removing all binary characters, removing the entire path of compilers and replacing them with just gcc/clang/CC & g++/clang++/CXX, no avail. I keep getting just [] in my compiled_commands.json I hope there is some workaround. |
I ran into this Issue working under msys on a Windows host. As a python package compiledb relies on the standard python pathname processing built-ins. These, of course, do not handle the special pathname conventions Posix shell environments like MSYS or Cygwin use to represent Windows drive-letters. As a result joining the current working dir and the filename path captured from make does not produce a correct legal windows pathname. This causes the check that the file corresponding to the joined pathname exists to fail(unless you've specifiied -S) no entry is generated. Even if you specify -S the pathnames are mostly mangled/useless. I've created a PR (#110) with a small patch that fixes this. Feedback from folks using cygwin etc welcome! |
Same issue here. compiledb only produces a Also I tried running compiledb on the same project inside WSL2 and it works perfectly. |
I also have this issue. Is there any way compiledb can support MSVC? I would love to see some sort of output after trying at least 5 diffirent ways to try to generate this illusive file. |
I noticed that compiledb puts in compilation database only the files which are at the root of the project, but not the files which are in subdirectories. I guess this could be because it does not handle properly windows' path separator |
I had the same issue. You'll have to add it back in manually to the generated compile_commands.json after though. Your makefile would become:
|
I have this issue building a package with a custom Makefile for EDK2. Here it is in case it helps. all: build
.PHONY: build
build: Application/BootLib \
FFPkg.dec \
FFPkg.dsc
cd .. && \
. ./edksetup.sh && \
build && \
cp ./Build/FFPkg/DEBUG_GCC/X64/FFPkg.efi ./Build/EmulatorX64/DEBUG_GCC5/X64/FFFinger.efi && \
echo "run" > gdb_commands && \
echo "y" >> gdb_commands && \
EmulatorPkg/build.sh run < gdb_commands && \
rm gdb_commands I did remove the gdb run, and it still did not work. The pipe method did not work because of some custom logging not working. Turns out the build command does not work with compiledb either |
I found a great solution on StackOverflow
https://stackoverflow.com/questions/21134120/how-to-turn-makefile-into-json-compilation-database |
Hi!
Have pretty simple C project containing just one source file
hello.c
:here is
Makefile
for this project:I've
compiledb
installed by:pip install compiledb
So, when I'm trying to run
compiledb make clang
:It shows me following output:
But generated
compile_commands.json
contains just square brackets:[]
Same if I try to compile by
compiledb make mingw
.So is compiledb can work at Windows OS?
The text was updated successfully, but these errors were encountered: