<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">clangd-indexer does not seem to handle compile_commands.json with different directories. I am able to workaround the problem by passing '<span style="color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">-execute-concurrency=1'.</span><br></div><div dir="ltr" class="gmail_attr"><br></div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>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.</div><div>I am working with revision 356635 of clangd.</div><div><br></div><div>With a directory structure of:</div><div><br></div><div><div>./</div><div>./abc</div><div>./abc/test.h</div><div>./abc/test.cc</div><div>./def<br></div><div>./def/ytest.h<br></div><div>./def/xtest.cc</div><div>./compile_commands.json<br></div></div><div><br></div><div>And a compile_commands.json of:<br></div><div dir="ltr"><div><br></div><div><div>[</div><div>    {</div><div>        "arguments": [</div><div>            "g++",</div><div>            "-c",</div><div>            "-o",<br></div><div>            "test.o",</div><div>            "test.cc"</div><div>        ],</div><div>        "directory": "/home/test/abc",</div><div>        "file": "test.cc"</div><div>    },</div><div>    {</div><div>        "arguments": [</div><div>            "g++",</div><div>            "-c",</div><div>            "-o",<br></div><div>            "xtest.o",</div><div>            "xtest.cc"</div><div>        ],</div><div>        "directory": "/home/test/def",</div><div>        "file": "xtest.cc"</div><div>    }</div><div>]</div></div><div><br></div><div>I receive the error:</div><div><br></div><div><div>[test]$ clangd-indexer -executor=all-TUs compile_commands.json  > clangd.dex</div><div>[1/2] Processing file /home/test/abc/test.cc</div><div>[2/2] Processing file /home/test/def/xtest.cc</div><div>error: no such file or directory: 'test.cc'</div><div>error: no input files</div><div>error: unable to handle compilation, expected exactly one compiler job in ''</div><div>Error while processing /home/test/abc/test.cc.</div><div>Failed to run action on /home/test/abc/test.cc</div></div><div><br></div><div><br></div><div>I assume it may be related to a non-thread-safe chdir somewhere in the code.</div></div></div></div></div></div></div></div></div>