[clangd-dev] clangd-indexer fails with concurrency and multiple directories

Ilya Biryukov via clangd-dev clangd-dev at lists.llvm.org
Fri Mar 22 02:43:13 PDT 2019


Hi Shane,

Thanks for bringing this up, we actually seem to have all the required
infrastructure to fix this.
I've created https://reviews.llvm.org/D59683 to fix this, feel free to
patch it in locally while it's on review.

On Thu, Mar 21, 2019 at 4:47 PM Shane Hird via clangd-dev <
clangd-dev at lists.llvm.org> wrote:

> clangd-indexer does not seem to handle compile_commands.json with
> different directories. I am able to workaround the problem by passing '
> -execute-concurrency=1'.
>
> It seems to work ok with a single directory (i.e with just 'abc' from the
> example below), but fails if there are multiple, as in the example below.
> I am working with revision 356635 of clangd.
>
> With a directory structure of:
>
> ./
> ./abc
> ./abc/test.h
> ./abc/test.cc
> ./def
> ./def/ytest.h
> ./def/xtest.cc
> ./compile_commands.json
>
> And a compile_commands.json of:
>
> [
>     {
>         "arguments": [
>             "g++",
>             "-c",
>             "-o",
>             "test.o",
>             "test.cc"
>         ],
>         "directory": "/home/test/abc",
>         "file": "test.cc"
>     },
>     {
>         "arguments": [
>             "g++",
>             "-c",
>             "-o",
>             "xtest.o",
>             "xtest.cc"
>         ],
>         "directory": "/home/test/def",
>         "file": "xtest.cc"
>     }
> ]
>
> I receive the error:
>
> [test]$ clangd-indexer -executor=all-TUs compile_commands.json  >
> clangd.dex
> [1/2] Processing file /home/test/abc/test.cc
> [2/2] Processing file /home/test/def/xtest.cc
> error: no such file or directory: 'test.cc'
> error: no input files
> error: unable to handle compilation, expected exactly one compiler job in
> ''
> Error while processing /home/test/abc/test.cc.
> Failed to run action on /home/test/abc/test.cc
>
>
> I assume it may be related to a non-thread-safe chdir somewhere in the
> code.
> _______________________________________________
> clangd-dev mailing list
> clangd-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev
>


-- 
Regards,
Ilya Biryukov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/clangd-dev/attachments/20190322/98edeab6/attachment.html>


More information about the clangd-dev mailing list